Closed
Description
Feature
Right now OSError
has a standard __new__
, which is not correct. Because it is a special case in CPython:
>>> OSError()
OSError()
>>> OSError(1)
OSError(1)
>>> OSError(1, 2)
PermissionError(1, 2)
RustPython:
>>>>> OSError() # ok
OSError()
>>>>> OSError(1) # ok
OSError(1)
>>>>> OSError(1, 2) # error
OSError(1, 2)
Python Documentation
Source code: https://github.com/python/cpython/blob/ecc3c8e4216958d85385bf2467441c975128f26c/Objects/exceptions.c#L991-L1003
Metadata
Metadata
Assignees
Labels
No labels