Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32562 > unrolled thread

Re: pythonic way

Started byTim Chase <python.list@tim.thechases.com>
First post2012-11-01 10:57 -0500
Last post2012-11-01 10:57 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: pythonic way Tim Chase <python.list@tim.thechases.com> - 2012-11-01 10:57 -0500

#32562 — Re: pythonic way

FromTim Chase <python.list@tim.thechases.com>
Date2012-11-01 10:57 -0500
SubjectRe: pythonic way
Message-ID<mailman.3154.1351785382.27098.python-list@python.org>
On 11/01/12 10:32, inshu chauhan wrote:
>  what is the most pythonic way to do this :
> 
>                    if 0 < ix < 10 and 0 < iy < 10 ???

What's wrong with the syntax you provide?  It's perfectly pythonic:

  ix = 42
  yx = 3.14159
  if 0 < ix < 10 and 0 < iy < 10:
    do_stuff(ix, iy)
  else:
    do_other_stuff(ix, iy)

-tkc


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web