Re: pre-PEP: Suite-Based Keywords



On Mon, 18 Apr 2005 12:50:24 +0200, Reinhold Birkenfeld
<reinhold-birkenfeld-nospam@xxxxxxxxxx> wrote:

>y = (f(11, 22, x=1, y='y for f') *
> g(*args_from_somewhere,
> x='x for g', y='y for g',
> foo=lambda: return 'foo for g'))
>
>would be my current way to express this. But still, the less lines,
>the less confusing it is.

I would probably do it this way.

y = f(11, 22, x=1, y='y for f') \
* g( *args_from_somewhere,
x='x for g',
y='y for g',
foo=lambda: return 'foo for g' )

I tend to put the opperators on the left for continued lines. It's
nice visual que to whats happening.

if (a==1
or b==2
or c==3):
x = ( 1.333333333333
+ the_last_value_i_needed
+ the_first_value_i_started_with
+ another_long_name_for_something )

This subject really hasn't been a problem for me. So I really don't
see the point of adding a new syntax.

And this works on the def side.

def f( first,
second,
x=0,
y='' ):
#
# rest of body
#

So is this new syntax just a way to keep the '()'s closer together?

Cheers,
Ron

.



Relevant Pages

  • Re: @decorators
    ... What about using the list syntax instead of the @ ... > def foo(): ... Lists are value expressions: not statements, ... > def being valid python but not previously having any effect... ...
    (comp.lang.python)
  • Re: Is a "real" C-Python possible?
    ... cared about some syntax for properties without any change so far. ... Just look at Stephen Bethards withdrawn PEP 359 in ... def fset: ... foo = propery) ...
    (comp.lang.python)
  • Re: PEP318
    ... > to explain to anybody what it is that @decorator means, ... > the pseudo code that is in fact the existing syntax. ... I think the core problem is that the def statement is kind of wierd. ... def foo: ...
    (comp.lang.python)
  • Re: Is a "real" C-Python possible?
    ... Python 2.6 and 3.0 have a more Pythonic way for the problem: ... def foo ... I don't really like this new syntax at all. ... Having to write foo everywhere isn't that nice, ...
    (comp.lang.python)
  • Re: For review: PEP 343: Anonymous Block Redux and Generator Enhancements
    ... > block) to avoid over-indentation? ... > def foo(): ... Prev by Date: ...
    (comp.lang.python)