Re: Last patch breaks Py 2.3 compatibility

Christoph Zwerschke <[email protected]> Fri, 08 Jul 2011 17:45:42 +0200
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
Am 08.07.2011 17:00 schrieb Chris Lambacher:
>> If we drop it, I am willing to go through the code and simplify it
>> based on Py 2.4 (use decorators etc.)
 >
 > You have something specific in mind here?

For example, the following code:

     def _repr_vars(dictNames):
         names = [n for n in dictNames
                  if not n.startswith('_') and n != 'declarative_count']
         names.sort()
         return names
     _repr_vars = staticmethod(_repr_vars)

could be written in Py 2.4 as:

     @staticmethod
     def _repr_vars(dictNames):
         return sorted(n for n in dictNames
             if not n.startswith('_') and n != 'declarative_count')

Things like that.

-- Christoph


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2