[Twisted-Python] cut and paste is evil :)

Alessandro Praduroux pradu at pradu.it
Mon Sep 29 06:03:30 EDT 2003


in version 1.37 of formmethod.py has been added a constructor to the String 
class, to add a min/max lenght check for the string. That's a cool idea, but 
the implementation destroyed the behaviour of all derived classes :).

def __init__(self, name, default=None, shortDesc=None,
                  longDesc=None, hints=None, allowNone=1, min=0, max=None):
         Argument.__init__(self, name, default=None, shortDesc=None,
                           longDesc=None, hints=None, allowNone=1)
         self.min = min
         self.max = max

you can see that in calling the Argument.__init__ constructor, all values are 
reset to None.

issued to the bugtracker, with simple patch.
http://www.twistedmatrix.com/users/roundup.twistd/twisted/issue296


-- 
Linux webmaster & sysadmin
pradu at pradu.it





More information about the Twisted-Python mailing list