diff options
author | Endi S. Dewata <edewata@redhat.com> | 2014-10-28 11:51:04 -0400 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2014-10-28 12:01:17 -0400 |
commit | 7fecde375f7533aff7d1d4fdf89f105a5736d94f (patch) | |
tree | aa606eb3aa58bf93f0259ed843f34c3da0c86c1f /base/common/python/pki/encoder.py | |
parent | 8d8e33bc282d8ceae4ea9da4546c9c7d25984fd9 (diff) | |
download | pki-7fecde375f7533aff7d1d4fdf89f105a5736d94f.tar.gz pki-7fecde375f7533aff7d1d4fdf89f105a5736d94f.tar.xz pki-7fecde375f7533aff7d1d4fdf89f105a5736d94f.zip |
Fixed incorrect Python API docs format.
The Python API docs in some classes/methods have been fixed to
remove the errors and warnings generated by python-sphinx.
https://fedorahosted.org/pki/ticket/1157
Diffstat (limited to 'base/common/python/pki/encoder.py')
-rw-r--r-- | base/common/python/pki/encoder.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/base/common/python/pki/encoder.py b/base/common/python/pki/encoder.py index 09e8f5a9f..88a92f243 100644 --- a/base/common/python/pki/encoder.py +++ b/base/common/python/pki/encoder.py @@ -5,7 +5,8 @@ NOTYPES = {} class CustomTypeEncoder(json.JSONEncoder): - """A custom JSONEncoder class that knows how to encode core custom + """ + A custom JSONEncoder class that knows how to encode core custom objects. Custom objects are encoded as JSON object literals (ie, dicts) with @@ -13,21 +14,22 @@ class CustomTypeEncoder(json.JSONEncoder): type to which the object belongs. That single key maps to another object literal which is just the __dict__ of the object encoded. - Reason for ignoring the error - E0202 - An attribute affected in json.encoder line 157 hide this method - reported by pylint: - - The error is in json.encoder.JSONEncoder class. - There is a default method (which is overridden here) and also a class - attribute self.default initialized in the init method of the class. - The intention of such usage being that a custom default method object can - be passed to init when creating an instance of JSONEncoder, which is then - assigned to class's default method. (which is valid) - But pylint raises an issue due to the usage of same name for a method and - an attribute in which case the attribute definition hides the method. - The reason and example for the issue: (top rated comment) - http://stackoverflow.com/questions/12949064/python-what-happens- - when-instance-variable-name-is-same-as-method-name + Reason for ignoring the error: + E0202 - An attribute affected in json.encoder line 157 hide this method + reported by pylint: + + The error is in json.encoder.JSONEncoder class. + There is a default method (which is overridden here) and also a class + attribute self.default initialized in the init method of the class. + The intention of such usage being that a custom default method object can + be passed to init when creating an instance of JSONEncoder, which is then + assigned to class's default method. (which is valid) + But pylint raises an issue due to the usage of same name for a method and + an attribute in which case the attribute definition hides the method. + The reason and example for the issue: (top rated comment) + + http://stackoverflow.com/questions/12949064/python-what-happens- + when-instance-variable-name-is-same-as-method-name """ # pylint: disable-msg=E0202 def default(self, obj): |