-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: hotfix for a functional breakage introduced in #3546 #3692
BUG: hotfix for a functional breakage introduced in #3546 #3692
Conversation
OK, so why is this now a bug, when it wasn't before, and when we explicitly said all the typing stuff would be optional? I'm confused, and this needs to be figured out before we do anything else. |
This is because #3546 never triggered the docs build, and apparently the only tests we have that exercise what's broken here are in there |
@neutrinoceros Why is this an error if it's just typing? Because of mypy? |
@@ -55,7 +55,7 @@ class PlotCallback: | |||
# "figure" this is disregarded. If "force" is included in the tuple, it | |||
# will *not* check whether or not the coord_system is in axis or figure, | |||
# and will only look at the geometries. | |||
_supported_geometries: Tuple[str, ...] | |||
_supported_geometries: Optional[Tuple[str, ...]] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the Optional
is so that it's not required to be defined in subclasses, right? Not that it isn't required to be defined as an attribute? This is rather frustrating if this is the case, because if that is correct, it seems like it may be pointless to have anything in a base class that is typed as anything other than Optional
. Is that the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not. Optional[Tuple]
is short for Union[None, Tuple]
, but the name is indeed confusing. It's going away in Python 3.10 where we can replace it with None | Tuple
, so we don't have to live with it for ever.
It's not just typing, apparently I removed the default value for |
I see, ok. |
PR Summary
This should resolve the docs part of #3690
For reproduction: