Reference
Mark Lawrence
breamoreboy at yahoo.co.uk
Wed Mar 5 07:35:05 EST 2014
On 05/03/2014 06:23, Marko Rauhamaa wrote:
> Rustom Mody <rustompmody at gmail.com>:
>
>> * ... which summarizes my objection in this thread: Python's 'is'
>> leaks the machine abstraction. 'id' does it legitimately (somewhat),
>> 'is' does it illegitimately
>
> I agree that the Python data model can be exceedingly challenging to a
> beginner. However, I wouldn't throw the baby away with the bathwater,
> but look for ingenious ways to teach it.
[snip Java]
>
> Similarly, in Python:
>
> if the_list == None:
>
> *should* work (even if there's no such stipulation in Python's reference
> material), but why wouldn't you use the more natural:
>
> if the_list is None:
>
>
> Marko
>
Really great thinking, test the name the_list, which strangely enough
tells me that this beast is a list, in the same way that
THIS_IS_A_CONSTANT is a constant, to see if it's None. Congratulations,
you've been promoted to captain of my dream team.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
More information about the Python-list
mailing list