The Python standard library and PEP8
Aahz
aahz at pythoncraft.com
Mon Apr 20 08:51:09 EDT 2009
In article <pan.2009.04.20.08.31.02 at REMOVE.THIS.cybersource.com.au>,
Steven D'Aprano <steven at REMOVE.THIS.cybersource.com.au> wrote:
>On Mon, 20 Apr 2009 03:44:59 -0400, Terry Reedy wrote:
>> Steven D'Aprano wrote:
>>> On Mon, 20 Apr 2009 19:18:23 +1200, Lawrence D'Oliveiro wrote:
>>>> In message <gsg2iv$g5j$1 at panix3.panix.com>, Aahz wrote:
>>>>>
>>>>> What kind of OO language allows you to do this:
>>>>>
>>>>> def square(x):
>>>>> return x*x
>>>>>
>>>>> for i in range(10):
>>>>> print square(x)
>>>>
>>>> Take out the "OO" qualifier, and the answer is still "none":
>>>>
>>>> Traceback (most recent call last):
>>>> File "<stdin>", line 2, in <module>
>>>> NameError: name 'x' is not defined
>>>
>>> I can't replicate that error. Did you forget to initialize x before
>>> running the code snippet?
>>
>> The code as posted had a typo: 'x' instead of the instended 'i'.
>
>Well duh, that's obvious :)
>
>It's such an obvious typo that I wonder what point Lawrence thought he
>was making to show that it wouldn't run as given.
It's called "humor".
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur." --Red Adair
More information about the Python-list
mailing list