Reputation: 41
I am newbie to Python and trying to decode a line to port over to Go. In the current python script, I come across this declaration (dataValue) under most of the class.
class Keys(object):
AB1 = 0x0FF
AB2 = 0x0A2
dataValue = {'0xffff':None}
@classmethod
def _init(cls):
for ke, vl in vars(cls).items():
Trying to understand the concepts thru real projects. Thanks in advance!
Upvotes: 0
Views: 85
Reputation: 91
dataValue
is a dictionary variable name, which has in it key:value
pair of '0xffff':None
https://docs.python.org/3/tutorial/datastructures.html.vars(cls).items()
Return the __dict__
attribute for a module, class, instance, or any other object with a __dict__
attribute https://docs.python.org/3/library/functions.html#vars.Upvotes: 3