python idioms : some are confusing

Vineet vineet.deodhar at gmail.com
Fri Sep 21 02:05:31 EDT 2012


Oh I see !
On these lines mentioned by you, I can now sense the sense.
Thanks.

On Friday, 21 September 2012 11:22:45 UTC+5:30, alex23  wrote:
> On Sep 21, 3:34 pm, Vineet <vineet.deod... at gmail.com> wrote:
> 
> > Amongst the python idioms, how the below-mentioned make sense?
> 
> > ## There should be one-- and preferably only one --obvious way to do it.
> 
> > --- In programming, there can be a number of ways, equally efficient, to do certain  thing.
> 
> 
> 
> This isn't talking about your Python code as much as about Python
> 
> itself. For example, in Python 2.x you can use either `open` or `file`
> 
> to open a file, with `file` being a factory function for creating file
> 
> objects, and `open` using it internally. In Python 3.x, `file` is no
> 
> longer a built-in, as it produced a point of confusion as to which was
> 
> the one obvious way to open a file.
> 
> 
> 
> > ## Although never is often better than *right* now.
> 
> > --- How come "never" is better that "right now" ?
> 
> 
> 
> It's better to not add a language feature than it is to add it poorly,
> 
> especially when you endeavour to provide backwards compatibility as
> 
> much as possible within major versions.




More information about the Python-list mailing list