Skip to content

Conversation

@sobolevn
Copy link
Member

Source commit: python/cpython@6883007

@github-actions

This comment has been minimized.

from typing_extensions import TypeAlias

_F = TypeVar("_F", bound=Callable[..., Any])
_DurationsType: TypeAlias = list[tuple[unittest.case.TestCase, float]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

At least collectedDurations (ugh, camel case...) uses list[tuple[str, float]]:

https://github.com/python/cpython/blob/24b9bdd6eaf0b04667b6cd4c8154f7c7c10c2398/Lib/unittest/result.py#L170

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeap, I used docs for this type. Let's wait for your PR to land first.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like a deliberate change to fix a circular reference, they just forgot to update the docs: python/cpython#106888

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions

This comment has been minimized.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/runtests.py:72: error: Unused "type: ignore" comment  [unused-ignore]
+ tornado/test/runtests.py:78: error: Unused "type: ignore" comment  [unused-ignore]

@AlexWaygood AlexWaygood merged commit c9583d9 into main Aug 30, 2023
@AlexWaygood AlexWaygood deleted the py312-unittest branch August 30, 2023 10:35
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.

4 participants