python - Variable with name `None` -


i need have variable name none:

class qabstractprintdialog(qdialog):     none = int() # qabstractprintdialog.printdialogoption enum     printtofile = int() # qabstractprintdialog.printdialogoption enum     printselection = int() # qabstractprintdialog.printdialogoption enum     ... 

but:

syntax error: cannot assign none

i need name none. thought work:

qabstractprintdialog.none = int() # qabstractprintdialog.printdialogoption enum 

but didn't. there workaround not have syntax error? solutions setattr don't work me - code parsed extract classes, functions, arguments, etc.

python 2.6, 2.7

edit:

i helping guy write pseudo-python modules contain description of qt classes. qabstractprintdialog 1 of classes , has enum qabstractprintdialog::printdialogoption (http://doc.trolltech.com/latest/qabstractprintdialog.html). 1 of enums none. can reference none attribute via qabstractprintdialog.none can not set it. int() means type of attribute.

see here: http://scummos.blogspot.com/2011/06/kdevelop-python-language-support-plugin.html

in python none reserved word , cannot used variable name. quoting python documentation:

changed in version 2.4: assignments none illegal , raise syntaxerror.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -