[pypy-svn] r15638 - pypy/dist/lib-python/modified-2.4.1/test
pedronis at codespeak.net
pedronis at codespeak.net
Thu Aug 4 19:02:10 CEST 2005
Author: pedronis
Date: Thu Aug 4 19:02:09 2005
New Revision: 15638
Added:
pypy/dist/lib-python/modified-2.4.1/test/test_descrtut.py
- copied, changed from r15615, pypy/dist/lib-python/2.4.1/test/test_descrtut.py
Log:
these changes are still needed for test_descrtut
Copied: pypy/dist/lib-python/modified-2.4.1/test/test_descrtut.py (from r15615, pypy/dist/lib-python/2.4.1/test/test_descrtut.py)
==============================================================================
--- pypy/dist/lib-python/2.4.1/test/test_descrtut.py (original)
+++ pypy/dist/lib-python/modified-2.4.1/test/test_descrtut.py Thu Aug 4 19:02:09 2005
@@ -72,8 +72,8 @@
[1, 2]
>>> exec "x = 3; print x" in a
3
- >>> print sorted(a.keys())
- [1, 2, '__builtins__', 'x']
+ >>> print sorted([str(key) for key in a.keys()])
+ ['1', '2', '__builtins__', 'x']
>>> print a['x']
3
>>>
@@ -174,49 +174,14 @@
Instead, you can get the same information from the list type:
- >>> pprint.pprint(dir(list)) # like list.__dict__.keys(), but sorted
- ['__add__',
- '__class__',
- '__contains__',
- '__delattr__',
- '__delitem__',
- '__delslice__',
- '__doc__',
- '__eq__',
- '__ge__',
- '__getattribute__',
- '__getitem__',
- '__getslice__',
- '__gt__',
- '__hash__',
- '__iadd__',
- '__imul__',
- '__init__',
- '__iter__',
- '__le__',
- '__len__',
- '__lt__',
- '__mul__',
- '__ne__',
- '__new__',
- '__reduce__',
- '__reduce_ex__',
- '__repr__',
- '__reversed__',
- '__rmul__',
- '__setattr__',
- '__setitem__',
- '__setslice__',
- '__str__',
- 'append',
- 'count',
- 'extend',
- 'index',
- 'insert',
- 'pop',
- 'remove',
- 'reverse',
- 'sort']
+ >>> 'append' in dir(list) # like list.__dict__.keys(), but sorted
+ True
+ >>> 'sort' in dir(list)
+ True
+ >>> 'pop' in dir(list)
+ True
+ >>> '__getitem__' in dir(list)
+ True
The new introspection API gives more information than the old one: in
addition to the regular methods, it also shows the methods that are
More information about the Pypy-commit
mailing list