Open
Description
This is probably only once arbitrary_self_types
, lands, but in CPython if you do
>>> l = []
>>> l.append()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: append() takes exactly one argument (0 given)
>>> list.append()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: descriptor 'append' of 'list' object needs an argument
The error messages are different, to indicate the different kinds of arguments that are missing (self vs normal argument). Whereas in RustPython:
>>>>> l = []
>>>>> l.append()
Traceback (most recent call last):
File <stdin>, line 0, in <module>
TypeError: Expected at least 2 arguments (1 given)
>>>>> list.append()
Traceback (most recent call last):
File <stdin>, line 0, in <module>
TypeError: Expected at least 2 arguments (0 given)
So you'd probably do something like
impl PyListRef {
fn append(self: PySelf<PyList>, ...) { ... }
}