summaryrefslogtreecommitdiffstats
path: root/base/common/python/pki/encoder.py
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2014-05-27 14:12:38 -0400
committerAde Lee <alee@redhat.com>2014-05-29 11:29:44 -0400
commit6262dc33b72ea5703959b91dd95f13d732a5d391 (patch)
tree738b751867665b68288629745dcd33c9971b73d6 /base/common/python/pki/encoder.py
parenta353e5f81341830ea8a151e88ffc2be35aa40451 (diff)
downloadpki-6262dc33b72ea5703959b91dd95f13d732a5d391.tar.gz
pki-6262dc33b72ea5703959b91dd95f13d732a5d391.tar.xz
pki-6262dc33b72ea5703959b91dd95f13d732a5d391.zip
formatting fixes in python client code for pycharm
Diffstat (limited to 'base/common/python/pki/encoder.py')
-rw-r--r--base/common/python/pki/encoder.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/base/common/python/pki/encoder.py b/base/common/python/pki/encoder.py
index e947bbc7c..0ed194d0d 100644
--- a/base/common/python/pki/encoder.py
+++ b/base/common/python/pki/encoder.py
@@ -3,6 +3,7 @@ import json
TYPES = {}
NOTYPES = {}
+
class CustomTypeEncoder(json.JSONEncoder):
"""A custom JSONEncoder class that knows how to encode core custom
objects.
@@ -10,20 +11,20 @@ class CustomTypeEncoder(json.JSONEncoder):
Custom objects are encoded as JSON object literals (ie, dicts) with
one key, 'TypeName' where 'TypeName' is the actual name of the
type to which the object belongs. That single key maps to another
- object literal which is just the __dict__ of the object encoded."""
+ object literal which is just the __dict__ of the object encoded.
- """Reason for ignoring the error
+ 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.
+ 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.
+ 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