On 2012-10-28, Devin Jeanpierre jeanpierr...@gmail.com wrote:
The 'canonical way'
while True:
line = complex_expression
if not line:
break
do_something_with(line)
avoids this problem, but I was never really convinced about the beauty /
readbility of this construct.
On Sun, Oct 28, 2012 at 4:57 PM, Devin Jeanpierre
jeanpierr...@gmail.com wrote:
What if he wants to avoid both downsides A and B? What solution does
he use then?
He switches to a language whose BDFL is not Steven D'Aprano. :)
No offense meant Steven...
ChrisA
--
On Sun, 28 Oct 2012 01:57:45 -0400, Devin Jeanpierre wrote:
We have a problem, and two solutions. Solution 1 has downside A, and
solution 2 has downside B. If he complains about downside A, you say,
well, use solution 2. If he complains about downside B, you say, well,
use solution 1.
What
On 10/28/2012 06:57 AM, Devin Jeanpierre wrote:
line = function(x, y, z)
while line:
do something with(line)
line = function(x, y, z)
How about:
line = True
while line:
line = function(x, y, z)
do something with(line)
?
Frederic
--
On Sun, Oct 28, 2012 at 6:12 PM, F.R. anthra.nor...@bluewin.ch wrote:
How about:
line = True
while line:
line = function(x, y, z)
do something with(line)
?
That's going to go through the body of the loop with a false line
before breaking out. In some situations that's
On 10/27/2012 04:42 AM, Steve Howell wrote:
I have been reading the thread while expression feature proposal,
and one of the interesting outcomes of the thread is the idea that
Python could allow you to attach names to subexpressions, much like C
allows. In C you can say something like this:
On Oct 28, 5:49 am, Steven D'Aprano steve
+comp.lang.pyt...@pearwood.info wrote:
It's sure as hell more beautiful and readable than assignment as an
expression.
If we are going to judge code on the ability of people to take a quick
glance and immediately understand it, then pretty much
I have been reading the thread while expression feature proposal,
and one of the interesting outcomes of the thread is the idea that
Python could allow you to attach names to subexpressions, much like C
allows. In C you can say something like this:
tax_next_year = (new_salary = salary * (1 +