Steve Holden wrote: [was Python-list digest, Vol 1 #10572 - 14 msgs]
Roman Neuhauser
neuhauser at mail.cz
Sat Apr 27 13:10:24 EDT 2002
> From: "Steve Holden" <sholden at holdenweb.com>
> Subject: Re: Steve Holden wrote: [was Python-list digest, Vol 1 #10572 - 14 msgs]
> To: python-list at python.org
> Date: Sat, 27 Apr 2002 06:47:50 -0400
> > "James J. Besemer" wrote:
> > > Then too, I'm crazy enough to count assignment operators as another
> > > one of Python's few serious omissions. I wish to hell I could simply
> > > write:
> > >
> > > while data = socket.recv( 1024 ):
> > > process( data )
> > >
> Aha! So you are a closet "Python should be C" adherent? You should (since
> you are thoroughly familiar with the above FAQ entry) know from FAQ 6.30
> this is a definite no-no. Indeed, once you allow assignment operators you
> bring in as allowable the very case you say above that Python would be able
> to detect easily. The FAQ unambiguously states """The reason for not
> allowing assignment in Python expressions is a common, hard-to-find bug in
> those other languages, caused by this construct:
> if (x = 0) {
> ...error handling...
> }
> else {
> ...code that only works for nonzero x...
> }
>
> """
Anyone who writes "if (x == 0)" instead of "if (0 == x)" deserves
what he begs for.
--
FreeBSD 4.4-STABLE
7:04PM up 12 days, 8:17, 11 users, load averages: 0.00, 0.02, 0.00
More information about the Python-list
mailing list