Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Prefer builtins over some typing aliases #1001

Conversation

RyanBalfanz
Copy link
Member

@RyanBalfanz RyanBalfanz commented Oct 20, 2024

This is an incremental replacement of typing.Dict with builtins.dict, typing.List with builtins.list, typing.Set with builtins.set, and typing.Tuple with builtins.tuple, though other aliases exist which.

See: https://docs.python.org/3/library/typing.html#deprecated-aliases

Deprecated since version 3.9: builtins.dict now supports subscripting ([]). See PEP 585 and Generic Alias Type.

Deprecated since version 3.9, as such, this change makes sense to follow #1002 which makes version 3.9 the oldest supported version though the aliases are guaranteed to remain in the typing module without deprecation warnings until at least Python 3.14.

Closes #

💸 TL;DR

📜 Details

Design Doc

Jira

🧪 Testing Steps / Validation

✅ Checks

  • CI tests (if present) are passing
  • Adheres to code style for repo
  • Contributor License Agreement (CLA) completed if not a Reddit employee

@RyanBalfanz RyanBalfanz force-pushed the prefer-builtins-over-deprecated-typing-aliases branch from be2556f to d83d813 Compare October 20, 2024 04:27
This is an incremental replacement of `typing.Dict` with `builtins.dict`, `typing.List` with `builtins.list`, `typing.Set` with `builtins.set`, and `typing.Tuple` with `builtins.tuple`, though other aliases exist which.

See: https://docs.python.org/3/library/typing.html#deprecated-aliases
@RyanBalfanz RyanBalfanz force-pushed the prefer-builtins-over-deprecated-typing-aliases branch from a27fd27 to 3ca263c Compare October 20, 2024 04:37
@RyanBalfanz
Copy link
Member Author

#1002 was moved to #1003

@chriskuehl
Copy link
Member

@RyanBalfanz it looks like a lot of these were converted by Ruff already, do you think we still need this PR?

@RyanBalfanz
Copy link
Member Author

@RyanBalfanz it looks like a lot of these were converted by Ruff already, do you think we still need this PR?

If Ruff took care of it, then great! I'll take a look to see if anything my have been missed and create a new PR if so.

@RyanBalfanz
Copy link
Member Author

I took a look; this is no longer needed.

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

Successfully merging this pull request may close these issues.

2 participants