Re: [Python-3000] Dropping the parentheses after dict.keys?

2007-12-13 Thread Noam Raphael
Thanks for the explanation. I'm sure that I will be able to live (although miserably) with dict.keys(). ;) Noam ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/m

Re: [Python-3000] Dropping the parentheses after dict.keys?

2007-12-13 Thread Noam Raphael
2007/12/13, Guilherme Polo <[EMAIL PROTECTED]>: > 2007/12/13, Noam Raphael <[EMAIL PROTECTED]>: > > Hello, > > > > Was it considered to drop the parentheses after "dict.keys()", to make > > it "dict.keys" (that is, to make it a property in

[Python-3000] Dropping the parentheses after dict.keys?

2007-12-13 Thread Noam Raphael
Hello, Was it considered to drop the parentheses after "dict.keys()", to make it "dict.keys" (that is, to make it a property instead of a method with no arguments)? If it was, please forgive me - a few minutes of googling didn't find it. I now write (another?) ordered dict, and I thought that the

Re: [Python-3000] Reconsider repr(0.1) == '0.10000000000000001'

2007-12-10 Thread Noam Raphael
gits needed to recreate it, I used the code by Robert G. Burger (the author of the article) since it is stand-alone. The original code can be found here: http://www.cs.indiana.edu/~burger/fp/index.html The patch is against current py3k svn. Have a good day, Noam 2007/12/9, Noam Raphael <

Re: [Python-3000] Reconsider repr(0.1) == '0.10000000000000001'

2007-12-09 Thread Noam Raphael
ving "eval(repr(f)) == f"? If not, I'll try to write it in the next few days. (I checked - indeed, the current implementation just uses the OS's conversion method with 17 precision digits.) Noam 2007/12/9, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]>: >

[Python-3000] Reconsider repr(0.1) == '0.10000000000000001'

2007-12-09 Thread Noam Raphael
Hello, I would like to re-raise the issue of float repr() -- making repr(1.1) == '1.1' instead of '1.1001'. My use case is data manipulation in the interactive shell - an extremely powerful tool which, it seems, not so many people use. Many times I have float data. I think that you'll

Re: [Python-3000] The order of list comprehensions and generator expressions

2007-09-16 Thread Noam Raphael
On 9/16/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > I think it's not so obvious that reversing the order is any better > when you throw in some if clauses: > > [friend for city in cities if city.name != "Amsterdam" for friend in > city.friends if friend.name != "Guido"] > > vs. > > [friend fo

[Python-3000] The order of list comprehensions and generator expressions

2007-09-16 Thread Noam Raphael
Hello, I had a thought about syntax I want to share with you. Say you want to get a list of all the phone numbers of your friends. You'll write something like this: telephones = [friend.telephone for friend in friends] Now suppose that, unfortunately, you have many friends, and they are grouped

Re: [Python-3000] Default dict iterator should have been iteritems()

2007-09-06 Thread Noam Raphael
(Sorry, it turns out that I posted this reply only to Nick and not to the list, so I post it again.) On 9/4/07, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Containment and iteration really do need to be kept consistent and > having the value matter when checking for dictionary containment would > be

Re: [Python-3000] Default dict iterator should have been iteritems()

2007-09-04 Thread Noam Raphael
On 9/4/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > Noam Raphael wrote: > > The default dict iterator should in principle be iteritems(), and not > > iterkeys(). > > This was discussed at length back when "in" support was > added to dicts. There were reas

[Python-3000] Default dict iterator should have been iteritems()

2007-09-04 Thread Noam Raphael
Hello, Just a thought that came to me after writing a code that deals quite a lot with dicts: The default dict iterator should in principle be iteritems(), and not iterkeys(). This is probably just theoritical, since it will break a lot of code and not gain a lot, but it may be remembered when s