MAINT: handle not implemented arguments centrally, via a dedicated annotation #114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
as discussed in #112 (comment)
This does seem to gain a marginal LOC reduction and some possible readability improvement. Two points:
I'm {ab,re}using the
NotImplemented
singleton as the annotation. Introducing a newNotImplementedType
is a bit awkward sincetyping.NotImplementedType
is a thing from python 3.10, and we need to cover 3.8+. A simple alternative is to just usetype(NotImplemented)
instead ofNotImplemented
. Don't have a firm opinion, am open to suggestions.NumPy uses a weird
_NoValue
sentinel in some cases; we mimicked it by defining an aliasNoValue = None
. In our usage we typically raise NotImplementedError on things with theNoValue
default. Now that we have a dedicated annotation,NoValue
alias seems extraneous. Anyone sees a need for it?