python / cpython

The Python programming language
https://www.python.org
Other
62.3k stars 29.93k forks source link

Can we make the `_thread` module truly private? (remove docs, deprecate things we don't expose via `threading`) #115981

Open gpshead opened 6 months ago

gpshead commented 6 months ago

Feature or enhancement

Proposal:

The https://docs.python.org/3/library/_thread.html module has a history, it used to be thread in Python 2 and earlier IIRC. But we want everyone to use threading and the _ prefix is intentional to suggest "do not use". Can we take this private and deprecate its direct use?

_thread.start_new_thread() for example is not an API used by the standard library. We could delete that code (which launches untracked unjoinable threads). Possibly more.

investigation into what code in the world does still use it as why would be helpful.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

serhiy-storchaka commented 6 months ago

I suppose that there was third-party code that directly used start_new_thread(), allocate_lock() and other API. If they are still used in important code, this module can be considered as a tool for experts rather than simply an implementation detail. We should look how they are used and what can be alternatives.

hugovk commented 6 months ago

Rough results searching in the top 8k PyPI projects (2024-02-22):

import _thread\b|from _thread import: Found 236 matching lines in 114 projects

Details ```python ❯ python3 ~/github/misc/cpython/search_pypi_top.py -q . "import _thread\b|from _thread import " ./celery-5.3.6.tar.gz: celery-5.3.6/celery/utils/threads.py: from _thread import get_ident ./dill-0.3.8.tar.gz: dill-0.3.8/dill/_dill.py: from _thread import LockType ./dill-0.3.8.tar.gz: dill-0.3.8/dill/_dill.py: from _thread import RLock as RLockType ./DIRAC-8.0.38.tar.gz: DIRAC-8.0.38/src/DIRAC/ConfigurationSystem/Client/Helpers/Operations.py: import _thread ./DIRAC-8.0.38.tar.gz: DIRAC-8.0.38/src/DIRAC/ConfigurationSystem/private/ConfigurationData.py: import _thread ./DIRAC-8.0.38.tar.gz: DIRAC-8.0.38/src/DIRAC/ConfigurationSystem/private/Refresher.py: import _thread ./DIRAC-8.0.38.tar.gz: DIRAC-8.0.38/src/DIRAC/Core/DISET/private/BaseClient.py: import _thread ./DIRAC-8.0.38.tar.gz: DIRAC-8.0.38/src/DIRAC/Core/Utilities/LockRing.py: import _thread ./DIRAC-8.0.38.tar.gz: DIRAC-8.0.38/src/DIRAC/FrameworkSystem/private/standardLogging/test/Test_Logging_FormatOptions.py: import _thread ./cffi-1.16.0.tar.gz: cffi-1.16.0/src/cffi/cparser.py: import _thread ./cffi-1.16.0.tar.gz: cffi-1.16.0/src/cffi/lock.py: from _thread import allocate_lock ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi0/backend_tests.py: import _thread as thread ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi0/test_verify.py: import _thread as thread ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi1/test_ffi_obj.py: import _thread as thread ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi1/test_ffi_obj.py: import _thread as thread ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi1/test_verify1.py: import _thread as thread ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/embedding/tlocal.py: import _thread as thread # py3 ./dask-2024.2.0.tar.gz: dask-2024.2.0/dask/tests/test_threaded.py: from _thread import interrupt_main ./cftime-1.6.3.tar.gz: cftime-1.6.3/src/cftime/_strptime.py: from _thread import allocate_lock as _thread_allocate_lock ./CherryPy-18.9.0.tar.gz: CherryPy-18.9.0/cherrypy/process/plugins.py: import _thread ./Django-5.0.2.tar.gz: Django-5.0.2/django/db/backends/base/base.py: import _thread ./azure-datalake-store-0.0.53.tar.gz: azure-datalake-store-0.0.53/azure/datalake/store/multiprocessor.py: import _thread ./circus-0.18.0.tar.gz: circus-0.18.0/circus/fixed_threading.py: from _thread import get_ident ./apache-superset-3.1.1.tar.gz: apache-superset-3.1.1/superset/utils/core.py: import _thread ./docker-compose-1.29.2.tar.gz: docker-compose-1.29.2/compose/cli/log_printer.py: import _thread as thread ./docker-compose-1.29.2.tar.gz: docker-compose-1.29.2/compose/parallel.py: import _thread as thread ./dbnd-1.0.21.5.tar.gz: dbnd-1.0.21.5/src/dbnd/_core/utils/seven.py: from _thread import get_ident ./django-datadog-logger-0.6.3.tar.gz: django-datadog-logger-0.6.3/django_datadog_logger/local.py: from _thread import get_ident ./django-datadog-logger-0.6.3.tar.gz: django-datadog-logger-0.6.3/django_datadog_logger/local.py: from _thread import get_ident ./clvm_rs-0.6.0.tar.gz: clvm_rs-0.6.0/venv/lib/python3.7/site-packages/pkg_resources/_vendor/pyparsing.py: from _thread import RLock ./clvm_rs-0.6.0.tar.gz: clvm_rs-0.6.0/venv/lib/python3.7/site-packages/setuptools/_vendor/pyparsing.py: from _thread import RLock ./apsw-3.45.1.0.tar.gz: apsw-3.45.1.0/apsw/trace.py: import _thread ./coverage-7.4.2.tar.gz: coverage-7.4.2/coverage/debug.py: import _thread ./ansible-9.2.0.tar.gz: ansible-9.2.0/ansible_collections/ansible/netcommon/plugins/plugin_utils/compat/telnetlib.py: import _thread ./dtale-3.10.0.tar.gz: dtale-3.10.0/dtale/app.py: import _thread ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_thread_wrappers.py: # import _thread as mod ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: import _thread ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py: import _thread as thread; verify_shadowed.check(thread, ['start_new_thread', 'start_new', 'allocate_lock']) ./duckdb-0.10.0.tar.gz: duckdb-0.10.0/tests/fast/api/test_query_interrupt.py: import _thread as thread ./Flask-Injector-0.15.0.tar.gz: Flask-Injector-0.15.0/flask_injector/tests.py: # from _thread import get_ident ./astroid-3.0.3.tar.gz: astroid-3.0.3/astroid/brain/brain_six.py: import _thread ./astropy-6.0.0.tar.gz: astropy-6.0.0/astropy/extern/_strptime.py: from _thread import allocate_lock as _thread_allocate_lock ./faiss-cpu-1.7.4.tar.gz: faiss-cpu-1.7.4/faiss/contrib/rpc.py: import _thread ./flower-2.0.1.tar.gz: flower-2.0.1/flower/events.py: import _thread as thread ./bottle-0.12.25.tar.gz: bottle-0.12.25/bottle.py: import _thread as thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/_hub_local.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/lock_tests.py: from _thread import start_new_thread, get_ident ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__core_async.py: import _thread as thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__monkey.py: import _thread as thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__refcount.py: from _thread import start_new_thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__thread.py: from _thread import allocate_lock as std_allocate_lock ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__threading_2.py: import _thread as thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__threading_2.py: import _thread as thread # Py3 ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/thread.py: import _thread as __thread__ # pylint:disable=import-error ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_signal.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_socket.py: import _thread as thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: import _thread, threading, os, time ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_signal.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_socket.py: import _thread as thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: import _thread, threading, os, time ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_signal.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_socket.py: import _thread as thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: import _thread, threading, os, time, warnings ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_socket.py: import _thread as thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: import _thread, threading, os, time ./eventlet-0.35.2.tar.gz: eventlet-0.35.2/eventlet/green/profile.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_socket.py: import _thread as thread ./eventlet-0.35.2.tar.gz: eventlet-0.35.2/eventlet/green/thread.py: import _thread as __thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: import _thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: import _thread, threading, os, time ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: import _thread ./eventlet-0.35.2.tar.gz: eventlet-0.35.2/tests/__init__.py: from _thread import RLock ./bson-0.5.10.tar.gz: bson-0.5.10/bson/py3compat.py: import _thread as thread ./execnet-2.0.2.tar.gz: execnet-2.0.2/src/execnet/gateway_base.py: from _thread import interrupt_main ./execnet-2.0.2.tar.gz: execnet-2.0.2/src/execnet/gateway_base.py: import _thread ./execnet-2.0.2.tar.gz: execnet-2.0.2/src/execnet/gateway_base.py: import _thread ./execnet-2.0.2.tar.gz: execnet-2.0.2/testing/test_channel.py: import _thread ./fastrlock-0.8.2.tar.gz: fastrlock-0.8.2/fastrlock/tests/test_rlock.py: from _thread import start_new_thread, get_ident ./dagster-1.6.5.tar.gz: dagster-1.6.5/dagster/_utils/__init__.py: import _thread as thread ./ibm-watson-7.0.1.tar.gz: ibm-watson-7.0.1/ibm_watson/websocket/recognize_listener.py: import _thread as thread ./ibm-watson-7.0.1.tar.gz: ibm-watson-7.0.1/ibm_watson/websocket/synthesize_listener.py: import _thread as thread ./jedi-0.19.1.tar.gz: jedi-0.19.1/jedi/third_party/typeshed/stdlib/2and3/_dummy_threading.pyi: from _thread import get_native_id as get_native_id ./jedi-0.19.1.tar.gz: jedi-0.19.1/jedi/third_party/typeshed/stdlib/2and3/_dummy_threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./jedi-0.19.1.tar.gz: jedi-0.19.1/jedi/third_party/typeshed/stdlib/2and3/threading.pyi: from _thread import get_native_id as get_native_id ./jedi-0.19.1.tar.gz: jedi-0.19.1/jedi/third_party/typeshed/stdlib/2and3/threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./jedi-0.19.1.tar.gz: jedi-0.19.1/jedi/third_party/typeshed/third_party/3/six/moves/_thread.pyi: from _thread import * ./azure-ai-ml-1.13.0.tar.gz: azure-ai-ml-1.13.0/azure/ai/ml/dsl/_group_decorator.py: import _thread ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/deprecated/python/configparser/backports/configparser/helpers.py: from _thread import get_ident ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/deprecated/python/functools32/functools32/_dummy_thread32.py: import _thread # Python >= 3 ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/deprecated/python/singledispatch/singledispatch/helpers.py: from _thread import get_ident ./functools32-3.2.3-2.tar.gz: functools32-3.2.3-2/functools32/_dummy_thread32.py: import _thread # Python >= 3 ./future-1.0.0.tar.gz: future-1.0.0/docs/3rd-party-py3k-compat-code/gevent_py3k.py: import _thread as thread ./future-1.0.0.tar.gz: future-1.0.0/docs/build/html/_sources/standard_library_imports.rst.txt: import _thread ./future-1.0.0.tar.gz: future-1.0.0/src/future/backports/misc.py: from _thread import get_ident ./future-1.0.0.tar.gz: future-1.0.0/src/future/backports/test/support.py: import _thread, threading ./future-1.0.0.tar.gz: future-1.0.0/src/future/moves/_dummy_thread.py: from _thread import * ./future-1.0.0.tar.gz: future-1.0.0/src/future/moves/_thread.py: from _thread import * ./future-1.0.0.tar.gz: future-1.0.0/src/future/standard_library/__init__.py: import _thread ./future-1.0.0.tar.gz: future-1.0.0/tests/test_future/test_standard_library.py: import _thread ./future-1.0.0.tar.gz: future-1.0.0/tests/test_future/test_standard_library.py: from future.moves import _thread ./futurist-2.4.1.tar.gz: futurist-2.4.1/futurist/_futures.py: from futurist import _thread ./impacket-0.11.0.tar.gz: impacket-0.11.0/impacket/examples/ntlmrelayx/attacks/ldapattack.py: import _thread ./jplephem-2.21.tar.gz: jplephem-2.21/jplephem/daf.py: from _thread import allocate_lock ./lupa-2.0.tar.gz: lupa-2.0/lupa/tests/test.py: from _thread import start_new_thread, get_ident ./ipykernel-6.29.2.tar.gz: ipykernel-6.29.2/ipykernel/parentpoller.py: from _thread import interrupt_main # Py 3 ./gsutil-5.27.tar.gz: gsutil-5.27/gslib/vendored/boto/boto/compat.py: import _thread ./mariadb-1.1.10.tar.gz: mariadb-1.1.10/mariadb/connectionpool.py: import _thread ./ipython-8.22.0.tar.gz: ipython-8.22.0/IPython/utils/tests/test_process.py: from _thread import interrupt_main # Py 3 ./guppy3-3.1.4.post1.tar.gz: guppy3-3.1.4.post1/guppy/heapy/Remote.py: import _thread ./guppy3-3.1.4.post1.tar.gz: guppy3-3.1.4.post1/guppy/heapy/test/test_Path.py: import _thread ./guppy3-3.1.4.post1.tar.gz: guppy3-3.1.4.post1/guppy/heapy/test/test_Path.py: import _thread ./guppy3-3.1.4.post1.tar.gz: guppy3-3.1.4.post1/guppy/heapy/test/test_Path.py: import _thread ./isort-5.13.2.tar.gz: isort-5.13.2/tests/integration/test_setting_combinations.py: import _thread as thread ./mo-future-7.541.24038.tar.gz: mo-future-7.541.24038/mo_future/__init__.py: from _thread import allocate_lock, get_ident, start_new_thread, interrupt_main ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/python/numpy/py2/numpy/core/arrayprint.py: from _thread import get_ident ./mpi4py-3.1.5.tar.gz: mpi4py-3.1.5/src/mpi4py/MPI/commimpl.pxi: from _thread import allocate_lock as Lock ./LinkChecker-10.4.0.tar.gz: LinkChecker-10.4.0/linkcheck/director/logger.py: import _thread ./LinkChecker-10.4.0.tar.gz: LinkChecker-10.4.0/linkcheck/director/task.py: import _thread ./mpire-2.10.0.tar.gz: mpire-2.10.0/mpire/worker.py: import _thread ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/python/numpy/py3/numpy/core/arrayprint.py: from _thread import get_ident ./ppft-1.7.6.8.tar.gz: ppft-1.7.6.8/ppft/tests/callback.py: import _thread as thread ./newrelic-9.6.0.tar.gz: newrelic-9.6.0/newrelic/core/trace_cache.py: import _thread as thread ./nicegui-1.4.15.tar.gz: nicegui-1.4.15/nicegui/native/native_mode.py: import _thread ./os_sys-2.1.4.tar.gz: os_sys-2.1.4/edit/run.py: import _thread as thread ./os_sys-2.1.4.tar.gz: os_sys-2.1.4/server/db/backends/base/base.py: import _thread ./os_sys-2.1.4.tar.gz: os_sys-2.1.4/server/utils/autoreload.py: import _thread ./pex-2.2.1.tar.gz: pex-2.2.1/pex/vendor/_vendored/packaging_20_9/pyparsing.py: from _thread import RLock ./pex-2.2.1.tar.gz: pex-2.2.1/pex/vendor/_vendored/packaging_21_3/pyparsing.py: from _thread import RLock ./pex-2.2.1.tar.gz: pex-2.2.1/pex/vendor/_vendored/pip/pip/_vendor/pyparsing.py: from _thread import RLock ./pyinstaller-6.4.0.tar.gz: pyinstaller-6.4.0/PyInstaller/loader/pyimod02_importers.py: import _thread ./pex-2.2.1.tar.gz: pex-2.2.1/pex/vendor/_vendored/setuptools/pkg_resources/_vendor/pyparsing.py: from _thread import RLock ./pex-2.2.1.tar.gz: pex-2.2.1/pex/vendor/_vendored/setuptools/setuptools/_vendor/pyparsing.py: from _thread import RLock ./mypy-1.8.0.tar.gz: mypy-1.8.0/mypy/typeshed/stdlib/_dummy_threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./mypy-1.8.0.tar.gz: mypy-1.8.0/mypy/typeshed/stdlib/threading.pyi: from _thread import get_native_id as get_native_id ./mypy-1.8.0.tar.gz: mypy-1.8.0/mypy/typeshed/stdlib/threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./pandas-2.2.0.tar.gz: pandas-2.2.0/pandas/_libs/tslibs/strptime.pyx: from _thread import allocate_lock as _thread_allocate_lock ./pylink-square-1.2.0.tar.gz: pylink-square-1.2.0/examples/pylink-rtt: import _thread as thread ./pysingleton-0.2.1.tar.gz: pysingleton-0.2.1/singleton/singleton.py: import _thread as thread ./panel-1.3.8.tar.gz: panel-1.3.8/panel/widgets/indicators.py: from _thread import LockType ./paramiko-3.4.0.tar.gz: paramiko-3.4.0/paramiko/win_pageant.py: import _thread as thread ./numpy-1.26.4.tar.gz: numpy-1.26.4/numpy/core/arrayprint.py: from _thread import get_ident ./Paste-3.7.1.tar.gz: Paste-3.7.1/paste/httpserver.py: from six.moves import _thread ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevd_concurrency_analyser/pydevd_thread_wrappers.py: # import _thread as mod ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: import _thread ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_imps/_pydev_saved_modules.py: import _thread as thread ./python-dateutil-2.8.2.tar.gz: python-dateutil-2.8.2/dateutil/rrule.py: from six.moves import _thread, range ./python-dateutil-2.8.2.tar.gz: python-dateutil-2.8.2/dateutil/tz/_factories.py: from six.moves import _thread ./python-dateutil-2.8.2.tar.gz: python-dateutil-2.8.2/dateutil/tz/tz.py: from six.moves import _thread ./hug-2.6.1.tar.gz: hug-2.6.1/hug/development_runner.py: import _thread as thread ./hupper-1.12.1.tar.gz: hupper-1.12.1/src/hupper/worker.py: from _thread import interrupt_main ./robocorp_tasks-2.9.1.tar.gz: robocorp_tasks-2.9.1/src/robocorp/tasks/_interrupts.py: import _thread ./pip-api-0.0.33.tar.gz: pip-api-0.0.33/pip_api/_vendor/pyparsing.py: from _thread import RLock ./pyspark-stubs-3.0.0.post3.tar.gz: pyspark-stubs-3.0.0.post3/third_party/3/pyspark/ml/base.pyi: import _thread ./rpyc-5.3.1.tar.gz: rpyc-5.3.1/rpyc/utils/factory.py: from _thread import interrupt_main ./rq-1.15.1.tar.gz: rq-1.15.1/rq/local.py: from _thread import get_ident ./pymongo-4.6.2.tar.gz: pymongo-4.6.2/test/test_client.py: import _thread as thread ./Pympler-1.0.1.tar.gz: Pympler-1.0.1/pympler/util/bottle.py: import _thread as thread ./python-xlib-0.33.tar.gz: python-xlib-0.33/examples/xdamage.py: import _thread as thread ./python-xlib-0.33.tar.gz: python-xlib-0.33/Xlib/threaded.py: from six.moves import _thread ./python3-xlib-0.15.tar.gz: python3-xlib-0.15/Xlib/threaded.py: import _thread as thread ./pythonnet-3.0.3.tar.gz: pythonnet-3.0.3/tests/stress.py: import _thread as thread ./pythonnet-3.0.3.tar.gz: pythonnet-3.0.3/tests/test_thread.py: import _thread as thread ./raven-6.10.0.tar.gz: raven-6.10.0/raven/base.py: from _thread import get_ident as get_thread_ident ./raven-6.10.0.tar.gz: raven-6.10.0/raven/context.py: from _thread import get_ident as get_thread_ident ./salt-3006.7.tar.gz: salt-3006.7/salt/ext/tornado/ioloop.py: import _thread as thread ./salt-3006.7.tar.gz: salt-3006.7/salt/ext/tornado/test/twisted_test.py: import _thread as thread ./portalocker-2.8.2.tar.gz: portalocker-2.8.2/portalocker/redis.py: import _thread ./portalocker-2.8.2.tar.gz: portalocker-2.8.2/portalocker_tests/test_redis.py: import _thread ./pytype-2024.2.13.tar.gz: pytype-2024.2.13/pytype/typeshed/stdlib/_dummy_threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./pytype-2024.2.13.tar.gz: pytype-2024.2.13/pytype/typeshed/stdlib/threading.pyi: from _thread import get_native_id as get_native_id ./pytype-2024.2.13.tar.gz: pytype-2024.2.13/pytype/typeshed/stdlib/threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./pytype-2024.2.13.tar.gz: pytype-2024.2.13/pytype/typeshed/stubs/cffi/cffi/lock.pyi: from _thread import allocate_lock as allocate_lock ./salt-3006.7.tar.gz: salt-3006.7/salt/utils/odict.py: from _thread import get_ident as _get_ident ./pytype-2024.2.13.tar.gz: pytype-2024.2.13/pytype/typeshed/stubs/six/six/moves/_dummy_thread.pyi: from _thread import * ./pytype-2024.2.13.tar.gz: pytype-2024.2.13/pytype/typeshed/stubs/six/six/moves/_thread.pyi: from _thread import * ./sortedcontainers-2.4.0.tar.gz: sortedcontainers-2.4.0/sortedcontainers/sortedlist.py: from _thread import get_ident ./pyre-check-0.9.19.tar.gz: pyre-check-0.9.19/typeshed/stdlib/_dummy_threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./pyre-check-0.9.19.tar.gz: pyre-check-0.9.19/typeshed/stdlib/threading.pyi: from _thread import get_native_id as get_native_id ./pyre-check-0.9.19.tar.gz: pyre-check-0.9.19/typeshed/stdlib/threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/_pydev_saved_modules.py: import _thread as thread; verify_shadowed.check(thread, ['start_new_thread', 'start_new', 'allocate_lock']) ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: import _thread ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_thread_wrappers.py: # import _thread as mod ./pyre-check-0.9.19.tar.gz: pyre-check-0.9.19/typeshed/stubs/cffi/cffi/lock.pyi: from _thread import allocate_lock as allocate_lock ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: import _thread ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_imps/_pydev_saved_modules.py: import _thread as thread ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevd_concurrency_analyser/pydevd_thread_wrappers.py: # import _thread as mod ./pyre-check-0.9.19.tar.gz: pyre-check-0.9.19/typeshed/stubs/six/six/moves/_dummy_thread.pyi: from _thread import * ./pyre-check-0.9.19.tar.gz: pyre-check-0.9.19/typeshed/stubs/six/six/moves/_thread.pyi: from _thread import * ./schematics-2.1.1.tar.gz: schematics-2.1.1/schematics/util.py: from _thread import get_ident ./py-dateutil-2.2.tar.gz: py-dateutil-2.2/dateutil/rrule.py: import _thread ./py-dateutil-2.2.tar.gz: py-dateutil-2.2/sandbox/scheduler.py: import _thread ./pyscard-2.0.7.tar.gz: pyscard-2.0.7/smartcard/ReaderMonitoring.py: import _thread ./pyftdi-0.55.0.tar.gz: pyftdi-0.55.0/pyftdi/bin/pyterm.py: from _thread import interrupt_main ./sealights-python-agent-1.5.5.tar.gz: sealights-python-agent-1.5.5/python_agent/serverless/sealights_layer/python/libs/coverage/debug.py: import _thread ./scikit-learn-1.4.1.post1.tar.gz: scikit-learn-1.4.1.post1/doc/tutorial/machine_learning_map/pyparsing.py: from _thread import RLock ./spyder-5.5.1.tar.gz: spyder-5.5.1/external-deps/spyder-kernels/spyder_kernels/py3compat.py: import _thread ./testtools-2.7.1.tar.gz: testtools-2.7.1/testtools/tests/test_testcase.py: import _thread ./spyder-kernels-2.5.0.tar.gz: spyder-kernels-2.5.0/spyder_kernels/py3compat.py: import _thread ./spyne-2.14.0.tar.gz: spyne-2.14.0/spyne/test/interop/_test_soap_client_base.py: import _thread as thread ./unstructured-0.12.4.tar.gz: unstructured-0.12.4/unstructured/ingest/enhanced_dataclass/core.py: import _thread ./spyne-2.14.0.tar.gz: spyne-2.14.0/spyne/util/__init__.py: import _thread as thread ./workflow-2.1.6.tar.gz: workflow-2.1.6/workflow/patterns/controlflow.py: from six.moves import _thread as thread, queue ./wxPython-4.2.1.tar.gz: wxPython-4.2.1/wx/lib/agw/scrolledthumbnail.py: import _thread as thread ./types-cffi-1.16.0.20240106.tar.gz: types-cffi-1.16.0.20240106/cffi-stubs/lock.pyi: from _thread import allocate_lock as allocate_lock ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/py2to3/util.py.bak: # import _thread ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/py3/util.py: # import _thread ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/util.py: # import _thread ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/util.py.bak: # import _thread ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/zzarchive/zutil.py: # import _thread ./types-six-1.16.21.20240106.tar.gz: types-six-1.16.21.20240106/six-stubs/moves/_dummy_thread.pyi: from _thread import * ./types-six-1.16.21.20240106.tar.gz: types-six-1.16.21.20240106/six-stubs/moves/_thread.pyi: from _thread import * ./typeshed_client-2.4.0.tar.gz: typeshed_client-2.4.0/typeshed_client/typeshed/_dummy_threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./supervisor-4.2.5.tar.gz: supervisor-4.2.5/supervisor/compat.py: import _thread as thread ./typeshed_client-2.4.0.tar.gz: typeshed_client-2.4.0/typeshed_client/typeshed/threading.pyi: from _thread import get_native_id as get_native_id ./typeshed_client-2.4.0.tar.gz: typeshed_client-2.4.0/typeshed_client/typeshed/threading.pyi: from _thread import _excepthook, _ExceptHookArgs ./waitress-3.0.0.tar.gz: waitress-3.0.0/tests/test_wasyncore.py: import _thread as thread ./wandb-0.16.3.tar.gz: wandb-0.16.3/wandb/sdk/wandb_run.py: import _thread as thread ./taskflow-5.4.0.tar.gz: taskflow-5.4.0/taskflow/utils/threading_utils.py: import _thread ./tecton-0.8.5.tar.gz: tecton-0.8.5/tecton/vendor/dill/dill/_dill.py: from _thread import LockType ./tecton-0.8.5.tar.gz: tecton-0.8.5/tecton/vendor/dill/dill/_dill.py: from _thread import RLock as RLockType ./websocket-client-1.7.0.tar.gz: websocket-client-1.7.0/PKG-INFO: import _thread ./websocket-client-1.7.0.tar.gz: websocket-client-1.7.0/README.md: import _thread ./websocket-client-1.7.0.tar.gz: websocket-client-1.7.0/websocket_client.egg-info/PKG-INFO: import _thread ./wxPython-4.2.1.tar.gz: wxPython-4.2.1/demo/Threads.py: from six.moves import _thread ./zipfile36-0.1.3.tar.gz: zipfile36-0.1.3/test/support/__init__.py: import _thread, threading ./zope.testrunner-6.3.1.tar.gz: zope.testrunner-6.3.1/src/zope/testrunner/tests/test_threadsupport.py: from _thread import start_new_thread Time: 0:00:38.679839 Found 236 matching lines in 114 projects ```

thread.*\bstart_new_thread\b: Found 168 matching lines in 33 projects

Details ```python ❯ python3 ~/github/misc/cpython/search_pypi_top.py -q . "thread.*\bstart_new_thread\b" ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi0/backend_tests.py: thread.start_new_thread(f, ()) ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi0/test_verify.py: thread.start_new_thread(wrapper, (_lock,)) ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi1/test_ffi_obj.py: thread.start_new_thread(f, ()) ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi1/test_ffi_obj.py: thread.start_new_thread(f, ()) ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi1/test_verify1.py: thread.start_new_thread(wrapper, (_lock,)) ./appengine-python-standard-1.1.6.tar.gz: appengine-python-standard-1.1.6/src/google/appengine/runtime/thread_hooks.py: """Called in spawning thread before start_new_thread to capture state.""" ./appengine-python-standard-1.1.6.tar.gz: appengine-python-standard-1.1.6/src/google/appengine/runtime/thread_hooks.py: thread_module.start_new_thread = _MakeStartNewThread( ./appengine-python-standard-1.1.6.tar.gz: appengine-python-standard-1.1.6/src/google/appengine/runtime/thread_hooks.py: thread_module.start_new_thread, hooks) ./appengine-python-standard-1.1.6.tar.gz: appengine-python-standard-1.1.6/src/google/appengine/runtime/thread_hooks.py: Returns a function with an interface that matches thread.start_new_thread ./appengine-python-standard-1.1.6.tar.gz: appengine-python-standard-1.1.6/src/google/appengine/runtime/thread_hooks.py: base_start_new_thread: The thread.start_new_thread function to call to ./appengine-python-standard-1.1.6.tar.gz: appengine-python-standard-1.1.6/src/google/appengine/runtime/thread_hooks.py: """A replacement for thread.start_new_thread. ./appengine-python-standard-1.1.6.tar.gz: appengine-python-standard-1.1.6/src/google/appengine/runtime/thread_hooks.py: A replacement for thread.start_new_thread that inherits RequestEnvironment ./appengine-python-standard-1.1.6.tar.gz: appengine-python-standard-1.1.6/src/google/appengine/runtime/thread_hooks.py: See thread.start_new_thread. ./ansible-9.2.0.tar.gz: ansible-9.2.0/ansible_collections/ansible/netcommon/plugins/plugin_utils/compat/telnetlib.py: _thread.start_new_thread(self.listener, ()) ./dtale-3.10.0.tar.gz: dtale-3.10.0/dtale/app.py: _thread.start_new_thread(_start, ()) ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/pydevconsole.py: start_new_thread = thread.start_new_thread ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_daemon_thread.py: # (i.e.: just using the `thread.start_new_thread` instead of `threading.Thread`) ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_thread_wrappers.py: # mod.start_new_thread = wrapper(mod.start_new_thread) ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_is_thread_alive.py: # It is required to debug threads started by start_new_thread in Python 3.4 ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: _original_start_new_thread = thread_module._original_start_new_thread = thread_module.start_new_thread ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: We need to replace the original thread_module.start_new_thread with this function so that threads started ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: # This is a hack for the situation where the thread_module.start_new_thread is declared inside a class, such as the one below ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: # start_new_thread = thread_module.start_new_thread ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: # We need to replace the original thread_module.start_new_thread with this function so that threads started through ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: thread_module.start_new_thread = pydev_start_new_thread ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: Can be used to temporarily stop tracing threads created with thread.start_new_thread. ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: Can be used to start tracing threads created with thread.start_new_thread again. ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: return threading_module.start_new_thread ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py: import _thread as thread; verify_shadowed.check(thread, ['start_new_thread', 'start_new', 'allocate_lock']) ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel.py: thread.start_new_thread(self._reader_thread, (proc.stdout, sys.stdout)) ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel.py: thread.start_new_thread(target=self._reader_thread, args=(proc.stderr, sys.stderr)) ./boto-2.49.0.tar.gz: boto-2.49.0/tests/unit/utils/test_utils.py: _thread.start_new_thread(f, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/_monitor.py: start_new_thread = get_original(thread_mod_name, 'start_new_thread') ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/_monitor.py: self.monitor_thread_ident = start_new_thread(self, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/_monitor.py: self.monitor_thread_ident = start_new_thread(self, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/lock_tests.py: from thread import start_new_thread, get_ident ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/lock_tests.py: from _thread import start_new_thread, get_ident ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test___monitor.py: self._orig_start_new_thread = monitor.start_new_thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test___monitor.py: monitor.start_new_thread = start_new_thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__core_async.py: gevent.spawn_later(0.1, thread.start_new_thread, watcher.send, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__monkey.py: self.assertIs(thread.start_new_thread, gthread.start_new_thread) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__monkey.py: self.assertIs(threading._start_new_thread, gthread.start_new_thread) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__refcount.py: from thread import start_new_thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__refcount.py: from _thread import start_new_thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__threading_2.py: thread.start_new_thread(f, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__threading_2.py: tid = thread.start_new_thread(f, (mutex,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__threading_2.py: thread.start_new_thread(waitingThread, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/threading.py: from gevent.thread import start_new_thread as _start_new_thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/threadpool.py: from gevent._threading import start_new_thread ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_socket.py: self.client_thread = thread.start_new_thread( ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: tid = _thread.start_new_thread(f, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: tid = _thread.start_new_thread(f, (mutex,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: _thread.start_new_thread(waitingThread, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: _thread.start_new_thread(background_thread, (evt,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: _thread.start_new_thread(import_threading, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_socket.py: self.client_thread = thread.start_new_thread( ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: tid = _thread.start_new_thread(f, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: tid = _thread.start_new_thread(f, (mutex,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: _thread.start_new_thread(waitingThread, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: _thread.start_new_thread(background_thread, (evt,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: th = _thread.start_new_thread(func, (join_lock,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: _thread.start_new_thread(import_threading, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_socket.py: self.client_thread = thread.start_new_thread( ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: tid = _thread.start_new_thread(f, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: tid = _thread.start_new_thread(f, (mutex,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: _thread.start_new_thread(waitingThread, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: _thread.start_new_thread(background_thread, (evt,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: th = _thread.start_new_thread(func, (join_lock,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: _thread.start_new_thread(import_threading, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: _thread.start_new_thread(f, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_socket.py: self.client_thread = thread.start_new_thread( ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: tid = _thread.start_new_thread(f, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: tid = _thread.start_new_thread(f, (mutex,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: _thread.start_new_thread(waitingThread, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: _thread.start_new_thread(background_thread, (evt,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_socket.py: self.client_thread = thread.start_new_thread( ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: tid = _thread.start_new_thread(f, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: tid = _thread.start_new_thread(f, (mutex,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: _thread.start_new_thread(waitingThread, ()) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: _thread.start_new_thread(background_thread, (evt,)) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: _thread.start_new_thread(import_threading, ()) ./faiss-cpu-1.7.4.tar.gz: faiss-cpu-1.7.4/faiss/contrib/rpc.py: tid = _thread.start_new_thread(ibs.exec_loop,()) ./execnet-2.0.2.tar.gz: execnet-2.0.2/src/execnet/gateway_base.py: return _thread.start_new_thread(func, args) ./execnet-2.0.2.tar.gz: execnet-2.0.2/testing/test_channel.py: _thread.start_new_thread(producer, (channel2,)) ./fastrlock-0.8.2.tar.gz: fastrlock-0.8.2/fastrlock/tests/test_rlock.py: from thread import start_new_thread, get_ident ./fastrlock-0.8.2.tar.gz: fastrlock-0.8.2/fastrlock/tests/test_rlock.py: from _thread import start_new_thread, get_ident ./ibm-watson-7.0.1.tar.gz: ibm-watson-7.0.1/ibm_watson/websocket/recognize_listener.py: thread.start_new_thread(run, ()) ./ibm-watson-7.0.1.tar.gz: ibm-watson-7.0.1/ibm_watson/websocket/synthesize_listener.py: thread.start_new_thread(run, ()) ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/deprecated/python/functools32/functools32/_dummy_thread32.py: """Dummy implementation of _thread.start_new_thread(). ./functools32-3.2.3-2.tar.gz: functools32-3.2.3-2/functools32/_dummy_thread32.py: """Dummy implementation of _thread.start_new_thread(). ./gsutil-5.27.tar.gz: gsutil-5.27/gslib/vendored/boto/tests/unit/utils/test_utils.py: _thread.start_new_thread(f, ()) ./guppy3-3.1.4.post1.tar.gz: guppy3-3.1.4.post1/guppy/heapy/test/test_Path.py: _thread.start_new_thread(task, (self,)) ./guppy3-3.1.4.post1.tar.gz: guppy3-3.1.4.post1/guppy/heapy/test/test_Path.py: _thread.start_new_thread(task, (self,)) ./guppy3-3.1.4.post1.tar.gz: guppy3-3.1.4.post1/guppy/heapy/test/test_Path.py: _thread.start_new_thread(task, ()) ./lupa-2.0.tar.gz: lupa-2.0/lupa/tests/test.py: from thread import start_new_thread, get_ident ./lupa-2.0.tar.gz: lupa-2.0/lupa/tests/test.py: from _thread import start_new_thread, get_ident ./mo-future-7.541.24038.tar.gz: mo-future-7.541.24038/mo_future/__init__.py: from _thread import allocate_lock, get_ident, start_new_thread, interrupt_main ./os_sys-2.1.4.tar.gz: os_sys-2.1.4/server/utils/autoreload.py: _thread.start_new_thread(main_func, args, kwargs) ./os_sys-2.1.4.tar.gz: os_sys-2.1.4/win32_extentions/win32pdhquery.py: _thread.start_new_thread(self.collectdatawhile_slave,(period,)) ./os_sys-2.1.4.tar.gz: os_sys-2.1.4/win32pdhquery.py: _thread.start_new_thread(self.collectdatawhile_slave,(period,)) ./multiprocess-0.70.16.tar.gz: multiprocess-0.70.16/pypy3.10/module/_multiprocess/test/test_interp_semaphore.py: from pypy.module.thread.os_thread import start_new_thread ./multiprocess-0.70.16.tar.gz: multiprocess-0.70.16/pypy3.8/module/_multiprocess/test/test_interp_semaphore.py: from pypy.module.thread.os_thread import start_new_thread ./multiprocess-0.70.16.tar.gz: multiprocess-0.70.16/pypy3.9/module/_multiprocess/test/test_interp_semaphore.py: from pypy.module.thread.os_thread import start_new_thread ./pylink-square-1.2.0.tar.gz: pylink-square-1.2.0/examples/pylink-rtt: thread.start_new_thread(read_rtt, (jlink,)) ./pylink-square-1.2.0.tar.gz: pylink-square-1.2.0/examples/pylink-rtt: thread.start_new_thread(write_rtt, (jlink,)) ./hug-2.6.1.tar.gz: hug-2.6.1/hug/development_runner.py: thread.start_new_thread(reload_checker, (interval,)) ./pymongo-4.6.2.tar.gz: pymongo-4.6.2/test/test_client.py: thread.start_new_thread(interrupter, ()) ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevconsole.py: start_new_thread = thread.start_new_thread ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevd_concurrency_analyser/pydevd_thread_wrappers.py: # mod.start_new_thread = wrapper(mod.start_new_thread) ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_is_thread_alive.py: # It is required to debug threads started by start_new_thread in Python 3.4 ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: _original_start_new_thread = thread_module._original_start_new_thread = thread_module.start_new_thread ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: We need to replace the original thread_module.start_new_thread with this function so that threads started ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: # This is a hack for the situation where the thread_module.start_new_thread is declared inside a class, such as the one below ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: # start_new_thread = thread_module.start_new_thread ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: # We need to replace the original thread_module.start_new_thread with this function so that threads started through ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: thread_module.start_new_thread = pydev_start_new_thread ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: Can be used to temporarily stop tracing threads created with thread.start_new_thread. ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: Can be used to start tracing threads created with thread.start_new_thread again. ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_bundle/pydev_monkey.py: return threading_module.start_new_thread ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel.py: thread.start_new_thread(self._reader_thread,(proc.stdout, sys.stdout)) ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydev_runfiles/pydev_runfiles_parallel.py: thread.start_new_thread(target=self._reader_thread,args=(proc.stderr, sys.stderr)) ./python-xlib-0.33.tar.gz: python-xlib-0.33/examples/threadtest.py: thread.start_new_thread(blink, (d, window, gc, (blue, red))) ./python-xlib-0.33.tar.gz: python-xlib-0.33/examples/xdamage.py: thread.start_new_thread(blink, (d, window1, gc, (blue, red))) ./pyscard-2.0.7.tar.gz: pyscard-2.0.7/smartcard/ReaderMonitoring.py: _thread.start_new_thread(self.rmthread.start, ()) ./pyscard-2.0.7.tar.gz: pyscard-2.0.7/smartcard/ReaderMonitoring.py: thread.start_new_thread(self.rmthread.start, ()) ./py-dateutil-2.2.tar.gz: py-dateutil-2.2/sandbox/scheduler.py: _thread.start_new_thread(self._loop, ()) ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/_pydev_saved_modules.py: import _thread as thread; verify_shadowed.check(thread, ['start_new_thread', 'start_new', 'allocate_lock']) ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_is_thread_alive.py: # It is required to debug threads started by start_new_thread in Python 3.4 ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: _original_start_new_thread = thread_module._original_start_new_thread = thread_module.start_new_thread ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: We need to replace the original thread_module.start_new_thread with this function so that threads started ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: # This is a hack for the situation where the thread_module.start_new_thread is declared inside a class, such as the one below ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: # start_new_thread = thread_module.start_new_thread ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: # We need to replace the original thread_module.start_new_thread with this function so that threads started through ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: thread_module.start_new_thread = pydev_start_new_thread ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: Can be used to temporarily stop tracing threads created with thread.start_new_thread. ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: Can be used to start tracing threads created with thread.start_new_thread again. ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/pydev_monkey.py: return threading_module.start_new_thread ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_runfiles/pydev_runfiles_parallel.py: thread.start_new_thread(self._reader_thread, (proc.stdout, sys.stdout)) ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_runfiles/pydev_runfiles_parallel.py: thread.start_new_thread(target=self._reader_thread, args=(proc.stderr, sys.stderr)) ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydevd_bundle/pydevd_concurrency_analyser/pydevd_thread_wrappers.py: # mod.start_new_thread = wrapper(mod.start_new_thread) ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydevd_bundle/pydevd_daemon_thread.py: # (i.e.: just using the `thread.start_new_thread` instead of `threading.Thread`) ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/pydevconsole.py: start_new_thread = thread.start_new_thread ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: _original_start_new_thread = thread_module._original_start_new_thread = thread_module.start_new_thread ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: We need to replace the original thread_module.start_new_thread with this function so that threads started ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: # This is a hack for the situation where the thread_module.start_new_thread is declared inside a class, such as the one below ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: # start_new_thread = thread_module.start_new_thread ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: # We need to replace the original thread_module.start_new_thread with this function so that threads started through ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: thread_module.start_new_thread = pydev_start_new_thread ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: Can be used to temporarily stop tracing threads created with thread.start_new_thread. ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: Can be used to start tracing threads created with thread.start_new_thread again. ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_monkey.py: return threading_module.start_new_thread ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_bundle/pydev_is_thread_alive.py: # It is required to debug threads started by start_new_thread in Python 3.4 ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_runfiles/pydev_runfiles_parallel.py: thread.start_new_thread(self._reader_thread,(proc.stdout, sys.stdout)) ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydev_runfiles/pydev_runfiles_parallel.py: thread.start_new_thread(target=self._reader_thread,args=(proc.stderr, sys.stderr)) ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevconsole.py: start_new_thread = thread.start_new_thread ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevd_concurrency_analyser/pydevd_thread_wrappers.py: # mod.start_new_thread = wrapper(mod.start_new_thread) ./spyne-2.14.0.tar.gz: spyne-2.14.0/spyne/test/interop/_test_soap_client_base.py: thread.start_new_thread(run_server, ()) ./spyne-2.14.0.tar.gz: spyne-2.14.0/spyne/test/interop/test_httprpc.py: thread.start_new_thread(run_server, ()) ./workflow-2.1.6.tar.gz: workflow-2.1.6/workflow/patterns/controlflow.py: thread.start_new_thread(new_eng.process, ([obj], )) ./wxPython-4.2.1.tar.gz: wxPython-4.2.1/wx/lib/agw/scrolledthumbnail.py: thread.start_new_thread(self.ThreadImage, (myfiles,)) ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/py2to3/util.py.bak: # _thread.start_new_thread(os_gui_popup_show2, (txt,)) #issues ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/py3/util.py: # _thread.start_new_thread(os_gui_popup_show2, (txt,)) #issues ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/util.py: # _thread.start_new_thread(os_gui_popup_show2, (txt,)) #issues ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/util.py.bak: # _thread.start_new_thread(os_gui_popup_show2, (txt,)) #issues ./utilmy-0.1.17078128.tar.gz: utilmy-0.1.17078128/utilmy/zzarchive/zzarchive/zutil.py: # _thread.start_new_thread(os_gui_popup_show2, (txt,)) #issues ./wxPython-4.2.1.tar.gz: wxPython-4.2.1/demo/Threads.py: _thread.start_new_thread(self.Run, ()) ./zope.testrunner-6.3.1.tar.gz: zope.testrunner-6.3.1/src/zope/testrunner/tests/test_threadsupport.py: from _thread import start_new_thread ./zope.testrunner-6.3.1.tar.gz: zope.testrunner-6.3.1/src/zope/testrunner/threadsupport.py: started with ``_thread.start_new_thread``. If it knows them, Time: 0:00:26.432677 Found 168 matching lines in 33 projects ```

thread.*\ballocate_lock\b: Found 134 matching lines in 34 projects

Details ```python ❯ python3 ~/github/misc/cpython/search_pypi_top.py -q . "thread.*\ballocate_lock\b" ./cffi-1.16.0.tar.gz: cffi-1.16.0/src/cffi/cparser.py: lock = _thread.allocate_lock() ./cffi-1.16.0.tar.gz: cffi-1.16.0/src/cffi/lock.py: from thread import allocate_lock ./cffi-1.16.0.tar.gz: cffi-1.16.0/src/cffi/lock.py: from dummy_thread import allocate_lock ./cffi-1.16.0.tar.gz: cffi-1.16.0/src/cffi/lock.py: from _thread import allocate_lock ./cffi-1.16.0.tar.gz: cffi-1.16.0/src/cffi/lock.py: from _dummy_thread import allocate_lock ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi0/test_verify.py: _lock = thread.allocate_lock() ./cffi-1.16.0.tar.gz: cffi-1.16.0/testing/cffi1/test_verify1.py: _lock = thread.allocate_lock() ./cftime-1.6.3.tar.gz: cftime-1.6.3/src/cftime/_strptime.py: from _thread import allocate_lock as _thread_allocate_lock ./Cheetah3-3.2.6.post1.tar.gz: Cheetah3-3.2.6.post1/Cheetah/ImportManager.py: self.rlock = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/pydevd.py: self._lock = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/pydevd.py: self._main_lock = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/pydevd.py: self._lock_running_thread_ids = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/pydevd.py: self._lock_create_fs_notify = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/pydevd.py: self._wait_for_threads_to_finish_called_lock = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/pydevd.py: self._disposed_lock = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/pydevd_tracing.py: proceed = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_constants.py: self._lock = thread.allocate_lock() ./debugpy-1.8.1.zip: debugpy-1.8.1/src/debugpy/_vendored/pydevd/_pydev_bundle/_pydev_saved_modules.py: import _thread as thread; verify_shadowed.check(thread, ['start_new_thread', 'start_new', 'allocate_lock']) ./CT3-3.3.3.tar.gz: CT3-3.3.3/.tox/py311/lib/python3.11/site-packages/Cheetah/ImportManager.py: self.rlock = thread.allocate_lock() ./CT3-3.3.3.tar.gz: CT3-3.3.3/.tox/py311-flake8/lib/python3.11/site-packages/Cheetah/ImportManager.py: self.rlock = thread.allocate_lock() ./CT3-3.3.3.tar.gz: CT3-3.3.3/Cheetah/ImportManager.py: self.rlock = thread.allocate_lock() ./astropy-6.0.0.tar.gz: astropy-6.0.0/astropy/extern/_strptime.py: from _thread import allocate_lock as _thread_allocate_lock ./astropy-6.0.0.tar.gz: astropy-6.0.0/astropy/extern/_strptime.py: from _dummy_thread import allocate_lock as _thread_allocate_lock ./eventlet-0.35.2.tar.gz: eventlet-0.35.2/eventlet/patcher.py: from eventlet.green.thread import allocate_lock ./eventlet-0.35.2.tar.gz: eventlet-0.35.2/eventlet/green/thread.py: __patched__ = ['get_ident', 'start_new_thread', 'start_new', 'allocate_lock', ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/_abstract_linkable.py: _allocate_thread_lock = __import__(thread_mod_name).allocate_lock ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/_threading.py: 'start_new_thread', 'allocate_lock', 'get_ident', ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__monkey_logging.py: checkLocks(type(gevent.thread.allocate_lock()), ignore_none=False) ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__thread.py: from gevent.thread import allocate_lock ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__thread.py: from _thread import allocate_lock as std_allocate_lock ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__thread.py: from thread import allocate_lock as std_allocate_lock ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__threading_2.py: from gevent.thread import allocate_lock as Lock ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__threading_2.py: ready = thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/tests/test__threading_vs_settrace.py: from gevent.thread import allocate_lock ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/gevent/threading.py: from gevent.thread import allocate_lock as _allocate_lock ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: ready = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.10/test_threading.py: event = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: ready = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: join_lock = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.11/test_threading.py: event = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: ready = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: join_lock = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.12/test_threading.py: event = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: ready = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.8/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: ready = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: started = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: finish = _thread.allocate_lock() ./gevent-24.2.1.tar.gz: gevent-24.2.1/src/greentest/3.9/test_threading.py: event = _thread.allocate_lock() ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/deprecated/python/functools32/functools32/_dummy_thread32.py: __all__ = ['error', 'start_new_thread', 'exit', 'get_ident', 'allocate_lock', ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/deprecated/python/functools32/functools32/_dummy_thread32.py: """Dummy implementation of _thread.allocate_lock().""" ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/deprecated/python/functools32/functools32/functools32.py: from thread import allocate_lock as Lock ./catboost-1.2.2.tar.gz: catboost-1.2.2/catboost_all_src/contrib/deprecated/python/functools32/functools32/functools32.py: from ._dummy_thread32 import allocate_lock as Lock ./functools32-3.2.3-2.tar.gz: functools32-3.2.3-2/functools32/_dummy_thread32.py: __all__ = ['error', 'start_new_thread', 'exit', 'get_ident', 'allocate_lock', ./functools32-3.2.3-2.tar.gz: functools32-3.2.3-2/functools32/_dummy_thread32.py: """Dummy implementation of _thread.allocate_lock().""" ./functools32-3.2.3-2.tar.gz: functools32-3.2.3-2/functools32/functools32.py: from thread import allocate_lock as Lock ./functools32-3.2.3-2.tar.gz: functools32-3.2.3-2/functools32/functools32.py: from ._dummy_thread32 import allocate_lock as Lock ./jplephem-2.21.tar.gz: jplephem-2.21/jplephem/daf.py: from _thread import allocate_lock ./jplephem-2.21.tar.gz: jplephem-2.21/jplephem/daf.py: from thread import allocate_lock ./guppy3-3.1.4.post1.tar.gz: guppy3-3.1.4.post1/guppy/heapy/Remote.py: self.closelock = _thread.allocate_lock() ./mo-future-7.541.24038.tar.gz: mo-future-7.541.24038/mo_future/__init__.py: from _thread import allocate_lock, get_ident, start_new_thread, interrupt_main ./LinkChecker-10.4.0.tar.gz: LinkChecker-10.4.0/linkcheck/decorators.py: @synchronized(thread.allocate_lock()) ./kazoo-2.10.0.tar.gz: kazoo-2.10.0/kazoo/handlers/gevent.py: return gevent.thread.allocate_lock() ./mpi4py-3.1.5.tar.gz: mpi4py-3.1.5/src/mpi4py/MPI/commimpl.pxi: from _thread import allocate_lock as Lock ./mpi4py-3.1.5.tar.gz: mpi4py-3.1.5/src/mpi4py/MPI/commimpl.pxi: from _dummy_thread import allocate_lock as Lock ./mpi4py-3.1.5.tar.gz: mpi4py-3.1.5/src/mpi4py/MPI/commimpl.pxi: from thread import allocate_lock as Lock ./mpi4py-3.1.5.tar.gz: mpi4py-3.1.5/src/mpi4py/MPI/commimpl.pxi: from dummy_thread import allocate_lock as Lock ./logging-0.4.9.6.tar.gz: logging-0.4.9.6/logging/__init__.py: self.lock = thread.allocate_lock() ./ppft-1.7.6.8.tar.gz: ppft-1.7.6.8/ppft/tests/callback.py: self.lock = thread.allocate_lock() ./pandas-2.2.0.tar.gz: pandas-2.2.0/pandas/_libs/tslibs/strptime.pyx: from _thread import allocate_lock as _thread_allocate_lock ./mypy-1.8.0.tar.gz: mypy-1.8.0/mypy/typeshed/stdlib/_dummy_thread.pyi: __all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "interrupt_main", "LockType", "RLock"] ./pysingleton-0.2.1.tar.gz: pysingleton-0.2.1/singleton/singleton.py: _lock = thread.allocate_lock() ./python-dateutil-2.8.2.tar.gz: python-dateutil-2.8.2/dateutil/rrule.py: self._cache_lock = _thread.allocate_lock() ./python-dateutil-2.8.2.tar.gz: python-dateutil-2.8.2/dateutil/tz/_factories.py: cls._cache_lock = _thread.allocate_lock() ./python-dateutil-2.8.2.tar.gz: python-dateutil-2.8.2/dateutil/tz/_factories.py: cls.__cache_lock = _thread.allocate_lock() ./python-dateutil-2.8.2.tar.gz: python-dateutil-2.8.2/dateutil/tz/tz.py: self._cache_lock = _thread.allocate_lock() ./python-dateutil-2.8.2.tar.gz: python-dateutil-2.8.2/dateutil/tz/tz.py: self._cache_lock = _thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevd.py: self._lock = thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevd.py: self._main_lock = thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevd.py: self._lock_running_thread_ids = thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevd.py: _set_trace_lock = thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevd_tracing.py: _lock = thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/pydevd_tracing.py: proceed = thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py: self.lock = thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_constants.py: _thread_id_lock = thread.allocate_lock() ./ptvsd-4.3.2.zip: ptvsd-4.3.2/src/ptvsd/_vendored/pydevd/_pydevd_bundle/pydevd_custom_frames.py: CustomFramesContainer.custom_frames_lock = thread.allocate_lock() ./python-xlib-0.33.tar.gz: python-xlib-0.33/Xlib/threaded.py: lock.allocate_lock = _thread.allocate_lock ./python3-xlib-0.15.tar.gz: python3-xlib-0.15/Xlib/threaded.py: lock.allocate_lock = thread.allocate_lock ./pytype-2024.2.13.tar.gz: pytype-2024.2.13/pytype/typeshed/stdlib/_dummy_thread.pyi: __all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "interrupt_main", "LockType", "RLock"] ./pytype-2024.2.13.tar.gz: pytype-2024.2.13/pytype/typeshed/stubs/cffi/cffi/lock.pyi: from _thread import allocate_lock as allocate_lock ./pyre-check-0.9.19.tar.gz: pyre-check-0.9.19/typeshed/stdlib/_dummy_thread.pyi: __all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "interrupt_main", "LockType", "RLock"] ./pyre-check-0.9.19.tar.gz: pyre-check-0.9.19/typeshed/stubs/cffi/cffi/lock.pyi: from _thread import allocate_lock as allocate_lock ./py-dateutil-2.2.tar.gz: py-dateutil-2.2/dateutil/rrule.py: self._cache_lock = _thread.allocate_lock() ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydev_bundle/_pydev_saved_modules.py: import _thread as thread; verify_shadowed.check(thread, ['start_new_thread', 'start_new', 'allocate_lock']) ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/_pydevd_bundle/pydevd_constants.py: self._lock = thread.allocate_lock() ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/pydevd.py: self._lock = thread.allocate_lock() ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/pydevd.py: self._main_lock = thread.allocate_lock() ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/pydevd.py: self._lock_running_thread_ids = thread.allocate_lock() ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/pydevd.py: self._lock_create_fs_notify = thread.allocate_lock() ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/pydevd.py: self._wait_for_threads_to_finish_called_lock = thread.allocate_lock() ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/pydevd.py: self._disposed_lock = thread.allocate_lock() ./pydevd-3.0.3.tar.gz: pydevd-3.0.3/pydevd_tracing.py: proceed = thread.allocate_lock() ./types-cffi-1.16.0.20240106.tar.gz: types-cffi-1.16.0.20240106/cffi-stubs/lock.pyi: from _thread import allocate_lock as allocate_lock ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevd.py: self._lock = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevd.py: self._lock = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevd.py: self._lock_running_thread_ids = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevd.py: _set_trace_lock = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevd_tracing.py: _lock = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/pydevd_tracing.py: proceed = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydevd_bundle/pydevd_comm.py: self.lock = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydevd_bundle/pydevd_constants.py: _thread_id_lock = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydevd_bundle/pydevd_custom_frames.py: CustomFramesContainer.custom_frames_lock = thread.allocate_lock() ./pydevd-pycharm-241.13688.16.tar.gz: pydevd-pycharm-241.13688.16/_pydevd_bundle/pydevd_vars.py: lock = thread.allocate_lock() ./workflow-2.1.6.tar.gz: workflow-2.1.6/workflow/patterns/controlflow.py: lock = thread.allocate_lock() ./typeshed_client-2.4.0.tar.gz: typeshed_client-2.4.0/typeshed_client/typeshed/_dummy_thread.pyi: __all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "interrupt_main", "LockType", "RLock"] ./webapp2-2.5.2.tar.gz: webapp2-2.5.2/webapp2_extras/local.py: from thread import get_ident as get_current_thread, allocate_lock ./webapp2-2.5.2.tar.gz: webapp2-2.5.2/webapp2_extras/local.py: from dummy_thread import get_ident as get_current_thread, allocate_lock Time: 0:00:27.042325 Found 134 matching lines in 34 projects ```
ericsnowcurrently commented 6 months ago

FWIW, there is precedent with the imp module. We deprecated it in 3.4 and removed it from the docs in 3.12.

gpshead commented 6 months ago

Wow, still a lot. Some of those uses are likely legacy easy py3 porting results. But otherwise they can be introspected to inform us of what people may need. Some of these things already have exact replacements via threading.

Randomly picking some to look at from the "start_new_thread" list... the code in pydevd is disturbing. Monkey patching, talking about hiding things from Python, etc. barf. Maybe they have reasons to given what it is, but for any of these regardless of prohect... how much is 2.7 legacy vs necessary?

I guess "documentation" is the closest we're going to get to "fixing" this in the short term.