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

Move code of handling TypedDict __getitem__ to plugins #11683

Closed

Conversation

97littleleaf11
Copy link
Collaborator

@97littleleaf11 97littleleaf11 commented Dec 8, 2021

Description

#6138

  • Created a new file for TypedDict plugin
  • Added missing context information for infer_literal_expr_type()

Test Plan

@@ -2981,8 +2981,8 @@ def visit_index_with_type(self, left_type: Type, e: IndexExpr,
return make_simplified_union(out)
else:
return self.nonliteral_tuple_index_helper(left_type, index)
elif isinstance(left_type, TypedDictType):
return self.visit_typeddict_index_expr(left_type, e.index)
# elif isinstance(left_type, TypedDictType):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: #11244

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's a rollback. Do you have opinions about the original proposal #6138? It that case maybe we should alse move delitem and setitem to plugins

@97littleleaf11 97littleleaf11 deleted the refactor-typeddict-plugin branch February 22, 2022 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants