15 Jun
2022
15 Jun
'22
10:44 a.m.
Could this be the behaviour of passing in an Ellipsis? e.g. def foo(defaults_to_one=1): return defaults_to_one assert foo(...) == foo() def bar(something=...): return foo(something) assert bar() == foo() def baz(arg): # no defaults return arg assert baz(...) == ... The only place that I am aware of the Ellipsis being used is in index notation (numpy). So this would have likely an impact on __getitem__ or the slice object. *Alternatively* a subtype of Ellipses specifically for when used in argument defaults DefaultEllipsis (or equivalent): def foo(x=...): return x assert isinstance(foo(), EllipsisType) assert foo() != Ellipsis assert isinstance(foo(...), EllipsisType) assert foo(...) == Ellipsis