May-20-2019, 10:46 AM
I am not sure I can understand you, may be this is because I am not a native English speaker. Are you talking about passing arguments to a function, or overriding dictionary methods, e.g.
dict.__getitem__
? Could you provide some code: where it was used None
and where you want to use Ellipsis instead. If you need to override dict.__getitem__
, you need to subclass UserDict
instead of dict:from collections import UserDict class option(UserDict): def __getitem__(self, key): if key is Ellipsis: print("Do some stuff") else: return super().__getitem__(key) z = option() z.update({'one': 1}) z[...]Hope that helps...