__init__
PYL-W02012070 # May not be returned on all responses (e.g. listing
2071 # multiple objects)
2072 if isinstance(obj, RestObj):
2073 obj._headers = response.headers2074 return obj
2075 except ValueError:
2076 if format == "rest":
2070 # May not be returned on all responses (e.g. listing
2071 # multiple objects)
2072 if isinstance(obj, RestObj):
2073 obj._headers = response.headers2074 return obj
2075 except ValueError:
2076 if format == "rest":
Defining an instance attribute outside __init__
affects the readability of code. It is expected to find all the attributes an instance may have by reading its __init__
method. If there is a need to initialize attribute via sub-initialization methods, it is recommended to assign attributes to None
in the init then call the sub-initialization methods.