3 ms·
it's not the same, but it's almost idiomatic to leave unfinished python code with "..." (the ellipsis object) def foo(bar, baz): ... is a valid (e
by _ZeD_ 5y ago
it's not the same, but it's almost idiomatic to leave unfinished python code with "..." (the ellipsis object)
def foo(bar, baz):
...
is a valid (empty) python function
- senkora 5y agoOh, interesting. I’ve always used “pass” for this.
- staticassertion 5y agoYeah, but this is best used for abstract methods or type stubs. I think in 'real code' you would want to raise NotImplementedError, or even (if you use mypy) potentially return a NoReturn ie: from typing import Any, NoReturn def foo(bar: Any, baz: Any) -> NoReturn: raise NotImplementedError
- toast0 5y agoPerl has ellipsis which will die on use.