[pypy-svn] r31321 - pypy/dist/pypy/objspace/std
arigo at codespeak.net
arigo at codespeak.net
Tue Aug 15 15:11:21 CEST 2006
Author: arigo
Date: Tue Aug 15 15:11:15 2006
New Revision: 31321
Modified:
pypy/dist/pypy/objspace/std/dictmultiobject.py
pypy/dist/pypy/objspace/std/dictobject.py
pypy/dist/pypy/objspace/std/dictstrobject.py
Log:
issue240 resolved
Python-dev has no opinion about which of the list or dict behaviors is
right. For now, let's just stick to CPython as closely as possible,
with a comment in the code.
Modified: pypy/dist/pypy/objspace/std/dictmultiobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/dictmultiobject.py (original)
+++ pypy/dist/pypy/objspace/std/dictmultiobject.py Tue Aug 15 15:11:15 2006
@@ -363,7 +363,8 @@
w_src, w_kwds = __args__.parse('dict',
(['seq_or_map'], None, 'kwargs'), # signature
[W_DictMultiObject(space)]) # default argument
- w_dict.implementation = w_dict.implementation.clear()
+ # w_dict.implementation = w_dict.implementation.clear()
+ # ^^^ disabled only for CPython compatibility
try:
space.getattr(w_src, space.wrap("keys"))
except OperationError:
Modified: pypy/dist/pypy/objspace/std/dictobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/dictobject.py (original)
+++ pypy/dist/pypy/objspace/std/dictobject.py Tue Aug 15 15:11:15 2006
@@ -51,7 +51,7 @@
w_src, w_kwds = __args__.parse('dict',
(['seq_or_map'], None, 'kwargs'), # signature
[W_DictObject(space)]) # default argument
- w_dict.content.clear()
+ # w_dict.content.clear() - disabled only for CPython compatibility
try:
space.getattr(w_src, space.wrap("keys"))
except OperationError:
Modified: pypy/dist/pypy/objspace/std/dictstrobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/dictstrobject.py (original)
+++ pypy/dist/pypy/objspace/std/dictstrobject.py Tue Aug 15 15:11:15 2006
@@ -103,10 +103,10 @@
w_src, w_kwds = __args__.parse('dict',
(['seq_or_map'], None, 'kwargs'), # signature
[W_DictStrObject(space)]) # default argument
- if w_dict.content is None:
- w_dict.content_str.clear()
- else:
- w_dict.content.clear()
+ #if w_dict.content is None: -
+ # w_dict.content_str.clear() - disabled only for CPython compatibility
+ #else: -
+ # w_dict.content.clear() -
try:
space.getattr(w_src, space.wrap("keys"))
More information about the Pypy-commit
mailing list