Skip to content

Commit

Permalink
black codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
penguinolog committed Apr 29, 2019
1 parent 85e87df commit aa47b69
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
16 changes: 6 additions & 10 deletions advanced_descriptors/advanced_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,7 @@ def fcget(self): # type: () -> typing.Optional[typing.Callable[[typing.Any, ],
"""
return self.__fcget

def getter(
self, fget # type: typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]
): # type: (...) -> AdvancedProperty
def getter(self, fget): # type: (typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]) -> AdvancedProperty
"""Descriptor to change the getter on a property.
:param fget: new normal getter.
Expand All @@ -230,8 +228,8 @@ def getter(
return self

def setter(
self, fset # type: typing.Optional[typing.Callable[[typing.Any, typing.Any], None]]
): # type: (...) -> AdvancedProperty
self, fset
): # type: (typing.Optional[typing.Callable[[typing.Any, typing.Any], None]]) -> AdvancedProperty
"""Descriptor to change the setter on a property.
:param fset: new setter.
Expand All @@ -242,9 +240,7 @@ def setter(
self.__fset = fset
return self

def deleter(
self, fdel # type: typing.Optional[typing.Callable[[typing.Any, ], None]]
): # type: (...) -> AdvancedProperty
def deleter(self, fdel): # type: (typing.Optional[typing.Callable[[typing.Any, ], None]]) -> AdvancedProperty
"""Descriptor to change the deleter on a property.
:param fdel: New deleter.
Expand All @@ -256,8 +252,8 @@ def deleter(
return self

def cgetter(
self, fcget # type: typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]
): # type: (...) -> AdvancedProperty
self, fcget
): # type: (typing.Optional[typing.Callable[[typing.Any, ], typing.Any]]) -> AdvancedProperty
"""Descriptor to change the class wide getter on a property.
:param fcget: new class-wide getter.
Expand Down
13 changes: 5 additions & 8 deletions advanced_descriptors/separate_class_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class SeparateClassMethod(object):
def __init__(
self,
imeth=None, # type: typing.Optional[typing.Callable[..., typing.Any]]
cmeth=None # type: typing.Optional[typing.Callable[..., typing.Any]]
cmeth=None, # type: typing.Optional[typing.Callable[..., typing.Any]]
): # type: (...) -> None
"""Separate class method and instance methods.
Expand All @@ -108,10 +108,8 @@ def __init__(
self.__class_method = cmeth

def __get__(
self,
instance, # type: typing.Optional[typing.Any]
owner # type: typing.Any
): # type: (...) -> typing.Callable[..., typing.Any]
self, instance, owner
): # type: (typing.Optional[typing.Any], typing.Any) -> typing.Callable[..., typing.Any]
"""Get descriptor.
:return: class method or instance method depends on call behavior
Expand All @@ -137,9 +135,8 @@ def instance_method(*args, **kwargs): # type: (typing.Any, typing.Any) -> typin
return instance_method

def instance_method(
self,
imeth # type: typing.Optional[typing.Callable[..., typing.Any]]
): # type: (...) -> SeparateClassMethod
self, imeth
): # type: (typing.Optional[typing.Callable[..., typing.Any]]) -> SeparateClassMethod
"""Descriptor to change instance method.
:param imeth: New instance method.
Expand Down

0 comments on commit aa47b69

Please sign in to comment.