Skip to content

Turn UNSET into a synonym for ellipsis - #1385

Closed
florimondmanca wants to merge 1 commit into
masterfrom
fm/unset-using-ellipsis
Closed

florimondmanca wants to merge 1 commit into
masterfrom
fm/unset-using-ellipsis

Conversation

@florimondmanca

@florimondmanca florimondmanca commented Nov 7, 2020 •

Copy link
Copy Markdown
Contributor

Closes #1384, refs #1384 (comment).

For consideration, but I quite like this :-)

This PR changes UNSET and UnsetType so they refer to ... and builtins.ellipsis respectively, i.e. the ellipsis special value.

This is a first step that gets us the behavior we want (users can override by setting auth=..., timeout=..., and then comparing if auth is ...: ...). But there's an obvious follow-up to update our code to drop those references internally. We may want to decide to keep the UnsetType and UNSET names available in 0.17.* but mark them as deprecated — we can decide of this as a follow-up.

@florimondmanca florimondmanca added the refactor Issues and PRs related to code refactoring label Nov 7, 2020
@florimondmanca florimondmanca added this to the v0.17 milestone Nov 7, 2020
@florimondmanca

Copy link
Copy Markdown
Contributor Author

… :-)

>>> import builtins
>>> builtins.ellipsis
AttributeError: module 'builtins' has no attribute 'ellipsis'

And yet mypy accepts builtins.ellipsis, since builtins.pyi defines it… Hmm, so, anyway, this won't lead us anywhere (mypy doesn't accept Ellipsis (which does exist at runtime), saying it's an "improper type" (?)), so, closing…

@florimondmanca
florimondmanca deleted the fm/unset-using-ellipsis branch November 7, 2020 11:57
@florimondmanca florimondmanca mentioned this pull request Nov 7, 2020
@florimondmanca florimondmanca removed this from the v0.17 milestone Nov 7, 2020
@lovelydinosaur

Copy link
Copy Markdown
Member

Nice little exploration yup!
I'd been considering exactly the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Issues and PRs related to code refactoring

Development

Successfully merging this pull request may close these issues.

Reconsider UNSET?

2 participants