Sebastiaan de Haan
nethirlon at gmail.com
Wed Oct 6 11:14:37 CEST 2010
Thank you Chris,
I'll try and find the attribute in the code. That was my conclusion
aswell... The original author must have defined it somewhere...
On Wed, Oct 6, 2010 at 10:59 AM, Chris Rebert <clp2 at rebertia.com> wrote:
> On Wed, Oct 6, 2010 at 1:32 AM, Nethirlon . <nethirlon at gmail.com> wrote:
>> I am having trouble with an expression.
>> I have the following line of code:
>> self.failUnless(c.as == 65215)
>> What happens when you compile this is that you get a syntax error.
>> This is because as has been made a keyword. failUnless is from the
>> module unittest.
>> Now my problem is this. the ".as" is no where defined in the code. The
>> code builds just fine if you removed it. But the origigal programmer
>> must have put it in for a reason. I just cant understand what that is.
>> Can anyone point me into the right direction? was ".as" before it
>> became a keyword some kind of string manipulator?
> Nope, it was just normal attribute syntax. I would assume the original
> author just named some object attribute "as" for whatever reason, but
> the fact that removing it doesn't cause a test failure is just
> bizarre. Perhaps you should examine the code for c's class (and/or its
> ancestors)? (Sounds like you might have already done that though, in
> which case: o_O *shrug*)
More information about the Python-list