On 2/12/07, Maric Michaud <[EMAIL PROTECTED]> wrote: > Le mardi 13 février 2007 01:36, Barry Warsaw a écrit: > > On Feb 12, 2007, at 7:32 PM, Guido van Rossum wrote: > > > Oh, now I am definitely in favor of .[]! I read it in gmail in FireFox > > > which uses a small variable-pitch font whose dot is a single pixel. > > > The .() example was hard to find; the .[] jumped out immediately. > > > (When do you ever see self[anything]?) > > > > Raymond's -> suggestion was nice. > > > I really dislikes the .[ or .( or .{ operators. > Just on my mail editor the two expressions > > a.[b] > > and > > a,[b] > > are quite hard to differentiate while completely unrelated.
Yeah, so are 1.2 and 1,2. This is why the style guide (PEP 8) insists on a space after a comma but not after a period. > Why did the brace syntax wasn't even discussed ? Seems clean to me. Because they are arbitrary -- if x{y} or x.{y} would be acceptable, why not x.<y> or x.|y| or x./y/? Or indeed why not [EMAIL PROTECTED] (Not that I'm in favor of that. :-) That x.[y] and x.(y) resemble x[y] and x(y) is an *advantage* of the proposed new notation, not a disadvantage; the new operator is semantically closer to x[y] than to x(y) so x.[y] makes sense. > obj{expr} can be read as "given obj as a namespace, retrieve the name > resulting by expr in obj and enclosing namespaces (supers)". Yeah, it can just as well be read as "call obj with 2**expr as argument". Also, your reference to enclosing namespaces and supers is misplaced -- this should map to the existing __getattr__ operation, which can have many different semantics depending on the type of obj. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com