regular expression question (re module)

2008-10-11 Thread Faheem Mitha
Hi, I need to match a string of the form capital_letter underscore capital_letter number against a string of the form anything capital_letter underscore capital_letter number some_stuff_not_starting with a number Eg D_A1 needs to match with DUKE1_plateD_A1.CEL, but not any of DUKE1_pla

Re: python string comparison oddity

2008-06-18 Thread Faheem Mitha
On Wed, 18 Jun 2008 12:57:44 -0700 (PDT), Lie <[EMAIL PROTECTED]> wrote: > On Jun 19, 2:26 am, Faheem Mitha <[EMAIL PROTECTED]> wrote: >> Hi everybody, >> >> I was wondering if anyone can explain this. My understanding is that 'is' >> checks if t

python string comparison oddity

2008-06-18 Thread Faheem Mitha
Hi everybody, I was wondering if anyone can explain this. My understanding is that 'is' checks if the object is the same. However, in that case, why this inconsistency for short strings? I would expect a 'False' for all three comparisons. This is reproducible across two different machines, so

puzzlement about classmethod

2006-06-24 Thread Faheem Mitha
? Regards, Faheem Mitha. ** #!/usr/bin/python class A(object): x = 0 def class_getx(cls): return cls.x class_getx = classmethod(class_getx) def class_setx(cls, _x): cls.x = _x class_setx