python / python/typeshed

Improve multiprocessing stubs

オープン
#4,266 コメント 16 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

stubs: improvement
主要言語
Python
スター
5.1k
フォーク
2.1k
平均マージ
1日 19時間
マージ済み PR(30日)
82

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、issue の python3.8 -m mypy.stubtest --custom-typeshed-dir . multiprocessing --concise コマンドを実行し、報告された不一致のうち小規模なグループ 1 つに対応する multiprocessing スタブを調べます。選択した API をランタイムと比較し、関連するスタブだけを更新してから、stubtest を再実行し、それらの不一致が解消されたことを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
testing-qa, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。