Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] __getattr__  not able to override when class inherits from 
Moduletype

----------------------------------------------

ISSUES

1. [New issue] __getattr__  not able to override when class inherits from 
Moduletype
http://ironpython.codeplex.com/workitem/34257
User fdanny has proposed the issue:

"This issue discovered trying to execute pytest with an issue 'Std' missing 
from a PythonModule.  I was able to reproduce this issue with the snippet of 
code (tried to make it as small as possible)
from types import ModuleType
class ApiModule(ModuleType):
    def __init__(self, name="", importspec="", implprefix=None, attr=None):
        pass
    def __makeattr(self, name):
        return name
    __getattr__ = __makeattr

t = ApiModule()
t.Std


Python 2.7.5 returned this
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from types import ModuleType
>>> class ApiModule(ModuleType):
...     def __init__(self, name="", importspec="", implprefix=None, attr=None):
...             pass
...     def __makeattr(self, name):
...             return name
...     __getattr__ = __makeattr
...
>>> t = ApiModule()
>>> t.Std
'Std'


IronPython 2.7.3 returned this
IronPython 2.7.3 (2.7.0.40) on .NET 4.0.30319.18051 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> from types import ModuleType
>>> class ApiModule(ModuleType):
...     def __init__(self, name="", importspec="", implprefix=None, attr=None):
...         pass
...     def __makeattr(self, name):
...         return name
...     __getattr__ = __makeattr
...
>>> t = ApiModule()
>>> t.Std
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'PythonModule_4$4' object has no attribute 'Std'


if I inherit from object instead of ModuleType it works in IronPython not sure 
if with inheritance of ModuleType"
----------------------------------------------



----------------------------------------------
You are receiving this email because you subscribed to notifications on 
CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue 
Tracker. You can unsubscribe or change your issue notification settings on 
CodePlex.com.
_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
http://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to