On Jan 1, 2013, at 3:15 PM, Adrian Klaver <[email protected]> wrote:

> Though as a counterpoint this is one of those Pythonisms I do not totally 
> agree with, if for no other reason then it breaks two of the Zen of Python 
> rules:
> 
> Explicit is better than implicit.
> Readability counts.
> 
> and doing an explicit test is covered by a third
> 
> Although practicality beats purity.
> 
> Since what you are testing may have been declared in code well away from 
> where you test it, the explicit test tends to be self documenting.

        We'll have to agree to disagree on this if you think that the explicit 
comparison is more readable. The boolean values of all types is a fundamental 
part of Python, and is thus explicit. To someone coming from Java it may be 
less familiar, but that's what makes it idiomatic Python.


-- Ed Leafe

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to