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

improve identity of threading.Lock #12966

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

improve identity of threading.Lock #12966

wants to merge 2 commits into from

Conversation

tungol
Copy link
Contributor

@tungol tungol commented Nov 6, 2024

Removes extra copy of the type, although I did immediately add back a different extra copy for the minor benefit of getting the name _thread.lock correct on 3.13+. We can call it even, I guess.

@tungol tungol marked this pull request as draft November 6, 2024 23:38

This comment has been minimized.

@tungol tungol changed the title accurately represent threading.Lock improve identity of threading.Lock Nov 6, 2024
Copy link
Contributor

github-actions bot commented Nov 6, 2024

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

discord.py (https://github.com/Rapptz/discord.py)
- discord/webhook/sync.py:153: error: Incompatible types in assignment (expression has type "DeferredLock", variable has type "Lock")  [assignment]
+ discord/webhook/sync.py:153: error: Incompatible types in assignment (expression has type "DeferredLock", variable has type "LockType")  [assignment]
- discord/webhook/sync.py:197: error: "Lock" has no attribute "delay_by"  [attr-defined]
+ discord/webhook/sync.py:197: error: "LockType" has no attribute "delay_by"  [attr-defined]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/profiling/collector/threading.py:43: error: Unused "type: ignore" comment  [unused-ignore]

@tungol
Copy link
Contributor Author

tungol commented Nov 6, 2024

The unused ignore is from threading.Lock = value producing the error error: Cannot assign to a type [misc].

@tungol tungol marked this pull request as ready for review November 6, 2024 23:57
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.

1 participant