Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] variable assignments inside expressions in python
- Date: Tue, 10 Jul 2007 19:34:25 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: [tlug] variable assignments inside expressions in python
- References: <a96ae3bb0707100001y7ab2b100g2cb1df846451193e@mail.gmail.com>
Hector Akamine writes: > Trying to do the same in python > while ( (myvar = get_time( ) ) < DEADLINE): > > throws an error. Is there a "python way" to do this? No. This is definitely unpythonic. The pythonic way to do this (if it really needs doing) is to define get_time as an iterator, and then use the "for myvar in get_post_deadline():" syntax, possibly as a list comprehension. I haven't defined an interator in a while though, so I can't help with that tonight.
- References:
- [tlug] variable assignments inside expressions in python
- From: Hector Akamine
Home | Main Index | Thread Index
- Prev by Date: [tlug] Re: Just attempted a subscribe attempt
- Next by Date: Re: [tlug] [OT] Intel core duo errata
- Previous by thread: [tlug] variable assignments inside expressions in python
- Next by thread: Re: [tlug] variable assignments inside expressions in python
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links