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
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/C2L3COISYSSVFAYXRFVVNPFBBOQYXVQU/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to