Nick Coghlan wrote:
On Thu, Mar 8, 2012 at 11:42 AM, Benjamin Peterson benja...@python.org wrote:
2012/3/7 Victor Stinner victor.stin...@gmail.com:
Can't we simply raise an error if the dict contains
non-string keys?
Sounds okay to me.
For 3.3, the most we can do is trigger a deprecation
On Thu, Mar 8, 2012 at 08:46, Ethan Furman et...@stoneleaf.us wrote:
I think it would be sad to lose that functionality.
If we are going to, though, we may as well check the string to make sure
it's a valid identifier:
That would break even more code. I have encountered many cases of
On Thu, Mar 8, 2012 at 1:10 AM, Lennart Regebro rege...@gmail.com wrote:
On Thu, Mar 8, 2012 at 08:46, Ethan Furman et...@stoneleaf.us wrote:
I think it would be sad to lose that functionality.
If we are going to, though, we may as well check the string to make sure
it's a valid identifier:
Guido van Rossum wrote:
On Wed, Mar 7, 2012 at 11:43 PM, Ethan Furman wrote:
Are you able to modify classes after class creation in Python 3? Without
using a metaclass?
Yes, by assignment to attributes. The __dict__ is a read-only proxy,
but attribute assignment is allowed. (This is because
On Thu, Mar 8, 2012 at 8:22 AM, Ethan Furman et...@stoneleaf.us wrote:
Guido van Rossum wrote:
On Wed, Mar 7, 2012 at 11:43 PM, Ethan Furman wrote:
Are you able to modify classes after class creation in Python 3? Without
using a metaclass?
Yes, by assignment to attributes. The __dict__ is
On Thu, Mar 8, 2012 at 2:43 AM, Ethan Furman et...@stoneleaf.us wrote:
PJ Eby wrote:
Short version: AddOns are things you can use to dynamically extend
instances -- a bit like the decorator in decorator pattern (not to be
confused with Python decorators). Rather than synthesize a unique
On Wed, Mar 7, 2012 at 5:39 PM, Victor Stinner victor.stin...@gmail.com wrote:
Hi,
During the Language Summit 2011 (*), it was discussed that PyPy and
Jython don't support non-string key in type dict. An issue was open to
emit a warning on such dict, but the patch has not been commited yet.
Guido van Rossum wrote:
On Thu, Mar 8, 2012 at 8:22 AM, Ethan Furman et...@stoneleaf.us wrote:
Guido van Rossum wrote:
On Wed, Mar 7, 2012 at 11:43 PM, Ethan Furman wrote:
Are you able to modify classes after class creation in Python 3? Without
using a metaclass?
Yes, by assignment to
Hi,
2012/3/8 Ethan Furman et...@stoneleaf.us:
A little more experimentation shows that not all is well, however:
-- dir(Test)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: unorderable types: int() str()
So what conclusion do you draw?
That other changes
Hi,
During the Language Summit 2011 (*), it was discussed that PyPy and
Jython don't support non-string key in type dict. An issue was open to
emit a warning on such dict, but the patch has not been commited yet.
I'm trying to Lib/test/crashers/losing_mro_ref.py: I wrote a patch
fixing the
2012/3/7 Victor Stinner victor.stin...@gmail.com:
So my question is: what is the use case of such dict? Why do we still
support it?
Probably a side-effect of implementation.
Can't we simply raise an error if the dict contains
non-string keys?
Sounds okay to me.
--
Regards,
Benjamin
During the Language Summit 2011 (*), it was discussed that PyPy and
Jython don't support non-string key in type dict. An issue was open to
emit a warning on such dict, but the patch has not been commited yet.
It's the issue #11455. As written in the issue, there are two ways to
create such
On Wed, Mar 7, 2012 at 5:45 PM, Victor Stinner victor.stin...@gmail.comwrote:
During the Language Summit 2011 (*), it was discussed that PyPy and
Jython don't support non-string key in type dict. An issue was open to
emit a warning on such dict, but the patch has not been commited yet.
I see that I've misunderstood this entirely, nevermind me.
--Brett
On 08/03/12 14:48, Brett Wilkins wrote:
I assume when you say non-string keys this includes numbers.
But in Pypy, I can certainly use numbers:
{'1':1, 1:2}.keys()
['1', 1]
I can even use a lambda (obviously not a string, a
I assume when you say non-string keys this includes numbers.
But in Pypy, I can certainly use numbers:
{'1':1, 1:2}.keys()
['1', 1]
I can even use a lambda (obviously not a string, a number, nor what I
would consider a primitive):
{'1':1, (lambda x: x):2}.keys()
['1', function lambda at
On Thu, Mar 8, 2012 at 11:42 AM, Benjamin Peterson benja...@python.org wrote:
2012/3/7 Victor Stinner victor.stin...@gmail.com:
Can't we simply raise an error if the dict contains
non-string keys?
Sounds okay to me.
For 3.3, the most we can do is trigger a deprecation warning, since
removing
On Thu, Mar 08, 2012 at 12:20:21PM +1000, Nick Coghlan wrote:
On Thu, Mar 8, 2012 at 11:42 AM, Benjamin Peterson benja...@python.org
wrote:
2012/3/7 Victor Stinner victor.stin...@gmail.com:
Can't we simply raise an error if the dict contains
non-string keys?
Sounds okay to me.
For
On Wed, Mar 7, 2012 at 8:39 PM, Victor Stinner victor.stin...@gmail.comwrote:
So my question is: what is the use case of such dict?
Well, I use them for this:
http://pypi.python.org/pypi/AddOns
(And I have various other libraries that depend on that library.)
Short version: AddOns are
On Wed, Mar 7, 2012 at 5:42 PM, Benjamin Peterson benja...@python.org wrote:
2012/3/7 Victor Stinner victor.stin...@gmail.com:
So my question is: what is the use case of such dict? Why do we still
support it?
Probably a side-effect of implementation.
Can't we simply raise an error if the
PJ Eby wrote:
Short version: AddOns are things you can use to dynamically extend
instances -- a bit like the decorator in decorator pattern (not to
be confused with Python decorators). Rather than synthesize a unique
string as a dictionary key, I just used the AddOn classes themselves as
20 matches
Mail list logo