Skip to content

Commit 9b21a02

Browse files
authored
Version 1.0.7: python 2.7 only (#27)
Less setup logic, faster build
1 parent 1a47017 commit 9b21a02

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

advanced_descriptors/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
__all__ = ("SeparateClassMethod", "AdvancedProperty")
2020

21-
__version__ = "1.0.6"
21+
__version__ = "1.0.7"
2222
__author__ = "Alexey Stepanov"
2323
__author_email__ = "[email protected]"
2424
__maintainers__ = {

advanced_descriptors/advanced_property.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def __delete__(self, instance): # type: (typing.Any) -> None
184184
def fget(self): # type: () -> typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]
185185
"""Getter instance.
186186
187+
:return: Normal getter instance
187188
:rtype: typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]
188189
"""
189190
return self.__fget
@@ -192,6 +193,7 @@ def fget(self): # type: () -> typing.Optional[typing.Callable[[typing.Any, ], t
192193
def fset(self): # type: () -> typing.Optional[typing.Callable[[typing.Any, typing.Any], None]]
193194
"""Setter instance.
194195
196+
:return: Setter instance
195197
:rtype: typing.Optional[typing.Callable[[typing.Any, typing.Any], None]]
196198
"""
197199
return self.__fset
@@ -200,6 +202,7 @@ def fset(self): # type: () -> typing.Optional[typing.Callable[[typing.Any, typi
200202
def fdel(self): # type: () -> typing.Optional[typing.Callable[[typing.Any, ], None]]
201203
"""Deleter instance.
202204
205+
:return: Deletter instance
203206
:rtype: typing.Optional[typing.Callable[[typing.Any, ], None]]
204207
"""
205208
return self.__fdel
@@ -208,6 +211,7 @@ def fdel(self): # type: () -> typing.Optional[typing.Callable[[typing.Any, ], N
208211
def fcget(self): # type: () -> typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]
209212
"""Class wide getter instance.
210213
214+
:return: Class wide getter instance
211215
:rtype: typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]
212216
"""
213217
return self.__fcget
@@ -219,6 +223,7 @@ def getter(
219223
220224
:param fget: new normal getter.
221225
:type fget: typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]
226+
:return: AdvancedProperty
222227
:rtype: AdvancedProperty
223228
"""
224229
self.__fget = fget
@@ -231,6 +236,7 @@ def setter(
231236
232237
:param fset: new setter.
233238
:type fset: typing.Optional[typing.Callable[[typing.Any, typing.Any], None]]
239+
:return: AdvancedProperty
234240
:rtype: AdvancedProperty
235241
"""
236242
self.__fset = fset
@@ -243,6 +249,7 @@ def deleter(
243249
244250
:param fdel: New deleter.
245251
:type fdel: typing.Optional[typing.Callable[[typing.Any, ], None]]
252+
:return: AdvancedProperty
246253
:rtype: AdvancedProperty
247254
"""
248255
self.__fdel = fdel
@@ -255,6 +262,7 @@ def cgetter(
255262
256263
:param fcget: new class-wide getter.
257264
:type fcget: typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]
265+
:return: AdvancedProperty
258266
:rtype: AdvancedProperty
259267
"""
260268
self.__fcget = fcget

advanced_descriptors/separate_class_method.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,9 @@ def __init__(
108108
def __get__(self, instance, owner): # type: (typing.Optional[typing.Any], typing.Any) -> typing.Callable
109109
"""Get descriptor.
110110
111+
:return: class method or instance method depends on call behavior
111112
:rtype: typing.Callable
112-
:raises: AttributeError
113+
:raises AttributeError: Not implemented getter for class method and called class context.
113114
"""
114115
if instance is None or self.__instance_method is None:
115116
if self.__class_method is None:
@@ -134,6 +135,7 @@ def instance_method(self, imeth): # type: (typing.Optional[typing.Callable]) ->
134135
135136
:param imeth: New instance method.
136137
:type imeth: typing.Optional[typing.Callable]
138+
:return: SeparateClassMethod
137139
:rtype: SeparateClassMethod
138140
"""
139141
self.__instance_method = imeth
@@ -142,8 +144,9 @@ def instance_method(self, imeth): # type: (typing.Optional[typing.Callable]) ->
142144
def class_method(self, cmeth): # type: (typing.Optional[typing.Callable]) -> SeparateClassMethod
143145
"""Descriptor to change class method.
144146
145-
:type cmeth: New class method.
147+
:param cmeth: New class method.
146148
:type cmeth: typing.Optional[typing.Callable]
149+
:return: SeparateClassMethod
147150
:rtype: SeparateClassMethod
148151
"""
149152
self.__class_method = cmeth

0 commit comments

Comments
 (0)