the lvalue curse? let's play with this crazy idea ;)

XLiIV Tymoteusz.Jankowski at gmail.com
Fri May 9 13:05:34 EDT 2008


On May 9, 11:52 am, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
> Maybe it's also harder to read than this::
>
>   print '-'.join(map(str, time.localtime()[:3]))

I like this concept, it's so, .. ziped :)

> Of course, if you don't mind the extra padding zeroes in day and month::
>
>   print time.strftime('%Y-%m-%d')

I'll be humble, it covers my need the most :)
If you have a lack of knowladge you work harder...
One instruction (besides 'print')... . Do you believe it? :)


> You are a little bit inconsistent with the arguments.  `g` is explicitly
> mentioned in ``list(g)``.  But why the intermediate names at all?
>

That's right, because it was just a scratch of an idea..
The point of the idea was this...
I read from left to right, and because of that it's easier to me
follow this way of writing (you only follow by one direction and the
value is handing over, from left to rigght ...):

value -> do_something -> result -> action_on_the_result -> ...

than this multiline lvalues assignes

variable = value # I take a look at the left then the right
result = do_something(variable) # Here I check also left and right
side, and perhaps I (a short memory) may check the line over
action_on_the_result(result)
...

However, I've just found out, that even the more difficult method to
me isn't so scary if I read it like this
...
6 7
4 5
2 3
  1
However the 2nd:
because there is:
print '-'.join(map(str, time.localtime()[:3]))

so i'm not serious convincing anyone :)


> Maybe you should look into languages like SmallTalk or Io where everything
> is done with method calls.  Your example in Io::

I took a brief look at them, and Python is still Nr OnE :)



More information about the Python-list mailing list