From: <no...@so...> - 2001-03-20 04:14:59
|
Bugs item #409930, was updated on 2001-03-19 20:17 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112867&aid=409930&group_id=12867 Category: None Group: None Status: Open Priority: 5 Submitted By: brian zimmer (bzimmer) Assigned to: Nobody/Anonymous (nobody) Summary: __bases__ should not be immutable Initial Comment: Jython differs from CPython in that it does not allow the attribute __bases__ to be mutable. The method __setattr__ in PyClass.java explicitly checks for __bases__ and throws a TypeError. The example is contrived, but demonstrates the point: D:\home\development\src\sourceforge\zxJDBC>python ActivePython 2.0, build 202 (ActiveState Tool Corp.) based on Python 2.0 (#8, Oct 19 2000, 11:30:05) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> from UserList import UserList >>> from UserDict import UserDict >>> UserList.__bases__ () >>> UserList.__bases__ += (UserDict,) >>> UserList.__bases__ (<class UserDict.UserDict at 007D99CC>,) >>> ^Z D:\home\development\src\sourceforge\zxJDBC>jython Jython 2.1a1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> from UserList import UserList >>> from UserDict import UserDict >>> UserList.__bases__ () >>> UserList.__bases__ += (UserDict,) Traceback (innermost last): File "<console>", line 1, in ? TypeError: read-only special attribute: __bases__ >>> Also, refer to the article: http://noframes.linuxjournal.com/lj-issues/issue84/4540.html ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112867&aid=409930&group_id=12867 |