Skip to content
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

Embrace the __future__ of typing #1155

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

ivirshup
Copy link
Collaborator

@ivirshup ivirshup commented May 21, 2024

This PR moves the codebase towards using more contemporary typing patterns via the from __future__ import annotations backport mechanism. Main changes are:

  • dict[str, str], list[int] instead of from typing import Dict, List, Dict[str, str], List[int]
  • int | str instead of from typing import Union Union[int, str]
  • int | None instead of Optional[int]

Turns out this needed a little bit of manual work. For now, here is a demo of what this looks like. I've covered the main census API, but not the tests or experimental yet.

@ivirshup ivirshup added the python api Related to the API label May 21, 2024
@ivirshup
Copy link
Collaborator Author

I need to look into the failure, iirc this may be fixable with typing-extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python api Related to the API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant