Neal Becker wrote:
> How can I write code to take advantage of new decorator syntax, while
> allowing backward compatibility?
> 
> I almost want a preprocessor.
> 
> #if PYTHON_VERSION >= 2.4
> @staticmethod
> ...
> 
> Since python < 2.4 will just choke on @staticmethod, how can I do this?

It seems to me that no matter what you do, if it's not done with an 
external processing tool which requires no changes in the source code, 
the result will be much uglier than if you just used the pre-2.4 
decorator syntax:

    def meth():
       pass
    meth = staticmethod(meth)


-Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to