Skip to content

Conversation

blink1073
Copy link
Member

No description provided.

@blink1073 blink1073 requested a review from NoahStapp September 5, 2023 22:07
@blink1073 blink1073 requested a review from a team as a code owner September 5, 2023 22:07
Copy link
Contributor

@NoahStapp NoahStapp left a comment

Choose a reason for hiding this comment

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

Just one question, otherwise looks good!

@@ -275,7 +276,7 @@ def delete(self, file_id: Any, session: Optional[ClientSession] = None) -> None:
self.__files.delete_one({"_id": file_id}, session=session)
self.__chunks.delete_many({"files_id": file_id}, session=session)

def list(self, session: Optional[ClientSession] = None) -> List[str]:
def list(self, session: Optional[ClientSession] = None) -> list[str]:
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought list and the other generics were added in Python 3.9, and yet the 3.7 tests pass. Does __future__ add this support?

Copy link
Member Author

Choose a reason for hiding this comment

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

With __future__ we can use them as annotations, but not as concrete objects, e.g. in cast(list[foo], ... or in MyType = list[foo].

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it!

@blink1073 blink1073 merged commit 6f4e617 into mongodb:master Sep 11, 2023
@blink1073 blink1073 deleted the PYTHON-3905 branch September 11, 2023 15:49
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