Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation, typing info. Prepare RTD
- Loading branch information
1 parent
4e5ef30
commit 5627cba
Showing
6 changed files
with
134 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
.. AdvancedProperty | ||
API: AdvancedProperty | ||
======================== | ||
|
||
.. py:module:: advanced_descriptors | ||
.. py:currentmodule:: advanced_descriptors | ||
.. py:class:: AdvancedProperty(fget=None, fset=None, fdel=None, fcget=None, ) | ||
Advanced property main entry point. | ||
|
||
:param fget: normal getter. | ||
:type fget: ``typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]`` | ||
:param fset: normal setter. | ||
:type fset: ``typing.Optional[typing.Callable[[typing.Any, typing.Any], None]]`` | ||
:param fdel: normal deleter. | ||
:type fdel: ``typing.Optional[typing.Callable[[typing.Any, ], None]]`` | ||
:param fcget: class getter. Used as normal, if normal is None. | ||
:type fcget: ``typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]`` | ||
|
||
.. note:: doc argument is not supported due to class wide getter usage. | ||
|
||
.. py:method:: getter(fget) | ||
Descriptor to change the getter on a property. | ||
|
||
:param fget: new normal getter. | ||
:type fget: ``typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]`` | ||
:rtype: ``AdvancedProperty`` | ||
|
||
.. py:method:: setter(fset) | ||
Descriptor to change the setter on a property. | ||
|
||
:param fset: new setter. | ||
:type fset: ``typing.Optional[typing.Callable[[typing.Any, typing.Any], None]]`` | ||
:rtype: ``AdvancedProperty`` | ||
|
||
.. py:method:: deleter(fdel) | ||
Descriptor to change the deleter on a property. | ||
|
||
:param fdel: New deleter. | ||
:type fdel: ``typing.Optional[typing.Callable[[typing.Any, ], None]]`` | ||
:rtype: ``AdvancedProperty`` | ||
|
||
.. py:method:: cgetter(fcget) | ||
Descriptor to change the class wide getter on a property. | ||
|
||
:param fcget: new class-wide getter. | ||
:type fcget: ``typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]`` | ||
:rtype: ``AdvancedProperty`` | ||
|
||
.. py:attribute:: fget | ||
``typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]`` | ||
Getter instance. | ||
|
||
.. py:attribute:: fset | ||
``typing.Optional[typing.Callable[[typing.Any, typing.Any], None]]`` | ||
Setter instance. | ||
|
||
.. py:attribute:: fdel | ||
``typing.Optional[typing.Callable[[typing.Any, ], None]]`` | ||
Deleter instance. | ||
|
||
.. py:attribute:: fcget | ||
``typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]`` | ||
Class wide getter instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.. SeparateClassMethod | ||
API: SeparateClassMethod | ||
======================== | ||
|
||
.. py:module:: advanced_descriptors | ||
.. py:currentmodule:: advanced_descriptors | ||
.. py:class:: SeparateClassMethod(imeth=None, cmeth=None, ) | ||
Separate class method and instance methods. | ||
|
||
:param imeth: Instance method | ||
:type imeth: ``typing.Optional[typing.Callable[..., typing.Any]]`` | ||
:param cmeth: Class method | ||
:type cmeth: ``typing.Optional[typing.Callable[..., typing.Any]]`` | ||
|
||
.. py:method:: instance_method(imeth) | ||
Descriptor to change instance method. | ||
|
||
:param imeth: New instance method. | ||
:type imeth: ``typing.Optional[typing.Callable[..., typing.Any]]`` | ||
:rtype: ``SeparateClassMethod`` | ||
|
||
.. py:method:: class_method(cmeth) | ||
Descriptor to change class method. | ||
|
||
:type cmeth: New class method. | ||
:type cmeth: ``typing.Optional[typing.Callable[..., typing.Any]]`` | ||
:rtype: ``SeparateClassMethod`` | ||
|
||
.. py:attribute:: imeth | ||
``typing.Optional[typing.Callable[..., typing.Any]]`` | ||
Instance method instance. | ||
|
||
.. py:attribute:: cmeth | ||
``typing.Optional[typing.Callable[..., typing.Any]]`` | ||
Class method instance. |