-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
property-with-parameters
properly handles abstract properties
Close #3600
- Loading branch information
1 parent
9e424bb
commit dcb5148
Showing
4 changed files
with
25 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
# pylint: disable=missing-docstring, too-few-public-methods | ||
from abc import ABCMeta, abstractproperty | ||
|
||
|
||
class Cls: | ||
@property | ||
def attribute(self, param, param1): # [property-with-parameters] | ||
return param + param1 | ||
|
||
|
||
class MyClassBase(metaclass=ABCMeta): | ||
"""MyClassBase.""" | ||
|
||
@abstractproperty | ||
def example(self): | ||
"""Getter.""" | ||
|
||
@abstractproperty | ||
@example.setter | ||
def example(self, value): | ||
"""Setter.""" |
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 |
---|---|---|
@@ -1 +1 @@ | ||
property-with-parameters:6:Cls.attribute:Cannot have defined parameters for properties | ||
property-with-parameters:7:Cls.attribute:Cannot have defined parameters for properties |