Improve multiprocessing stubs
Open
Nobody has claimed this yet.
stubs: improvement
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.1k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 82
Description
stubtest finds a number of issues with the existing multiprocessing stubs. PRs that work toward fixing these (if they need fixing) are welcome, even if they're small!
~/dev/typeshed master λ python3.8 -m mypy.stubtest --custom-typeshed-dir . multiprocessing --concise
multiprocessing.Array is not a type
multiprocessing.Event is inconsistent, runtime does not have argument "lock"
multiprocessing.JoinableQueue is not a type
multiprocessing.Queue is not a type
multiprocessing.RawArray is not present in stub
multiprocessing.RawValue is not present in stub
multiprocessing.SimpleQueue is not a type
multiprocessing.Value is not a type
multiprocessing.reducer is not present in stub
multiprocessing.set_executable is inconsistent, stub argument "exe" differs from runtime argument "executable"
multiprocessing.context.BaseContext.Event is inconsistent, runtime does not have argument "lock"
multiprocessing.dummy.Namespace.__getattr__ is not present at runtime
multiprocessing.dummy.Pipe is not present in stub
multiprocessing.managers.BaseManager.shutdown is not present at runtime
multiprocessing.managers.Namespace.__getattr__ is not present at runtime
multiprocessing.managers.Server.__init__ is inconsistent, stub does not have argument "registry"
multiprocessing.managers.Server.__init__ is inconsistent, stub does not have argument "address"
multiprocessing.managers.Server.__init__ is inconsistent, stub does not have argument "authkey"
multiprocessing.managers.Server.__init__ is inconsistent, stub does not have argument "serializer"
multiprocessing.managers.Server.accept_connection is not present in stub
multiprocessing.managers.Server.accepter is not present in stub
multiprocessing.managers.Server.create is not present in stub
multiprocessing.managers.Server.debug_info is not present in stub
multiprocessing.managers.Server.decref is not present in stub
multiprocessing.managers.Server.dummy is not present in stub
multiprocessing.managers.Server.fallback_getvalue is not present in stub
multiprocessing.managers.Server.fallback_mapping is not present in stub
multiprocessing.managers.Server.fallback_repr is not present in stub
multiprocessing.managers.Server.fallback_str is not present in stub
multiprocessing.managers.Server.get_methods is not present in stub
multiprocessing.managers.Server.handle_request is not present in stub
multiprocessing.managers.Server.incref is not present in stub
multiprocessing.managers.Server.number_of_objects is not present in stub
multiprocessing.managers.Server.public is not present in stub
multiprocessing.managers.Server.serve_client is not present in stub
multiprocessing.managers.Server.shutdown is not present in stub
multiprocessing.managers.SharedMemoryServer.__init__ is inconsistent, stub does not have *args argument "args"
multiprocessing.managers.SharedMemoryServer.create is not present in stub
multiprocessing.managers.SharedMemoryServer.list_segments is not present in stub
multiprocessing.managers.SharedMemoryServer.public is not present in stub
multiprocessing.managers.SharedMemoryServer.release_segment is not present in stub
multiprocessing.managers.SharedMemoryServer.shutdown is not present in stub
multiprocessing.managers.SharedMemoryServer.track_segment is not present in stub
multiprocessing.managers.SyncManager.Barrier is not present in stub
multiprocessing.managers.SyncManager.Event is inconsistent, stub does not have *args argument "args"
multiprocessing.managers.SyncManager.JoinableQueue is not present in stub
multiprocessing.managers.SyncManager.Lock is inconsistent, stub does not have *args argument "args"
multiprocessing.managers.SyncManager.Namespace is inconsistent, stub does not have *args argument "args"
multiprocessing.managers.SyncManager.Pool is not present in stub
multiprocessing.managers.SyncManager.RLock is inconsistent, stub does not have *args argument "args"
multiprocessing.pool.ApplyResult.__init__ is inconsistent, stub does not have argument "pool"
multiprocessing.pool.ApplyResult.__init__ is inconsistent, stub does not have argument "callback"
multiprocessing.pool.ApplyResult.__init__ is inconsistent, stub does not have argument "error_callback"
multiprocessing.pool.CLOSE variable differs from runtime type Literal['CLOSE']
multiprocessing.pool.IMapIterator.__init__ is inconsistent, stub does not have argument "pool"
multiprocessing.pool.MapResult.__init__ is inconsistent, stub does not have argument "pool"
multiprocessing.pool.MapResult.__init__ is inconsistent, stub does not have argument "chunksize"
multiprocessing.pool.MapResult.__init__ is inconsistent, stub does not have argument "length"
multiprocessing.pool.MapResult.__init__ is inconsistent, stub does not have argument "callback"
multiprocessing.pool.MapResult.__init__ is inconsistent, stub does not have argument "error_callback"
multiprocessing.pool.Pool.Process is not present in stub
multiprocessing.pool.Pool.imap is inconsistent, stub argument "iterable" has a default value but runtime argument does not
multiprocessing.pool.Pool.imap_unordered is inconsistent, stub argument "iterable" has a default value but runtime argument does not
multiprocessing.pool.Pool.map is inconsistent, stub argument "iterable" has a default value but runtime argument does not
multiprocessing.pool.Pool.map_async is inconsistent, stub argument "iterable" has a default value but runtime argument does not
multiprocessing.pool.Pool.starmap is inconsistent, stub argument "iterable" has a default value but runtime argument does not
multiprocessing.pool.Pool.starmap_async is inconsistent, stub argument "iterable" has a default value but runtime argument does not
multiprocessing.pool.RUN variable differs from runtime type Literal['RUN']
multiprocessing.pool.TERMINATE variable differs from runtime type Literal['TERMINATE']
multiprocessing.pool.ThreadPool.Process is not present in stub
multiprocessing.queues.JoinableQueue.__init__ is inconsistent, stub argument "ctx" has a default value but runtime argument does not
multiprocessing.queues.Queue.__init__ is inconsistent, stub argument "ctx" has a default value but runtime argument does not
multiprocessing.queues.Queue.put_nowait is inconsistent, stub argument "item" differs from runtime argument "obj"
multiprocessing.queues.SimpleQueue.__init__ is inconsistent, stub argument "ctx" has a default value but runtime argument does not
multiprocessing.queues.SimpleQueue.put is inconsistent, stub argument "item" differs from runtime argument "obj"
multiprocessing.spawn._main is inconsistent, stub does not have argument "parent_sentinel"
multiprocessing.synchronize.Barrier.__init__ is inconsistent, runtime does not have *args argument "ctx"
multiprocessing.synchronize.Barrier.__init__ is inconsistent, stub does not have argument "ctx"
multiprocessing.synchronize.Condition.acquire is not present at runtime
multiprocessing.synchronize.Condition.release is not present at runtime
multiprocessing.synchronize.Event.__init__ is inconsistent, runtime does not have argument "lock"
multiprocessing.synchronize.SemLock.__init__ is inconsistent, stub does not have argument "kind"
multiprocessing.synchronize.SemLock.__init__ is inconsistent, stub does not have argument "value"
multiprocessing.synchronize.SemLock.__init__ is inconsistent, stub does not have argument "maxvalue"
multiprocessing.synchronize.SemLock.__init__ is inconsistent, stub does not have argument "ctx"
multiprocessing.synchronize.SemLock.acquire is not present at runtime
multiprocessing.synchronize.SemLock.release is not present at runtime
multiprocessing.synchronize.Semaphore.get_value is not present in stub
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the issue's python3.8 -m mypy.stubtest --custom-typeshed-dir . multiprocessing --concise command and inspect the multiprocessing stubs corresponding to one small group of reported mismatches. Compare the selected APIs with the runtime, update only the relevant stubs, and rerun stubtest to confirm those discrepancies are resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100