[Python-Dev] Interface to change Py3kWarning in Python (original) (raw)
Georg Brandl g.brandl at gmx.net
Sat Apr 19 16:12:53 CEST 2008
- Previous message: [Python-Dev] Interface to change Py3kWarning in Python
- Next message: [Python-Dev] Interface to change Py3kWarning in Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Christian Heimes schrieb:
Benjamin Peterson schrieb:
I currently have a patch to make it possible to change py3k warnings in Python through new functions in sys: issue 2458. I realize the functions are rather ugly, but I don't think there is another practical way to do it unless you want to be writing PySysGetObject and checking it for NULL whenever you add a Py3k warning. In Python we usually have to methods for the job, like setpy3kwarningmode and getpy3kwarningmode. I don't like the enable* and disable* style. Even the get/set methods are an ugly workaround for the fact, Python doesn't support module properties. :/ How do you like a macro or function PyErrWarn3k(msg) that does all the dirty work?
Which additional dirty work would it do? It should never have to do more than check a simple static C variable, for obvious reasons.
Georg
-- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.
- Previous message: [Python-Dev] Interface to change Py3kWarning in Python
- Next message: [Python-Dev] Interface to change Py3kWarning in Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]