Open ironpythonbot opened 9 years ago
On 2009-08-15 07:17:48 UTC, dinov commented:
This is all correct except we create dict by default currently.
As stated in the comment above it works except for dict:
from types import ModuleType as M
m = M.__new__(M)
assert str(m) == "<module '?' (built-in)>"
assert not hasattr(m, "__name__")
assert m.__dict__ is None
try:
dir(m)
assert False
except SystemError:
pass
E:\IronPyTestFor2.5\ironpythonCompatableFor2.5\ironpythonCompatableFor2.5\25\L ib
E:\IronPyTestFor2.5\ironpythonCompatableFor2.5\ironpythonCompatableFor2.5\25\L ib
python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win
32
Type ";help";, ";copyright";, ";credits"; or ";license"; for more information.
from types import ModuleType as M
m = M.new(M)
str(m)
";";
hasattr(m, "; * name * ";)
False
dir(m)
Traceback (most recent call last):
File ";";, line 1, in
TypeError: module. * dict * is not a dictionary
m. * name *
Traceback (most recent call last):
File ";";, line 1, in
AttributeError: 'module' object has no attribute ' * name * '
Work Item Details
Original CodePlex Issue: Issue 23824 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Jul 27, 2009 at 11:57 PM Reported by: dfugate Updated on: Feb 22, 2013 at 2:12 AM Updated by: jdhardy Custom value: Reported internally at Microsoft. Test: test_descr.py CreatedDate: 11/9/2007 NewInternalID: 409634 OldInternalID: 320139 AreaPath: IronPython