I have a bit of code I'm working with (specifically Parsetron) which was written for Python 2.7 which I'm trying to run using python 3.4 and unsurprisingly it's throwing errors.
The error I'm specifically looking at is this:
def __new__(cls):
return cls.__dict__['_grammar_']
KeyError: '_grammar_'
cls
is class object, which indeed does not have the key "_grammar_
". My question is of course, how to get rid of this error and why it appears. In python 2.7, does __dict__
add a key value to the class object whereas Python 3.x doesn't? Running through the thread during debugging it doesn't seem to add this value anywhere. Anyone know what's going on?