i have trouble accessing a static member of a class. the simplest example of my use-case is:
class A:
_tmpl = '<{}>'
print(_tmpl)
VAR = tuple(_tmpl.format(var) for var in ('a', 'b'))
this prints <{}>
as it should from the print
statement; but the line with the tuple
raises the exception:
NameError: name '_tmpl' is not defined
what is happening here? how can i fix it (A._tmpl
will not work either...).