apply 2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- apply/__init__.py +5 -0
- apply/apply.py +12 -0
- apply-2.0.dist-info/METADATA +172 -0
- apply-2.0.dist-info/RECORD +7 -0
- apply-2.0.dist-info/WHEEL +5 -0
- apply-2.0.dist-info/licenses/LICENSE +24 -0
- apply-2.0.dist-info/top_level.txt +1 -0
apply/__init__.py
ADDED
apply/apply.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""An apply function for Python 2 and 3."""
|
|
2
|
+
|
|
3
|
+
def apply(object, args=None, kwargs=None):
|
|
4
|
+
"""Call a callable object with positional arguments taken from the
|
|
5
|
+
tuple args, and keyword arguments taken from the optional dictionary
|
|
6
|
+
kwargs; return its results.
|
|
7
|
+
"""
|
|
8
|
+
if args is None:
|
|
9
|
+
args = ()
|
|
10
|
+
if kwargs is None:
|
|
11
|
+
kwargs = {}
|
|
12
|
+
return object(*args, **kwargs)
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: apply
|
|
3
|
+
Version: 2.0
|
|
4
|
+
Summary: An apply function for Python 2 and 3
|
|
5
|
+
Home-page: https://github.com/stefanholek/apply
|
|
6
|
+
Author: Stefan H. Holek
|
|
7
|
+
Author-email: stefan@epy.co.at
|
|
8
|
+
License: BSD-2-Clause
|
|
9
|
+
Project-URL: Documentation, https://apply.readthedocs.io/en/stable/
|
|
10
|
+
Keywords: apply,read,write,property,properties
|
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Requires-Python: >=3.5
|
|
17
|
+
Description-Content-Type: text/x-rst
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Provides-Extra: docs
|
|
20
|
+
Requires-Dist: sphinx==9.1.0; extra == "docs"
|
|
21
|
+
Requires-Dist: sphinx-rtd-theme==3.1.0; extra == "docs"
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
=====
|
|
25
|
+
apply
|
|
26
|
+
=====
|
|
27
|
+
------------------------------------
|
|
28
|
+
An apply function for Python 2 and 3
|
|
29
|
+
------------------------------------
|
|
30
|
+
|
|
31
|
+
Package Contents
|
|
32
|
+
================
|
|
33
|
+
|
|
34
|
+
apply(object, args=None, kwargs=None)
|
|
35
|
+
Call object with args and kwargs; return its results.
|
|
36
|
+
|
|
37
|
+
Overview
|
|
38
|
+
========
|
|
39
|
+
|
|
40
|
+
Python 3 has no apply. We like apply.
|
|
41
|
+
If you like apply as well, have no fear. This version of apply works
|
|
42
|
+
across all versions of Python.
|
|
43
|
+
|
|
44
|
+
Examples
|
|
45
|
+
========
|
|
46
|
+
|
|
47
|
+
apply allows to create read/write properties in a very compact way:
|
|
48
|
+
|
|
49
|
+
.. code-block:: python
|
|
50
|
+
|
|
51
|
+
from apply import apply
|
|
52
|
+
|
|
53
|
+
class X509:
|
|
54
|
+
|
|
55
|
+
def __init__(self, store):
|
|
56
|
+
self.store = store
|
|
57
|
+
|
|
58
|
+
@apply
|
|
59
|
+
def CN():
|
|
60
|
+
doc = 'The common name attribute'
|
|
61
|
+
def get(self):
|
|
62
|
+
return self.store.get('CN')
|
|
63
|
+
def set(self, value):
|
|
64
|
+
self.store.put('CN', value)
|
|
65
|
+
return property(get, set, None, doc)
|
|
66
|
+
|
|
67
|
+
record = X509(LDAP())
|
|
68
|
+
record.CN = 'Slate Rock and Gravel Company'
|
|
69
|
+
|
|
70
|
+
Documentation
|
|
71
|
+
=============
|
|
72
|
+
|
|
73
|
+
For further details please refer to the `API Documentation`_.
|
|
74
|
+
|
|
75
|
+
.. _`API Documentation`: https://apply.readthedocs.io/en/stable/
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
Changelog
|
|
79
|
+
=========
|
|
80
|
+
|
|
81
|
+
2.0 - 2026-07-06
|
|
82
|
+
----------------
|
|
83
|
+
|
|
84
|
+
- Remove deprecated license classifier.
|
|
85
|
+
[stefan]
|
|
86
|
+
|
|
87
|
+
- Upgrade GitHub workflow.
|
|
88
|
+
[stefan]
|
|
89
|
+
|
|
90
|
+
- Upgrade .readthedocs.yaml.
|
|
91
|
+
[stefan]
|
|
92
|
+
|
|
93
|
+
- Upgrade sphinx and sphinx-rtd-theme in docs extra.
|
|
94
|
+
[stefan]
|
|
95
|
+
|
|
96
|
+
- Require Python >= 3.5.
|
|
97
|
+
[stefan]
|
|
98
|
+
|
|
99
|
+
1.7 - 2023-09-14
|
|
100
|
+
----------------
|
|
101
|
+
|
|
102
|
+
- Update tox.ini for latest tox.
|
|
103
|
+
[stefan]
|
|
104
|
+
|
|
105
|
+
- Add GitHub CI workflow.
|
|
106
|
+
[stefan]
|
|
107
|
+
|
|
108
|
+
- Add .readthedocs.yaml file.
|
|
109
|
+
[stefan]
|
|
110
|
+
|
|
111
|
+
- Pin sphinx and sphinx-rtd-theme versions in docs extra.
|
|
112
|
+
[stefan]
|
|
113
|
+
|
|
114
|
+
1.6 - 2022-03-09
|
|
115
|
+
----------------
|
|
116
|
+
|
|
117
|
+
- Add Python 3.8-3.10 to tox.ini. Remove old Python versions.
|
|
118
|
+
[stefan]
|
|
119
|
+
|
|
120
|
+
- Replace deprecated ``python setup.py test`` in tox.ini.
|
|
121
|
+
[stefan]
|
|
122
|
+
|
|
123
|
+
- Remove deprecated ``test_suite`` from setup.py.
|
|
124
|
+
[stefan]
|
|
125
|
+
|
|
126
|
+
- Move metadata to setup.cfg and add a pyproject.toml file.
|
|
127
|
+
[stefan]
|
|
128
|
+
|
|
129
|
+
- Include tests in sdist but not in wheel.
|
|
130
|
+
[stefan]
|
|
131
|
+
|
|
132
|
+
1.5 - 2019-01-28
|
|
133
|
+
----------------
|
|
134
|
+
|
|
135
|
+
- Add MANIFEST.in.
|
|
136
|
+
[stefan]
|
|
137
|
+
|
|
138
|
+
- Release as wheel.
|
|
139
|
+
[stefan]
|
|
140
|
+
|
|
141
|
+
1.4 - 2017-02-05
|
|
142
|
+
----------------
|
|
143
|
+
|
|
144
|
+
- Support Python 2.6-3.6 without 2to3.
|
|
145
|
+
[stefan]
|
|
146
|
+
|
|
147
|
+
- Add a LICENSE file.
|
|
148
|
+
[stefan]
|
|
149
|
+
|
|
150
|
+
1.3 - 2014-04-19
|
|
151
|
+
----------------
|
|
152
|
+
|
|
153
|
+
- Remove setuptools from install_requires because it isn't.
|
|
154
|
+
[stefan]
|
|
155
|
+
|
|
156
|
+
1.2 - 2011-11-26
|
|
157
|
+
----------------
|
|
158
|
+
|
|
159
|
+
- Update README.
|
|
160
|
+
[stefan]
|
|
161
|
+
|
|
162
|
+
1.1 - 2011-11-26
|
|
163
|
+
----------------
|
|
164
|
+
|
|
165
|
+
- Fix function signature.
|
|
166
|
+
[stefan]
|
|
167
|
+
|
|
168
|
+
1.0 - 2011-11-25
|
|
169
|
+
----------------
|
|
170
|
+
|
|
171
|
+
- Initial release.
|
|
172
|
+
[stefan]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
apply/__init__.py,sha256=OxfD04OPJAnj0ucnRMXxWLt-jLUr6DmeBu83RCkTiDY,94
|
|
2
|
+
apply/apply.py,sha256=MntHMLlqm8FWqRFHeiWJeu3Ch5iq8l0fS4k4XUoWfUs,389
|
|
3
|
+
apply-2.0.dist-info/licenses/LICENSE,sha256=qiKHiCbjHMdeRCuvzGwNZKAazNJtNOlrqWGbuJs4wH4,1288
|
|
4
|
+
apply-2.0.dist-info/METADATA,sha256=RQ-p9XWThXz6KHzHe2UxQ3vtmtXEvGo-IS_CSqCykXY,3371
|
|
5
|
+
apply-2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
6
|
+
apply-2.0.dist-info/top_level.txt,sha256=ukpvWBW-F5jzNIFBH1NfPc6AtiIE88h_HRZyw-ATvwg,6
|
|
7
|
+
apply-2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Copyright (c) 2011-2026 Stefan H. Holek
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
|
5
|
+
modification, are permitted provided that the following conditions
|
|
6
|
+
are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
+
notice, this list of conditions and the following disclaimer in the
|
|
12
|
+
documentation and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
15
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
16
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
17
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
18
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
19
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
20
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
21
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
22
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
23
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
24
|
+
SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
apply
|