-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
multiprocessing: Value / Array with lock=False are not Sized #9898
Comments
I have no experience with sharedctypes, but this looks to be to be a simple bug: |
I think it should be
|
Can this be assigned to me? |
Thanks @Akuli, i tested your suggestion by replacing
So while this would solve the issue, I'm not sure about possible side effects... |
You can always open an exploratory PR here. mypy_primer will test the change against quite a lot of projects, which helps us to judge the impact. |
could fix python#8799 and python#9898, but request review for side effects. Without this change, static type checkers would treat `Value(ctypes.c_float, 0.0)` like `ctypes.c_float`, but `Value` offers a field `value` for storage
I created #11576 to test this change, maybe someone can help with review there? |
Hello everyone,
Consider the following code:
To my untrained eye, the issue is with https://github.com/python/typeshed/blob/main/stdlib/multiprocessing/sharedctypes.pyi#L40 returning
_CT
while https://github.com/python/typeshed/blob/main/stdlib/multiprocessing/sharedctypes.pyi#L48 returnsSynchronizedArray[Any]
Actually,
Array
does support__len__
even withlock=False
and therefore isSized
. I'm quite sure there is a reason to return_CT
instead forlock=False
, but I do not know it and it probably should not have this side effect.The text was updated successfully, but these errors were encountered: