Open
Description
Feature
Special types' __doc__
property should be readonly (i.e. getter) except for user-defined type. But __doc__
properties of RustPython's special types is writable.
CPython
>>> SystemExit.__doc__
'Request to exit from the interpreter.'
>>> SystemExit.__doc__ = ""
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: can't set attributes of built-in/extension type 'SystemExit'
>>> class A:
... ...
...
>>> A.__doc__ = "123"
>>> A.__doc__
'123'
RustPython
>>>>> SystemExit.__doc__
'object()\n--\n\nThe base class of the class hierarchy.\n\nWhen called, it accepts no arguments and returns a new featureless\ninstance that has no instance attributes and cannot be given any.'
>>>>> SystemExit.__doc__ = ""
>>>>> class A:
..... ...
.....
>>>>> A.__doc__
>>>>> A.__doc__ = "123"
>>>>> A.__doc__
'123'