Advanded descriptors for special cases.
Project description
Advanced descriptors
This package includes helpers for special cases:
SeparateClassMethod - allow to have classmethod and normal method both with the same name.
AdvancedProperty - property with possibility to set class wide getter.
SeparateClassMethod
This descriptor can be set using standard decorator syntax. Create instance with arguments:
def imeth(instance):
return instance.value
def cmeth(owner):
return owner.value
class Target(object):
value = 1
def __init__(self):
self.value = 2
getval = advanced_descriptors.SeparateClassMethod(
imeth, cmeth
)
Create instance wrapping as decorator:
class Target(object):
value = 1
def __init__(self):
self.value = 2
@advanced_descriptors.SeparateClassMethod
def getval(self):
return self.value
@getval.class_method
def getval(cls):
return cls.value
Cases with method only and classmethod only is useless: method as-is and @classmethod should be used in corresponding cases.
AdvancedProperty
This descriptor should be used in cases, when in addition to normal property API, class getter is required. If class-wide setter and deleter also required - you should use standard propery in metaclass.
Usage examples:
In addition to normal property API:
class Target(object): _value = 777 def __init__(self): self._value = 42 @advanced_descriptors.AdvancedProperty def val(self): return self._value @val.setter def val(self, value): self._value = value @val.deleter def val(self): self._value = 0 @val.cgetter def val(cls): return cls._value
Use class-wide getter for instance too:
class Target(object): _value = 1 val = advanced_descriptors.AdvancedProperty() @val.cgetter def val(cls): return cls._value
Testing
The main test mechanism for the package advanced-descriptors is using tox. Test environments available:
pep8 py27 py34 py35 py36 pypy pypy3 pylint pep257
CI systems
For code checking several CI systems is used in parallel:
Travis CI: is used for checking: PEP8, pylint, bandit, installation possibility and unit tests. Also it’s publishes coverage on coveralls.
AppVeyor: is used for checking windows compatibility.
coveralls: is used for coverage display.
CD system
Travis CI: is used for package delivery on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for Advanced-Descriptors-0.5.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c62a3f6874418717c2823f1dba0a0402f92a985c568cc2413806c38295361dd2 |
|
MD5 | 05ff288e8a69448fd279888d29d6b084 |
|
BLAKE2b-256 | 8e6e627e00cb7f8b6bd692da0905c13dd111f75680ee703bb2387c4b4c72f60e |
Hashes for Advanced_Descriptors-0.5.6-cp36-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e4e5d8012fdd456e0ecde10c7a6c044bb181fb465a47738c5e4bcd0f21abe7e |
|
MD5 | 3ee002c2dd04478519906f73287d0aa0 |
|
BLAKE2b-256 | 273e37c0b14f2b9928f93c4d624b827bef263926e05b77d3002ff5d66562eca2 |
Hashes for Advanced_Descriptors-0.5.6-cp36-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0212f824082e9f5aa057b67426b8ebe833453f075f38151ed7ab8b7783dfa62c |
|
MD5 | 2f694131b705a13e72e87ed00716f15c |
|
BLAKE2b-256 | e11f9e581474325787197ee0b4a737e32820d8f612a1334ef59b06532e831d44 |
Hashes for Advanced_Descriptors-0.5.6-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e515070d885a046cb1bc4a0e6914ec25c1a0e5acff96e7d4c661c623b4a486e |
|
MD5 | fc5db228550110a2988b8a428ff4f458 |
|
BLAKE2b-256 | e07192f7a01722997c0d5bd35edfff672e9766af5d7cf629cba2eae045641001 |
Hashes for Advanced_Descriptors-0.5.6-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a67c5de8e0eb91821512f6f6870f1a741f645a9a04679a58637e523770b8204 |
|
MD5 | 86c9a686304da9034b251c647a581f7d |
|
BLAKE2b-256 | 753646c716d04b5a1624dfda48d774f525267bc793dec5b3c95b851a3fd2a584 |
Hashes for Advanced_Descriptors-0.5.6-cp35-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ced6077e115e1c017b4e6324ccd4d7eb1ac70c4bd15c1c69c76f42424b1b7ec0 |
|
MD5 | f468e200252e083b197770a704bcc7b7 |
|
BLAKE2b-256 | 58b27fbaa8741e51248c55b5a21b80ea57baf149b90d09df5d6550cef3070771 |
Hashes for Advanced_Descriptors-0.5.6-cp35-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52c7e3bcfc8ba47de1fa3c8902b73f0e25a90986cf0369e912199ca51f87ab12 |
|
MD5 | b2d395f97dc22850115d2bc945c66099 |
|
BLAKE2b-256 | b01e2acd6bc03ff65a2e9af7237259026127de67d4a00b77e49efb64b917ea90 |
Hashes for Advanced_Descriptors-0.5.6-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 563f663946da3dce639ced56b4d006593a1aa6085ae2f8a6386e540283699c37 |
|
MD5 | bb886de6686a74f90b90c689274cf883 |
|
BLAKE2b-256 | f42b8d4801aa197e48825c44765b83641d996365cd85b9a3d1c92ae77161c6d8 |
Hashes for Advanced_Descriptors-0.5.6-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 132524334f63d9a9daab766aa1ae6af90b62f987f141db4473cf047aa3535135 |
|
MD5 | baf89aec0296325776a6ff62aff1bb82 |
|
BLAKE2b-256 | 5e3a0acbbd101d89039e2b869f97a4f750904c603c0d1512018bbd359492e8d7 |
Hashes for Advanced_Descriptors-0.5.6-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec3a0935ac437b766858109d52ba982a1f8efb41ad8469b3a654bcb0b210624c |
|
MD5 | a3ba16b13091b9dc5d084bea4bf1237b |
|
BLAKE2b-256 | f41168e97d04480b7ef201f3ecfdfd3dfc0e8144f3b746cbbcccd4cdde69c9b4 |
Hashes for Advanced_Descriptors-0.5.6-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 951e05f5a54fa853c79bd6d867aa5f97b9684243eab4a7dcafd7123488dfe607 |
|
MD5 | 51019692b09c01fba4dbbd8945d9a03a |
|
BLAKE2b-256 | 6f2ace8968cf716b09cc830432de213a814e4bdfc75c2fe9ffd9b0e87f77b525 |
Hashes for Advanced_Descriptors-0.5.6-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a02fc06ae013b20a3bb38d759b81f169b279ea92d9b95ed8f3742e87d02544b |
|
MD5 | f57a6e41b05157cb6abddc2741c70d1c |
|
BLAKE2b-256 | 4f4ade3d5155274d1fe39c4efdb5e9096d058d5a6f009110d9db808dce55aca1 |
Hashes for Advanced_Descriptors-0.5.6-cp34-cp34m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7030097e0631fea5ccfc52891d9d83595fbe8dbe41efcad0b811db1dc02aa453 |
|
MD5 | cfa1fab225c0d67deb8554f48ee46bc3 |
|
BLAKE2b-256 | bc5a4b4e3032c64fd98b0ff1b702bcd0703bf0bf592080ab9e1799fe631bcfbb |
Hashes for Advanced_Descriptors-0.5.6-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6aa3324d42f8ac3ffb52bde05056eedffe5e5eac8de0e5feefc6137626d889c |
|
MD5 | 887b745396b32a8323fd6ee3b2a6a17b |
|
BLAKE2b-256 | a27a8fa52299d6c619701fe7dbfcb5c5a14a8a97797466eb5b39cfa29616c3cb |
Hashes for Advanced_Descriptors-0.5.6-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bb2b8986c61895abaf71039193c05fa09dde988f2c6275c913d3b22ec73f39d |
|
MD5 | e77dc241f92fe7fdb84bfccfcb360d50 |
|
BLAKE2b-256 | 439cf10324e46e229c02ee4c0ed371ed5b8c271cf1be8292d06cfa0a64f32b17 |
Hashes for Advanced_Descriptors-0.5.6-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 506d7c4f696995fb842b59dbce12758209eb5c0bfd44c4e953ec1cee3f2c4be9 |
|
MD5 | 5cc624d416a8fdbdd9a774102101887f |
|
BLAKE2b-256 | 4fce46f3eac912393dacdeb551c9aa052075ec0543c575b2371e6f58e7056d4d |
Hashes for Advanced_Descriptors-0.5.6-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8592fae38f0f0c2df92944fe67f0a7b7af51c90798adee75bea207dd7a5e2acf |
|
MD5 | e63314e047c392c1987ff2eaf2f90fca |
|
BLAKE2b-256 | 8eb5171de90b11a92f2e74d95db1bec1bdc9163ff02e266e2c025ea2e8b4d210 |
Hashes for Advanced_Descriptors-0.5.6-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c49b3bd048241aee4a9115ffa08d5e60267f27851922479d541e4fff1683537c |
|
MD5 | a9e9e979283567178fe280a20912e25c |
|
BLAKE2b-256 | 971a833046809731bf1c434cad08f96f509610f1c7479d16d8d923fcadd44aef |