For me, one of the reasons for using Python is the ease and the intuivity of reading its code. I have a problem with intuitively getting what is going on when using a pattern like (x,y,z=0) -> (x,y,z) where I expect at the first glance some C code with access to class members. At least I must start looking at the code more closely thinking why is someone using such a construct.
Already lambda x,y,z=0:(x,y,z) is a problem for me. Why not: try: (x,y,z) except NameError: z=0 (x,y,z) ? Watching the last piece of code can even directly be seen, that there is eventually a NameError problem with z to handle, so where is the gain of using lambda or the mapping? My current conclusion (I can't see any gain): No, thanks. Claudio "Kay Schluehr" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Since George Sakkis proposed a new way of doing list comprehensions > > http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/ac5023ad18b2835f/d3ff1b81fa70c8a7#d3ff1b81fa70c8a7 > > letting tuples-like objects (x,y,z=0) acting as functions on other > tuples I wonder why this would not be a good starting point of > rethinking anonymus functions? > > In Georges proposition the action is > > (x,y,z=0) -> (x,y,z) > > i.e. mapping tuples on other tuples. This is equivalent to > > lambda x,y,z=0:(x,y,z) > > But regarding tuples as actions by means of an arrow "->" would > generalize this idea: > > Mappings like that: > > ((x,y),z) -> x+y-z > > ((x,y=0),z) -> None > > should be valid actions too. > > What is the audience thinking about that? > > Regards Kay > -- http://mail.python.org/mailman/listinfo/python-list