From bb04fcf9a0e61d845c3d91be39ec1c7761dca468 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 13 Nov 2026 16:32:13 +0100 Subject: [PATCH 01/11] Run codemod --- stubs/Authlib/authlib/common/encoding.pyi | 7 +- stubs/Authlib/authlib/common/urls.pyi | 5 +- .../requests_client/oauth2_session.pyi | 5 +- stubs/Authlib/authlib/jose/rfc7515/jws.pyi | 3 +- stubs/Authlib/authlib/jose/rfc7516/jwe.pyi | 3 +- .../jose/rfc7517/_cryptography_key.pyi | 9 +- .../authlib/jose/rfc7517/asymmetric_key.pyi | 7 +- stubs/Authlib/authlib/jose/rfc7517/jwk.pyi | 3 +- .../Authlib/authlib/jose/rfc7518/jwe_algs.pyi | 3 +- stubs/Authlib/authlib/oauth1/rfc5849/util.pyi | 3 +- .../Authlib/authlib/oidc/core/grants/util.pyi | 3 +- stubs/Authlib/authlib/oidc/core/util.pyi | 3 +- .../flask_socketio/__init__.pyi | 5 +- stubs/JACK-Client/jack/__init__.pyi | 19 +- stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi | 15 +- stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi | 7 +- stubs/Markdown/markdown/core.pyi | 3 +- stubs/Markdown/markdown/util.pyi | 3 +- stubs/PyAutoGUI/pyautogui/__init__.pyi | 89 +++---- stubs/PyMeeus/pymeeus/Angle.pyi | 97 ++++---- stubs/PyMeeus/pymeeus/Coordinates.pyi | 91 ++++---- stubs/PyMeeus/pymeeus/CurveFitting.pyi | 13 +- stubs/PyMeeus/pymeeus/Earth.pyi | 37 +-- stubs/PyMeeus/pymeeus/Epoch.pyi | 67 +++--- stubs/PyMeeus/pymeeus/Interpolation.pyi | 23 +- stubs/PyMeeus/pymeeus/Jupiter.pyi | 13 +- stubs/PyMeeus/pymeeus/JupiterMoons.pyi | 47 ++-- stubs/PyMeeus/pymeeus/Mars.pyi | 13 +- stubs/PyMeeus/pymeeus/Mercury.pyi | 13 +- stubs/PyMeeus/pymeeus/Minor.pyi | 5 +- stubs/PyMeeus/pymeeus/Moon.pyi | 5 +- stubs/PyMeeus/pymeeus/Neptune.pyi | 13 +- stubs/PyMeeus/pymeeus/Pluto.pyi | 9 +- stubs/PyMeeus/pymeeus/Saturn.pyi | 13 +- stubs/PyMeeus/pymeeus/Uranus.pyi | 13 +- stubs/PyMeeus/pymeeus/Venus.pyi | 13 +- stubs/PyMeeus/pymeeus/base.pyi | 5 +- stubs/PyMySQL/pymysql/connections.pyi | 21 +- stubs/PyMySQL/pymysql/converters.pyi | 3 +- stubs/PyMySQL/pymysql/times.pyi | 7 +- stubs/PyScreeze/pyscreeze/__init__.pyi | 9 +- stubs/PySocks/socks.pyi | 3 +- stubs/PySocks/sockshandler.pyi | 7 +- stubs/PyYAML/yaml/constructor.pyi | 5 +- stubs/PyYAML/yaml/dumper.pyi | 3 +- stubs/PyYAML/yaml/representer.pyi | 5 +- stubs/Pygments/pygments/lexer.pyi | 3 +- stubs/RPi.GPIO/RPi/GPIO/__init__.pyi | 9 +- stubs/WTForms/wtforms/fields/numeric.pyi | 7 +- stubs/WTForms/wtforms/validators.pyi | 9 +- stubs/WTForms/wtforms/widgets/core.pyi | 13 +- stubs/WebOb/webob/acceptparse.pyi | 147 ++++++------ stubs/WebOb/webob/datetime_utils.pyi | 5 +- stubs/WebOb/webob/descriptors.pyi | 3 +- stubs/WebTest/webtest/http.pyi | 3 +- .../aws_xray_sdk/core/models/entity.pyi | 11 +- .../aws_xray_sdk/core/models/subsegment.pyi | 3 +- .../core/sampling/local/sampling_rule.pyi | 3 +- .../aws_xray_sdk/core/sampling/rule_cache.pyi | 3 +- stubs/boltons/boltons/cacheutils.pyi | 3 +- stubs/boltons/boltons/ecoutils.pyi | 3 +- stubs/boltons/boltons/iterutils.pyi | 9 +- stubs/boltons/boltons/jsonutils.pyi | 3 +- stubs/boltons/boltons/mathutils.pyi | 11 +- stubs/boltons/boltons/socketutils.pyi | 27 +-- stubs/boltons/boltons/statsutils.pyi | 25 +- stubs/capturer/capturer.pyi | 11 +- stubs/cffi/cffi/api.pyi | 3 +- stubs/cffi/cffi/backend_ctypes.pyi | 3 +- stubs/channels/channels/layers.pyi | 5 +- .../channels/channels/testing/application.pyi | 7 +- stubs/channels/channels/testing/http.pyi | 3 +- stubs/channels/channels/testing/websocket.pyi | 9 +- stubs/colorful/colorful/ansi.pyi | 3 +- .../console-menu/consolemenu/console_menu.pyi | 5 +- stubs/convertdate/convertdate/armenian.pyi | 3 +- stubs/convertdate/convertdate/bahai.pyi | 3 +- stubs/convertdate/convertdate/coptic.pyi | 3 +- stubs/convertdate/convertdate/daycount.pyi | 7 +- stubs/convertdate/convertdate/dublin.pyi | 3 +- .../convertdate/french_republican.pyi | 7 +- stubs/convertdate/convertdate/gregorian.pyi | 3 +- stubs/convertdate/convertdate/hebrew.pyi | 3 +- .../convertdate/convertdate/indian_civil.pyi | 3 +- stubs/convertdate/convertdate/islamic.pyi | 3 +- stubs/convertdate/convertdate/iso.pyi | 3 +- stubs/convertdate/convertdate/julian.pyi | 3 +- stubs/convertdate/convertdate/julianday.pyi | 7 +- stubs/convertdate/convertdate/mayan.pyi | 17 +- stubs/convertdate/convertdate/ordinal.pyi | 3 +- stubs/convertdate/convertdate/persian.pyi | 7 +- stubs/convertdate/convertdate/positivist.pyi | 3 +- stubs/convertdate/convertdate/utils.pyi | 25 +- stubs/croniter/croniter/croniter.pyi | 55 ++--- stubs/dateparser/dateparser/__init__.pyi | 3 +- stubs/dateparser/dateparser/conf.pyi | 3 +- .../custom_language_detection/fasttext.pyi | 3 +- .../custom_language_detection/langdetect.pyi | 3 +- stubs/dateparser/dateparser/date.pyi | 3 +- stubs/docker/docker/api/container.pyi | 17 +- stubs/docker/docker/models/containers.pyi | 19 +- stubs/docker/docker/transport/npipesocket.pyi | 3 +- stubs/docker/docker/types/services.pyi | 3 +- stubs/docker/docker/utils/utils.pyi | 3 +- stubs/docutils/docutils/nodes.pyi | 3 +- .../docutils/utils/math/latex2mathml.pyi | 5 +- stubs/docutils/docutils/writers/manpage.pyi | 7 +- .../docutils/writers/odf_odt/__init__.pyi | 3 +- stubs/ephem/ephem/__init__.pyi | 65 +++--- stubs/ephem/ephem/_libastro.pyi | 133 +++++------ stubs/flake8/flake8/formatting/base.pyi | 3 +- stubs/geojson/geojson/geometry.pyi | 5 +- stubs/geojson/geojson/utils.pyi | 3 +- stubs/geopandas/geopandas/array.pyi | 57 ++--- stubs/geopandas/geopandas/base.pyi | 83 +++---- stubs/geopandas/geopandas/explore.pyi | 13 +- stubs/geopandas/geopandas/geodataframe.pyi | 7 +- stubs/geopandas/geopandas/io/arrow.pyi | 3 +- stubs/geopandas/geopandas/plotting.pyi | 111 ++++----- stubs/geopandas/geopandas/sindex.pyi | 15 +- stubs/geopandas/geopandas/tools/make_grid.pyi | 5 +- stubs/geopandas/geopandas/tools/sjoin.pyi | 5 +- stubs/gevent/gevent/_config.pyi | 15 +- stubs/gevent/gevent/_ffi/loop.pyi | 7 +- stubs/gevent/gevent/_ffi/watcher.pyi | 5 +- stubs/gevent/gevent/_hub_primitives.pyi | 19 +- stubs/gevent/gevent/_monitor.pyi | 15 +- stubs/gevent/gevent/_types.pyi | 5 +- stubs/gevent/gevent/baseserver.pyi | 13 +- stubs/gevent/gevent/event.pyi | 9 +- stubs/gevent/gevent/events.pyi | 11 +- stubs/gevent/gevent/greenlet.pyi | 17 +- stubs/gevent/gevent/hub.pyi | 5 +- stubs/gevent/gevent/libev/corecext.pyi | 5 +- stubs/gevent/gevent/libev/corecffi.pyi | 7 +- stubs/gevent/gevent/libuv/loop.pyi | 5 +- stubs/gevent/gevent/libuv/watcher.pyi | 3 +- stubs/gevent/gevent/lock.pyi | 11 +- stubs/gevent/gevent/pool.pyi | 15 +- stubs/gevent/gevent/pywsgi.pyi | 5 +- stubs/gevent/gevent/queue.pyi | 13 +- stubs/gevent/gevent/resolver/ares.pyi | 5 +- stubs/gevent/gevent/resolver/cares.pyi | 3 +- stubs/gevent/gevent/select.pyi | 5 +- stubs/gevent/gevent/selectors.pyi | 3 +- stubs/gevent/gevent/timeout.pyi | 13 +- stubs/gevent/gevent/util.pyi | 5 +- .../google/cloud/ndb/global_cache.pyi | 9 +- .../google/cloud/ndb/model.pyi | 49 ++-- stubs/grpcio/grpc/__init__.pyi | 29 +-- stubs/grpcio/grpc/aio/__init__.pyi | 23 +- stubs/gunicorn/gunicorn/arbiter.pyi | 3 +- stubs/gunicorn/gunicorn/ctl/client.pyi | 5 +- stubs/gunicorn/gunicorn/ctl/handlers.pyi | 5 +- stubs/gunicorn/gunicorn/dirty/client.pyi | 17 +- stubs/gunicorn/gunicorn/dirty/errors.pyi | 5 +- stubs/gunicorn/gunicorn/dirty/stash.pyi | 5 +- stubs/gunicorn/gunicorn/dirty/tlv.pyi | 3 +- stubs/gunicorn/gunicorn/http/parser.pyi | 3 +- .../gunicorn/http2/async_connection.pyi | 3 +- stubs/gunicorn/gunicorn/http2/negotiation.pyi | 3 +- stubs/gunicorn/gunicorn/instrument/statsd.pyi | 11 +- stubs/gunicorn/gunicorn/util.pyi | 5 +- stubs/gunicorn/gunicorn/workers/gthread.pyi | 7 +- stubs/hdbcli/hdbcli/dbapi.pyi | 7 +- stubs/httplib2/httplib2/__init__.pyi | 11 +- stubs/httplib2/httplib2/decode.pyi | 3 +- stubs/httpretty/httpretty/core.pyi | 5 +- stubs/inifile/inifile.pyi | 3 +- stubs/jsonnet/_jsonnet.pyi | 5 +- .../kafka-python/kafka/admin/_partitions.pyi | 3 +- stubs/kafka-python/kafka/admin/_topics.pyi | 7 +- .../kafka/admin/_transactions.pyi | 5 +- stubs/kafka-python/kafka/consumer/group.pyi | 23 +- .../kafka/coordinator/heartbeat.pyi | 9 +- .../kafka/metrics/stats/percentiles.pyi | 3 +- .../kafka/metrics/stats/sensor.pyi | 3 +- .../kafka/metrics/stats/total.pyi | 3 +- stubs/kafka-python/kafka/net/connection.pyi | 5 +- stubs/kafka-python/kafka/net/transport.pyi | 5 +- stubs/kafka-python/kafka/producer/kafka.pyi | 7 +- .../kafka/producer/producer_batch.pyi | 9 +- .../kafka/producer/record_accumulator.pyi | 11 +- .../kafka/protocol/admin/client_quotas.pyi | 9 +- stubs/keyboard/keyboard/__init__.pyi | 13 +- stubs/keyboard/keyboard/_keyboard_event.pyi | 5 +- stubs/keyboard/keyboard/_mouse_event.pyi | 7 +- stubs/keyboard/keyboard/mouse.pyi | 7 +- stubs/ldap3/ldap3/utils/conv.pyi | 5 +- stubs/m3u8/m3u8/__init__.pyi | 3 +- stubs/m3u8/m3u8/httpclient.pyi | 5 +- stubs/m3u8/m3u8/model.pyi | 49 ++-- stubs/m3u8/m3u8/version_matching.pyi | 3 +- stubs/m3u8/m3u8/version_matching_rules.pyi | 5 +- stubs/mock/mock/mock.pyi | 7 +- stubs/mysqlclient/MySQLdb/times.pyi | 7 +- stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi | 7 +- .../algorithms/approximation/connectivity.pyi | 5 +- .../algorithms/approximation/kcomponents.pyi | 3 +- .../algorithms/approximation/maxcut.pyi | 3 +- .../approximation/traveling_salesman.pyi | 5 +- .../algorithms/bipartite/generators.pyi | 5 +- .../algorithms/bipartite/link_analysis.pyi | 11 +- .../centrality/current_flow_betweenness.pyi | 5 +- .../algorithms/centrality/dispersion.pyi | 7 +- .../algorithms/centrality/eigenvector.pyi | 5 +- .../networkx/algorithms/centrality/katz.pyi | 9 +- .../algorithms/centrality/laplacian.pyi | 3 +- .../networkx/networkx/algorithms/chordal.pyi | 3 +- .../networkx/algorithms/community/leiden.pyi | 5 +- .../networkx/algorithms/community/louvain.pyi | 9 +- .../networkx/algorithms/community/lukes.pyi | 3 +- .../algorithms/community/modularity_max.pyi | 5 +- .../networkx/algorithms/community/quality.pyi | 3 +- .../algorithms/connectivity/connectivity.pyi | 7 +- .../connectivity/edge_augmentation.pyi | 3 +- .../algorithms/flow/boykovkolmogorov.pyi | 3 +- .../networkx/algorithms/flow/dinitz_alg.pyi | 3 +- .../networkx/algorithms/flow/edmondskarp.pyi | 3 +- .../networkx/algorithms/flow/preflowpush.pyi | 3 +- .../flow/shortestaugmentingpath.pyi | 3 +- .../algorithms/isomorphism/matchhelpers.pyi | 7 +- .../networkx/algorithms/isomorphism/vf2pp.pyi | 7 +- .../algorithms/link_analysis/hits_alg.pyi | 5 +- .../algorithms/link_analysis/pagerank_alg.pyi | 17 +- .../networkx/algorithms/link_prediction.pyi | 3 +- .../algorithms/node_classification.pyi | 3 +- .../networkx/algorithms/planarity.pyi | 3 +- .../networkx/networkx/algorithms/richclub.pyi | 3 +- .../algorithms/shortest_paths/astar.pyi | 5 +- .../algorithms/shortest_paths/weighted.pyi | 21 +- .../networkx/algorithms/similarity.pyi | 29 +-- .../networkx/algorithms/sparsifiers.pyi | 3 +- .../networkx/algorithms/time_dependent.pyi | 3 +- .../networkx/algorithms/tree/branchings.pyi | 17 +- .../networkx/networkx/algorithms/tree/mst.pyi | 3 +- .../networkx/networkx/algorithms/vitality.pyi | 3 +- stubs/networkx/networkx/classes/graph.pyi | 3 +- stubs/networkx/networkx/convert.pyi | 3 +- stubs/networkx/networkx/convert_matrix.pyi | 9 +- stubs/networkx/networkx/drawing/layout.pyi | 67 +++--- stubs/networkx/networkx/drawing/nx_pylab.pyi | 135 +++++------ .../networkx/generators/community.pyi | 21 +- .../networkx/networkx/generators/directed.pyi | 15 +- .../networkx/generators/duplication.pyi | 5 +- stubs/networkx/networkx/generators/ego.pyi | 3 +- .../networkx/generators/expanders.pyi | 3 +- .../networkx/generators/geometric.pyi | 29 +-- .../generators/internet_as_graphs.pyi | 9 +- .../networkx/generators/intersection.pyi | 7 +- .../networkx/networkx/generators/lattice.pyi | 3 +- .../networkx/generators/random_graphs.pyi | 25 +- .../generators/spectral_graph_forge.pyi | 3 +- .../networkx/generators/time_series.pyi | 3 +- .../networkx/linalg/algebraicconnectivity.pyi | 9 +- .../networkx/linalg/bethehessianmatrix.pyi | 3 +- .../networkx/linalg/laplacianmatrix.pyi | 5 +- stubs/networkx/networkx/linalg/spectrum.pyi | 3 +- .../networkx/utils/random_sequence.pyi | 5 +- .../rfc6749/clients/service_application.pyi | 5 +- stubs/openpyxl/openpyxl/cell/__init__.pyi | 3 +- stubs/openpyxl/openpyxl/cell/cell.pyi | 3 +- stubs/openpyxl/openpyxl/chart/_3d.pyi | 5 +- stubs/openpyxl/openpyxl/chart/_chart.pyi | 5 +- stubs/openpyxl/openpyxl/chart/axis.pyi | 3 +- .../openpyxl/openpyxl/chart/bubble_chart.pyi | 3 +- stubs/openpyxl/openpyxl/chart/chartspace.pyi | 3 +- stubs/openpyxl/openpyxl/chart/descriptors.pyi | 9 +- stubs/openpyxl/openpyxl/chart/layout.pyi | 9 +- stubs/openpyxl/openpyxl/chart/marker.pyi | 3 +- stubs/openpyxl/openpyxl/chart/pie_chart.pyi | 9 +- stubs/openpyxl/openpyxl/descriptors/base.pyi | 65 +++--- stubs/openpyxl/openpyxl/descriptors/excel.pyi | 9 +- .../openpyxl/openpyxl/descriptors/nested.pyi | 33 +-- stubs/openpyxl/openpyxl/drawing/colors.pyi | 11 +- stubs/openpyxl/openpyxl/drawing/fill.pyi | 3 +- stubs/openpyxl/openpyxl/drawing/geometry.pyi | 3 +- stubs/openpyxl/openpyxl/drawing/line.pyi | 3 +- stubs/openpyxl/openpyxl/drawing/text.pyi | 5 +- stubs/openpyxl/openpyxl/styles/alignment.pyi | 7 +- stubs/openpyxl/openpyxl/styles/colors.pyi | 3 +- stubs/openpyxl/openpyxl/styles/fills.pyi | 3 +- stubs/openpyxl/openpyxl/styles/fonts.pyi | 3 +- stubs/openpyxl/openpyxl/utils/units.pyi | 9 +- stubs/openpyxl/openpyxl/worksheet/filters.pyi | 9 +- .../opentracing/mocktracer/span.pyi | 13 +- .../opentracing/mocktracer/tracer.pyi | 3 +- stubs/opentracing/opentracing/span.pyi | 7 +- stubs/opentracing/opentracing/tracer.pyi | 7 +- stubs/paramiko/paramiko/buffered_pipe.pyi | 3 +- stubs/paramiko/paramiko/channel.pyi | 5 +- stubs/paramiko/paramiko/client.pyi | 11 +- stubs/paramiko/paramiko/common.pyi | 3 +- stubs/paramiko/paramiko/packet.pyi | 7 +- stubs/paramiko/paramiko/proxy.pyi | 5 +- stubs/paramiko/paramiko/sftp_client.pyi | 3 +- stubs/paramiko/paramiko/sftp_file.pyi | 5 +- stubs/paramiko/paramiko/transport.pyi | 21 +- .../parsimonious/parsimonious/expressions.pyi | 5 +- stubs/peewee/peewee.pyi | 3 +- stubs/pexpect/pexpect/_async.pyi | 5 +- stubs/pexpect/pexpect/expect.pyi | 3 +- stubs/pexpect/pexpect/fdpexpect.pyi | 5 +- stubs/pexpect/pexpect/popen_spawn.pyi | 3 +- stubs/pexpect/pexpect/pty_spawn.pyi | 9 +- stubs/pexpect/pexpect/pxssh.pyi | 9 +- stubs/pexpect/pexpect/replwrap.pyi | 3 +- stubs/pexpect/pexpect/run.pyi | 5 +- stubs/pexpect/pexpect/socket_pexpect.pyi | 5 +- stubs/pexpect/pexpect/spawnbase.pyi | 29 +-- stubs/pexpect/pexpect/utils.pyi | 5 +- .../pika/pika/adapters/asyncio_connection.pyi | 3 +- .../pika/adapters/blocking_connection.pyi | 11 +- .../pika/pika/adapters/gevent_connection.pyi | 3 +- .../pika/pika/adapters/select_connection.pyi | 9 +- .../pika/adapters/utils/nbio_interface.pyi | 3 +- .../utils/selector_ioloop_adapter.pyi | 5 +- stubs/pika/pika/connection.pyi | 17 +- stubs/pika/pika/heartbeat.pyi | 3 +- stubs/pony/pony/options.pyi | 3 +- stubs/pony/pony/orm/dbapiprovider.pyi | 3 +- stubs/pony/pony/orm/dbproviders/sqlite.pyi | 5 +- stubs/pony/pony/utils/utils.pyi | 5 +- stubs/protobuf/google/protobuf/duration.pyi | 9 +- .../protobuf/internal/testing_refleaks.pyi | 3 +- .../protobuf/internal/type_checkers.pyi | 9 +- .../protobuf/internal/well_known_types.pyi | 3 +- .../google/protobuf/internal/wire_format.pyi | 5 +- stubs/protobuf/google/protobuf/timestamp.pyi | 9 +- stubs/psutil/psutil/__init__.pyi | 15 +- stubs/psutil/psutil/_common.pyi | 7 +- stubs/psutil/psutil/_ntuples.pyi | 85 +++---- stubs/psutil/psutil/_psaix.pyi | 13 +- stubs/psutil/psutil/_psbsd.pyi | 27 +-- stubs/psutil/psutil/_pslinux.pyi | 3 +- stubs/psutil/psutil/_psosx.pyi | 7 +- stubs/psutil/psutil/_psposix.pyi | 11 +- stubs/psutil/psutil/_pssunos.pyi | 21 +- stubs/psutil/psutil/_pswindows.pyi | 3 +- stubs/psycopg2/psycopg2/_psycopg.pyi | 13 +- stubs/psycopg2/psycopg2/extras.pyi | 3 +- stubs/psycopg2/psycopg2/tz.pyi | 5 +- stubs/pyaudio/pyaudio.pyi | 3 +- stubs/pycocotools/pycocotools/coco.pyi | 13 +- stubs/pycocotools/pycocotools/cocoeval.pyi | 7 +- stubs/pycocotools/pycocotools/mask.pyi | 5 +- stubs/pycups/cups.pyi | 7 +- stubs/pycurl/pycurl/_pycurl.pyi | 3 +- .../pyinstaller/PyInstaller/building/api.pyi | 3 +- stubs/pyinstaller/PyInstaller/compat.pyi | 3 +- stubs/pyluach/pyluach/dates.pyi | 15 +- stubs/pynput/pynput/_util.pyi | 5 +- stubs/pynput/pynput/keyboard/__init__.pyi | 3 +- stubs/pynput/pynput/mouse/__init__.pyi | 3 +- stubs/pyogrio/pyogrio/core.pyi | 5 +- stubs/pyogrio/pyogrio/geopandas.pyi | 5 +- stubs/pyogrio/pyogrio/raw.pyi | 11 +- stubs/pyserial/serial/__init__.pyi | 11 +- stubs/pyserial/serial/rfc2217.pyi | 3 +- stubs/pyserial/serial/rs485.pyi | 9 +- stubs/pyserial/serial/serialposix.pyi | 3 +- stubs/pyserial/serial/serialutil.pyi | 31 +-- .../serial/urlhandler/protocol_socket.pyi | 3 +- .../serial/urlhandler/protocol_spy.pyi | 5 +- stubs/python-dateutil/dateutil/tz/tz.pyi | 9 +- stubs/python-jenkins/jenkins/__init__.pyi | 3 +- stubs/python-xlib/Xlib/ext/nvcontrol.pyi | 3 +- stubs/python-xlib/Xlib/ext/randr.pyi | 3 +- stubs/python-xlib/Xlib/ext/xinput.pyi | 5 +- stubs/python-xlib/Xlib/protocol/rq.pyi | 3 +- stubs/python-xlib/Xlib/xobject/drawable.pyi | 3 +- stubs/pytz/pytz/reference.pyi | 5 +- stubs/pywin32/_win32typing.pyi | 3 +- stubs/pywin32/win32/win32api.pyi | 3 +- stubs/pywin32/win32/win32gui.pyi | 15 +- stubs/pyxdg/xdg/IconTheme.pyi | 5 +- stubs/qrbill/qrbill/bill.pyi | 13 +- .../qrcode/qrcode/image/styles/colormasks.pyi | 5 +- .../qrcode/image/styles/moduledrawers/pil.pyi | 19 +- .../qrcode/image/styles/moduledrawers/svg.pyi | 3 +- stubs/rasterio/rasterio/__init__.pyi | 7 +- stubs/rasterio/rasterio/_base.pyi | 13 +- stubs/rasterio/rasterio/_io.pyi | 23 +- stubs/rasterio/rasterio/_typing.pyi | 3 +- stubs/rasterio/rasterio/_warp.pyi | 37 +-- stubs/rasterio/rasterio/control.pyi | 33 +-- stubs/rasterio/rasterio/coords.pyi | 11 +- stubs/rasterio/rasterio/dtypes.pyi | 5 +- stubs/rasterio/rasterio/features.pyi | 17 +- stubs/rasterio/rasterio/fill.pyi | 3 +- stubs/rasterio/rasterio/io.pyi | 3 +- stubs/rasterio/rasterio/mask.pyi | 7 +- stubs/rasterio/rasterio/merge.pyi | 13 +- stubs/rasterio/rasterio/plot.pyi | 7 +- stubs/rasterio/rasterio/rpc.pyi | 65 +++--- stubs/rasterio/rasterio/sample.pyi | 5 +- stubs/rasterio/rasterio/stack.pyi | 7 +- stubs/rasterio/rasterio/transform.pyi | 39 ++-- stubs/rasterio/rasterio/warp.pyi | 25 +- stubs/rasterio/rasterio/windows.pyi | 31 +-- stubs/ratelimit/ratelimit/decorators.pyi | 3 +- stubs/ratelimit/ratelimit/exception.pyi | 5 +- stubs/regex/regex/_main.pyi | 93 ++++---- .../reportlab/graphics/barcode/code39.pyi | 5 +- .../reportlab/graphics/barcode/common.pyi | 17 +- .../reportlab/graphics/barcode/lto.pyi | 5 +- .../reportlab/graphics/charts/axes.pyi | 7 +- .../reportlab/graphics/charts/barcharts.pyi | 7 +- .../reportlab/graphics/charts/dotbox.pyi | 3 +- .../reportlab/graphics/charts/legends.pyi | 5 +- .../reportlab/graphics/charts/linecharts.pyi | 5 +- .../reportlab/graphics/charts/lineplots.pyi | 5 +- .../reportlab/graphics/charts/piecharts.pyi | 25 +- .../reportlab/graphics/charts/slidebox.pyi | 5 +- .../reportlab/graphics/charts/spider.pyi | 7 +- .../reportlab/graphics/charts/utils.pyi | 7 +- .../reportlab/graphics/charts/utils3d.pyi | 3 +- .../reportlab/graphics/renderPDF.pyi | 3 +- .../reportlab/reportlab/graphics/renderPM.pyi | 23 +- .../reportlab/reportlab/graphics/renderPS.pyi | 3 +- .../reportlab/graphics/renderSVG.pyi | 3 +- stubs/reportlab/reportlab/graphics/shapes.pyi | 217 +++++++++--------- .../reportlab/graphics/transform.pyi | 11 +- .../reportlab/graphics/widgetbase.pyi | 3 +- .../graphics/widgets/signsandsymbols.pyi | 5 +- .../reportlab/graphics/widgets/table.pyi | 7 +- stubs/reportlab/reportlab/lib/colors.pyi | 93 ++++---- stubs/reportlab/reportlab/lib/corp.pyi | 5 +- stubs/reportlab/reportlab/lib/geomutils.pyi | 3 +- stubs/reportlab/reportlab/lib/pagesizes.pyi | 95 ++++---- stubs/reportlab/reportlab/lib/rl_accel.pyi | 5 +- stubs/reportlab/reportlab/lib/styles.pyi | 105 ++++----- stubs/reportlab/reportlab/lib/testutils.pyi | 5 +- stubs/reportlab/reportlab/lib/textsplit.pyi | 5 +- stubs/reportlab/reportlab/lib/units.pyi | 9 +- stubs/reportlab/reportlab/lib/utils.pyi | 7 +- .../reportlab/reportlab/pdfbase/acroform.pyi | 5 +- stubs/reportlab/reportlab/pdfbase/pdfform.pyi | 17 +- .../reportlab/pdfbase/pdfmetrics.pyi | 11 +- stubs/reportlab/reportlab/pdfbase/ttfonts.pyi | 15 +- stubs/reportlab/reportlab/pdfgen/canvas.pyi | 127 +++++----- .../reportlab/reportlab/pdfgen/textobject.pyi | 45 ++-- .../reportlab/platypus/doctemplate.pyi | 39 ++-- .../reportlab/platypus/flowables.pyi | 149 ++++++------ stubs/reportlab/reportlab/platypus/frames.pyi | 33 +-- .../reportlab/reportlab/platypus/multicol.pyi | 15 +- stubs/reportlab/reportlab/platypus/para.pyi | 87 +++---- .../reportlab/platypus/paragraph.pyi | 7 +- .../reportlab/platypus/tableofcontents.pyi | 17 +- stubs/reportlab/reportlab/platypus/tables.pyi | 33 +-- .../reportlab/platypus/xpreformatted.pyi | 3 +- stubs/reportlab/reportlab/rl_config.pyi | 9 +- stubs/reportlab/reportlab/rl_settings.pyi | 7 +- stubs/requests/requests/adapters.pyi | 7 +- stubs/requests/requests/sessions.pyi | 3 +- stubs/resampy/resampy/core.pyi | 11 +- stubs/resampy/resampy/filters.pyi | 7 +- stubs/retry/retry/api.pyi | 17 +- stubs/scp/scp.pyi | 5 +- stubs/seaborn/seaborn/_core/moves.pyi | 13 +- stubs/seaborn/seaborn/_core/plot.pyi | 15 +- stubs/seaborn/seaborn/_core/properties.pyi | 11 +- stubs/seaborn/seaborn/_core/scales.pyi | 13 +- stubs/seaborn/seaborn/_core/typing.pyi | 5 +- stubs/seaborn/seaborn/_marks/base.pyi | 3 +- stubs/seaborn/seaborn/_stats/aggregation.pyi | 3 +- stubs/seaborn/seaborn/_stats/counting.pyi | 5 +- stubs/seaborn/seaborn/_stats/density.pyi | 5 +- stubs/seaborn/seaborn/_stats/order.pyi | 3 +- stubs/seaborn/seaborn/axisgrid.pyi | 135 +++++------ stubs/seaborn/seaborn/categorical.pyi | 69 +++--- stubs/seaborn/seaborn/distributions.pyi | 29 +-- stubs/seaborn/seaborn/external/husl.pyi | 73 +++--- stubs/seaborn/seaborn/external/kde.pyi | 3 +- stubs/seaborn/seaborn/matrix.pyi | 47 ++-- stubs/seaborn/seaborn/palettes.pyi | 57 ++--- stubs/seaborn/seaborn/rcmod.pyi | 11 +- stubs/seaborn/seaborn/regression.pyi | 17 +- stubs/seaborn/seaborn/relational.pyi | 9 +- stubs/seaborn/seaborn/utils.pyi | 13 +- stubs/setuptools/setuptools/msvc.pyi | 11 +- stubs/shapely/shapely/_coverage.pyi | 9 +- stubs/shapely/shapely/_geometry.pyi | 11 +- stubs/shapely/shapely/_ragged_array.pyi | 3 +- stubs/shapely/shapely/affinity.pyi | 13 +- .../shapely/shapely/algorithms/polylabel.pyi | 3 +- stubs/shapely/shapely/constructive.pyi | 141 ++++++------ stubs/shapely/shapely/coordinates.pyi | 5 +- stubs/shapely/shapely/creation.pyi | 95 ++++---- stubs/shapely/shapely/geometry/base.pyi | 59 ++--- stubs/shapely/shapely/geometry/geo.pyi | 3 +- stubs/shapely/shapely/geometry/linestring.pyi | 13 +- .../shapely/geometry/multilinestring.pyi | 3 +- stubs/shapely/shapely/geometry/multipoint.pyi | 3 +- .../shapely/shapely/geometry/multipolygon.pyi | 3 +- stubs/shapely/shapely/geometry/point.pyi | 9 +- stubs/shapely/shapely/geometry/polygon.pyi | 7 +- stubs/shapely/shapely/lib.pyi | 3 +- stubs/shapely/shapely/linear.pyi | 11 +- stubs/shapely/shapely/measurement.pyi | 17 +- stubs/shapely/shapely/ops.pyi | 27 +-- stubs/shapely/shapely/plotting.pyi | 13 +- stubs/shapely/shapely/predicates.pyi | 35 +-- stubs/shapely/shapely/set_operations.pyi | 47 ++-- stubs/shapely/shapely/strtree.pyi | 11 +- stubs/shapely/shapely/testing.pyi | 3 +- stubs/shapely/shapely/vectorized/__init__.pyi | 17 +- .../simple_websocket/aiows.pyi | 15 +- .../simple-websocket/simple_websocket/ws.pyi | 19 +- stubs/tensorflow/tensorflow/__init__.pyi | 17 +- stubs/tensorflow/tensorflow/_aliases.pyi | 7 +- .../tensorflow/feature_column/__init__.pyi | 11 +- .../tensorflow/keras/activations.pyi | 3 +- .../tensorflow/tensorflow/keras/callbacks.pyi | 15 +- .../tensorflow/keras/layers/__init__.pyi | 19 +- stubs/tensorflow/tensorflow/keras/losses.pyi | 15 +- stubs/tensorflow/tensorflow/keras/metrics.pyi | 13 +- stubs/tensorflow/tensorflow/keras/models.pyi | 11 +- .../keras/optimizers/legacy/__init__.pyi | 17 +- .../tensorflow/keras/optimizers/schedules.pyi | 31 +-- stubs/tensorflow/tensorflow/math.pyi | 13 +- stubs/tensorflow/tensorflow/nn.pyi | 11 +- .../feature_column/feature_column_v2.pyi | 17 +- .../sequence_feature_column.pyi | 5 +- stubs/tensorflow/tensorflow/random.pyi | 37 +-- stubs/tensorflow/tensorflow/summary.pyi | 3 +- stubs/tinycss2/tinycss2/ast.pyi | 13 +- stubs/tinycss2/tinycss2/color3.pyi | 9 +- stubs/tinycss2/tinycss2/color4.pyi | 7 +- stubs/tinycss2/tinycss2/color5.pyi | 5 +- stubs/tqdm/tqdm/_monitor.pyi | 5 +- stubs/tqdm/tqdm/asyncio.pyi | 121 +++++----- stubs/tqdm/tqdm/contrib/concurrent.pyi | 21 +- stubs/tqdm/tqdm/contrib/discord.pyi | 41 ++-- stubs/tqdm/tqdm/contrib/slack.pyi | 41 ++-- stubs/tqdm/tqdm/contrib/telegram.pyi | 41 ++-- stubs/tqdm/tqdm/gui.pyi | 41 ++-- stubs/tqdm/tqdm/notebook.pyi | 45 ++-- stubs/tqdm/tqdm/rich.pyi | 43 ++-- stubs/tqdm/tqdm/std.pyi | 153 ++++++------ stubs/tqdm/tqdm/tk.pyi | 41 ++-- stubs/ttkthemes/ttkthemes/_imgops.pyi | 3 +- stubs/ttkthemes/ttkthemes/_widget.pyi | 7 +- stubs/ttkthemes/ttkthemes/themed_tk.pyi | 33 +-- stubs/uWSGI/uwsgi.pyi | 3 +- stubs/vobject/vobject/icalendar.pyi | 3 +- stubs/vobject/vobject/vcard.pyi | 3 +- stubs/waitress/waitress/channel.pyi | 5 +- stubs/waitress/waitress/wasyncore.pyi | 7 +- .../workalendar/skyfield_astronomy.pyi | 9 +- stubs/wurlitzer/wurlitzer.pyi | 5 +- stubs/xlrd/xlrd/book.pyi | 5 +- stubs/xlrd/xlrd/formula.pyi | 5 +- stubs/xlrd/xlrd/sheet.pyi | 7 +- stubs/xlrd/xlrd/xldate.pyi | 5 +- stubs/xmldiff/xmldiff/diff.pyi | 5 +- stubs/xmldiff/xmldiff/diff_match_patch.pyi | 7 +- stubs/xmldiff/xmldiff/main.pyi | 3 +- stubs/yt-dlp/yt_dlp/compat/__init__.pyi | 3 +- stubs/yt-dlp/yt_dlp/downloader/common.pyi | 15 +- stubs/yt-dlp/yt_dlp/extractor/common.pyi | 9 +- stubs/yt-dlp/yt_dlp/jsinterp.pyi | 3 +- stubs/yt-dlp/yt_dlp/networking/_helper.pyi | 3 +- stubs/yt-dlp/yt_dlp/networking/common.pyi | 3 +- stubs/yt-dlp/yt_dlp/utils/_utils.pyi | 17 +- stubs/yt-dlp/yt_dlp/utils/progress.pyi | 13 +- stubs/zxcvbn/zxcvbn/__init__.pyi | 3 +- stubs/zxcvbn/zxcvbn/matching.pyi | 5 +- stubs/zxcvbn/zxcvbn/scoring.pyi | 7 +- stubs/zxcvbn/zxcvbn/time_estimates.pyi | 7 +- 570 files changed, 4368 insertions(+), 3798 deletions(-) diff --git a/stubs/Authlib/authlib/common/encoding.pyi b/stubs/Authlib/authlib/common/encoding.pyi index 42d8ffe8746f..b6dc13a226a1 100644 --- a/stubs/Authlib/authlib/common/encoding.pyi +++ b/stubs/Authlib/authlib/common/encoding.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ReadableBuffer from collections.abc import Iterable from typing import Any, SupportsBytes, SupportsIndex, overload @@ -6,7 +7,7 @@ from typing import Any, SupportsBytes, SupportsIndex, overload def to_bytes(x: None, charset: str = "utf-8", errors: str = "strict") -> None: ... @overload def to_bytes( - x: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, + x: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, charset: str = "utf-8", errors: str = "strict", ) -> bytes: ... @@ -21,8 +22,8 @@ def json_loads(s: str | bytes | bytearray) -> Any: ... # returns json.loads() def json_dumps(data: Any, ensure_ascii: bool = False) -> str: ... # data pass to json.dumps() def urlsafe_b64decode(s: bytes | bytearray) -> bytes: ... def urlsafe_b64encode(s: ReadableBuffer) -> bytes: ... -def base64_to_int(s: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer) -> int: ... +def base64_to_int(s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer) -> int: ... def int_to_base64(num: int) -> str: ... def json_b64encode( - text: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, + text: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, ) -> bytes: ... diff --git a/stubs/Authlib/authlib/common/urls.pyi b/stubs/Authlib/authlib/common/urls.pyi index c2f84345f51d..cb7339b8bd32 100644 --- a/stubs/Authlib/authlib/common/urls.pyi +++ b/stubs/Authlib/authlib/common/urls.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from re import Pattern from typing import Final, overload @@ -10,9 +11,9 @@ def url_encode(params: Iterable[tuple[str, str]]) -> str: ... def url_decode(query: str) -> list[tuple[str, str]]: ... def add_params_to_qs(query: str, params: Iterable[tuple[str, str]] | dict[str, str]) -> str: ... def add_params_to_uri(uri: str, params: Iterable[tuple[str, str]] | dict[str, str], fragment: bool = False) -> str: ... -def quote(s: str | bytes | float, safe: bytes = b"/") -> str: ... +def quote(s: str | bytes | FloatInt, safe: bytes = b"/") -> str: ... def unquote(s: str | bytes) -> str: ... -def quote_url(s: str | bytes | float) -> str: ... +def quote_url(s: str | bytes | FloatInt) -> str: ... @overload def extract_params(raw: None) -> None: ... diff --git a/stubs/Authlib/authlib/integrations/requests_client/oauth2_session.pyi b/stubs/Authlib/authlib/integrations/requests_client/oauth2_session.pyi index ca73c50a2e39..bb00a30c68e1 100644 --- a/stubs/Authlib/authlib/integrations/requests_client/oauth2_session.pyi +++ b/stubs/Authlib/authlib/integrations/requests_client/oauth2_session.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from http.cookiejar import CookieJar from typing import Any, ClassVar, TypeVar @@ -40,7 +41,7 @@ class OAuth2Session(OAuth2Client, Session): token_auth_class: ClassVar[type[OAuth2Auth]] oauth_error_class: ClassVar[type[OAuthError]] SESSION_REQUEST_PARAMS: ClassVar[tuple[str, ...]] - default_timeout: float | tuple[float | None, float | None] | None + default_timeout: FloatInt | tuple[FloatInt | None, FloatInt | None] | None def __init__( self, client_id: str | None = None, @@ -54,7 +55,7 @@ class OAuth2Session(OAuth2Client, Session): token_placement: str = ..., update_token: Callable[[OAuth2Token], None] | None = None, leeway: int = 60, - default_timeout: float | tuple[float | None, float | None] | None = None, + default_timeout: FloatInt | tuple[FloatInt | None, FloatInt | None] | None = None, **kwargs, ) -> None: ... def fetch_access_token(self, url: str | None = None, **kwargs) -> OAuth2Token: ... diff --git a/stubs/Authlib/authlib/jose/rfc7515/jws.pyi b/stubs/Authlib/authlib/jose/rfc7515/jws.pyi index 0de9cb372359..bb0b0671a915 100644 --- a/stubs/Authlib/authlib/jose/rfc7515/jws.pyi +++ b/stubs/Authlib/authlib/jose/rfc7515/jws.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer from collections.abc import Iterable from typing import SupportsBytes, SupportsIndex @@ -13,7 +14,7 @@ class JsonWebSignature: def register_algorithm(cls, algorithm: JWSAlgorithm) -> None: ... def serialize_compact(self, protected, payload, key) -> bytes: ... def deserialize_compact( - self, s: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, key, decode=None + self, s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, key, decode=None ) -> JWSObject: ... def serialize_json(self, header_obj, payload, key) -> dict[str, Incomplete]: ... def deserialize_json(self, obj, key, decode=None) -> JWSObject: ... diff --git a/stubs/Authlib/authlib/jose/rfc7516/jwe.pyi b/stubs/Authlib/authlib/jose/rfc7516/jwe.pyi index c0783698a279..4131deddbf98 100644 --- a/stubs/Authlib/authlib/jose/rfc7516/jwe.pyi +++ b/stubs/Authlib/authlib/jose/rfc7516/jwe.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer from collections import OrderedDict from collections.abc import Iterable @@ -18,7 +19,7 @@ class JsonWebEncryption: def serialize(self, header, payload, key, sender_key=None) -> OrderedDict[Incomplete, Incomplete] | bytes: ... def deserialize_compact( self, - s: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, + s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, key, decode=None, sender_key=None, diff --git a/stubs/Authlib/authlib/jose/rfc7517/_cryptography_key.pyi b/stubs/Authlib/authlib/jose/rfc7517/_cryptography_key.pyi index 86a5476b8963..0338cfa808d2 100644 --- a/stubs/Authlib/authlib/jose/rfc7517/_cryptography_key.pyi +++ b/stubs/Authlib/authlib/jose/rfc7517/_cryptography_key.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ReadableBuffer from collections.abc import Iterable from typing import Literal, SupportsBytes, SupportsIndex, overload @@ -7,28 +8,28 @@ from cryptography.hazmat.primitives.serialization.ssh import SSHPublicKeyTypes @overload # if ssh_type is None def load_pem_key( - raw: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, + raw: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, ssh_type: None = None, key_type: str | None = None, password: bytes | None = None, ) -> PublicKeyTypes | PrivateKeyTypes: ... @overload # if key_type == "public" def load_pem_key( - raw: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, + raw: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, ssh_type: ReadableBuffer | tuple[ReadableBuffer, ...] | None = None, key_type: Literal["public"] = ..., password: bytes | None = None, ) -> PublicKeyTypes: ... @overload # if key_type is not empty, but not "public" def load_pem_key( - raw: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, + raw: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, ssh_type: ReadableBuffer | tuple[ReadableBuffer, ...] | None = None, key_type: str = ..., password: bytes | None = None, ) -> PrivateKeyTypes: ... @overload # if ssh_type is not empty def load_pem_key( - raw: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, + raw: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, ssh_type: ReadableBuffer | tuple[ReadableBuffer, ...] = ..., key_type: str | None = None, password: bytes | None = None, diff --git a/stubs/Authlib/authlib/jose/rfc7517/asymmetric_key.pyi b/stubs/Authlib/authlib/jose/rfc7517/asymmetric_key.pyi index 1361ba23ac48..77ebc0da5d93 100644 --- a/stubs/Authlib/authlib/jose/rfc7517/asymmetric_key.pyi +++ b/stubs/Authlib/authlib/jose/rfc7517/asymmetric_key.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer from collections.abc import Iterable from typing import ClassVar, Literal, SupportsBytes, SupportsIndex @@ -31,17 +32,17 @@ class AsymmetricKey(Key): self, encoding: Literal["PEM", "DER"] | None = None, is_private: bool = False, - password: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | None = None, + password: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | None = None, ): ... def as_pem( self, is_private: bool = False, - password: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | None = None, + password: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | None = None, ): ... def as_der( self, is_private: bool = False, - password: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | None = None, + password: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | None = None, ): ... @classmethod def import_dict_key(cls, raw, options=None) -> Self: ... diff --git a/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi b/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi index 97ca89d0c872..10015204f725 100644 --- a/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi +++ b/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer from collections.abc import Collection, Iterable, Mapping from typing import SupportsBytes, SupportsIndex @@ -12,7 +13,7 @@ class JsonWebKey: def import_key( cls, raw: ( - str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | Mapping[str, object] + str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | Mapping[str, object] ), options: Mapping[str, object] | None = None, ) -> Key: ... diff --git a/stubs/Authlib/authlib/jose/rfc7518/jwe_algs.pyi b/stubs/Authlib/authlib/jose/rfc7518/jwe_algs.pyi index df9802481aa8..e5a2734b551f 100644 --- a/stubs/Authlib/authlib/jose/rfc7518/jwe_algs.pyi +++ b/stubs/Authlib/authlib/jose/rfc7518/jwe_algs.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer from collections.abc import Iterable from typing import ClassVar, Final, SupportsBytes, SupportsIndex @@ -67,7 +68,7 @@ class ECDHESAlgorithm(JWEAlgorithm): def unwrap(self, enc_alg, ek, headers, key) -> bytes: ... def u32be_len_input( - s: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, base64: bool = False + s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, base64: bool = False ) -> bytes: ... JWE_ALG_ALGORITHMS: Final[list[JWEAlgorithm]] diff --git a/stubs/Authlib/authlib/oauth1/rfc5849/util.pyi b/stubs/Authlib/authlib/oauth1/rfc5849/util.pyi index 9522d3075d45..929f9883b577 100644 --- a/stubs/Authlib/authlib/oauth1/rfc5849/util.pyi +++ b/stubs/Authlib/authlib/oauth1/rfc5849/util.pyi @@ -1,2 +1,3 @@ -def escape(s: str | bytes | float) -> str: ... +from _typeshed import FloatInt +def escape(s: str | bytes | FloatInt) -> str: ... def unescape(s: str | bytes) -> str: ... diff --git a/stubs/Authlib/authlib/oidc/core/grants/util.pyi b/stubs/Authlib/authlib/oidc/core/grants/util.pyi index fe07d01da6f3..eb0a932b7cdf 100644 --- a/stubs/Authlib/authlib/oidc/core/grants/util.pyi +++ b/stubs/Authlib/authlib/oidc/core/grants/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ReadableBuffer from collections.abc import Collection, Iterable from typing import Literal, SupportsBytes, SupportsIndex, overload @@ -19,7 +20,7 @@ def generate_id_token( auth_time: int | None = None, acr: str | None = None, amr: list[str] | None = None, - code: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | None = None, + code: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | None = None, kid: str | None = None, ) -> str: ... diff --git a/stubs/Authlib/authlib/oidc/core/util.pyi b/stubs/Authlib/authlib/oidc/core/util.pyi index 5c0a4bff37f6..0f526d400857 100644 --- a/stubs/Authlib/authlib/oidc/core/util.pyi +++ b/stubs/Authlib/authlib/oidc/core/util.pyi @@ -1,7 +1,8 @@ +from _typeshed import FloatInt from _typeshed import ReadableBuffer from collections.abc import Iterable from typing import SupportsBytes, SupportsIndex def create_half_hash( - s: str | bytes | float | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, alg: str + s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, alg: str ) -> bytes | None: ... diff --git a/stubs/Flask-SocketIO/flask_socketio/__init__.pyi b/stubs/Flask-SocketIO/flask_socketio/__init__.pyi index af770c766947..af20fae6d1da 100644 --- a/stubs/Flask-SocketIO/flask_socketio/__init__.pyi +++ b/stubs/Flask-SocketIO/flask_socketio/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable from logging import Logger @@ -35,8 +36,8 @@ class _SocketIOServerOptions(TypedDict, total=False): @type_check_only class _EngineIOServerConfig(TypedDict, total=False): async_mode: Literal["threading", "eventlet", "gevent", "gevent_uwsgi"] - ping_interval: float | tuple[float, float] # seconds - ping_timeout: float # seconds + ping_interval: FloatInt | tuple[FloatInt, FloatInt] # seconds + ping_timeout: FloatInt # seconds max_http_buffer_size: int allow_upgrades: bool http_compression: bool diff --git a/stubs/JACK-Client/jack/__init__.pyi b/stubs/JACK-Client/jack/__init__.pyi index 24f02d25d936..5d24fedede55 100644 --- a/stubs/JACK-Client/jack/__init__.pyi +++ b/stubs/JACK-Client/jack/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Unused from collections.abc import Callable, Generator, Iterable, Iterator, Sequence from typing import Any, Final, Literal, overload, type_check_only @@ -11,21 +12,21 @@ from _cffi_backend import _CDataBase # pyright has no error code for subclassing final @type_check_only class _JackPositionT(_CDataBase): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] # ty:ignore[subclass-of-final-class] # pyrefly: ignore [invalid-inheritance] - audio_frames_per_video_frame: float + audio_frames_per_video_frame: FloatInt bar: int - bar_start_tick: float + bar_start_tick: FloatInt bbt_offset: int beat: int - beat_type: float - beats_per_bar: float - beats_per_minute: float + beat_type: FloatInt + beats_per_bar: FloatInt + beats_per_minute: FloatInt frame: int frame_rate: int - frame_time: float - next_time: float + frame_time: FloatInt + next_time: FloatInt padding: _CDataBase # tick: int - ticks_per_beat: float + ticks_per_beat: FloatInt unique_1: int unique_2: int usecs: int @@ -153,7 +154,7 @@ class Client: self, callback: Callable[[Port, str, str], object] | None = None, only_available: bool = True ) -> None: ... def set_graph_order_callback(self, callback: Callable[[], object]) -> None: ... - def set_xrun_callback(self, callback: Callable[[float], object]) -> None: ... + def set_xrun_callback(self, callback: Callable[[FloatInt], object]) -> None: ... def set_sync_callback(self, callback: Callable[[int, _JackPositionT], object] | None) -> None: ... def release_timebase(self) -> None: ... def set_timebase_callback( diff --git a/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi b/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi index 902334cf2eb4..5af9affc5dd7 100644 --- a/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi +++ b/stubs/Jetson.GPIO/Jetson/GPIO/gpio.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Sequence from typing import Literal @@ -25,20 +26,20 @@ def add_event_detect( edge: Literal[31, 32, 33], callback: Callable[[int], None] | None = ..., bouncetime: int | None = ..., - polltime: float = 0.2, + polltime: FloatInt = 0.2, ) -> None: ... -def remove_event_detect(channel: int, timeout: float = 0.5) -> None: ... +def remove_event_detect(channel: int, timeout: FloatInt = 0.5) -> None: ... def event_detected(channel: int) -> bool: ... def add_event_callback(channel: int, callback: Callable[[int], None]) -> None: ... def wait_for_edge( - channel: int, edge: Literal[31, 32, 33], bouncetime: int | None = ..., timeout: float | None = ... + channel: int, edge: Literal[31, 32, 33], bouncetime: int | None = ..., timeout: FloatInt | None = ... ) -> int | None: ... def gpio_function(channel: int) -> Literal[-1, 0, 1]: ... class PWM: - def __init__(self, channel: int, frequency_hz: float) -> None: ... + def __init__(self, channel: int, frequency_hz: FloatInt) -> None: ... def __del__(self) -> None: ... - def start(self, duty_cycle_percent: float) -> None: ... - def ChangeFrequency(self, frequency_hz: float) -> None: ... - def ChangeDutyCycle(self, duty_cycle_percent: float) -> None: ... + def start(self, duty_cycle_percent: FloatInt) -> None: ... + def ChangeFrequency(self, frequency_hz: FloatInt) -> None: ... + def ChangeDutyCycle(self, duty_cycle_percent: FloatInt) -> None: ... def stop(self) -> None: ... diff --git a/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi b/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi index 8e470cba9ed5..34f95ce6f0f9 100644 --- a/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi +++ b/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import Any, Final, Literal @@ -7,11 +8,11 @@ FALLING_EDGE: Final = 2 BOTH_EDGE: Final = 3 def add_edge_detect( - chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, poll_time: float + chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, poll_time: FloatInt ) -> Literal[1, 2, 0]: ... -def remove_edge_detect(chip_name: str, channel: int, timeout: float = 0.3) -> None: ... +def remove_edge_detect(chip_name: str, channel: int, timeout: FloatInt = 0.3) -> None: ... def add_edge_callback(chip_name: str, channel: int, callback: Callable[[int], None]) -> None: ... def edge_event_detected(chip_name: str, channel: int) -> bool: ... def gpio_event_added(chip_name: str, channel: int) -> Any: ... -def blocking_wait_for_edge(chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, timeout: float) -> int: ... +def blocking_wait_for_edge(chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, timeout: FloatInt) -> int: ... def event_cleanup(chip_name: str, channel: int) -> None: ... diff --git a/stubs/Markdown/markdown/core.pyi b/stubs/Markdown/markdown/core.pyi index dedfceda5b66..f54749536b06 100644 --- a/stubs/Markdown/markdown/core.pyi +++ b/stubs/Markdown/markdown/core.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from codecs import _ReadableStream, _WritableStream from collections.abc import Callable, Mapping, Sequence from logging import Logger @@ -24,7 +25,7 @@ class Markdown: doc_tag: ClassVar[str] output_formats: ClassVar[dict[Literal["xhtml", "html"], Callable[[Element], str]]] - last_run: float + last_run: FloatInt tab_length: int ESCAPED_CHARS: list[str] block_level_elements: list[str] diff --git a/stubs/Markdown/markdown/util.pyi b/stubs/Markdown/markdown/util.pyi index 567d279a9fb5..2f4da95ef0d7 100644 --- a/stubs/Markdown/markdown/util.pyi +++ b/stubs/Markdown/markdown/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterator from importlib import metadata from re import Pattern @@ -67,5 +68,5 @@ class Registry(Generic[_T]): def __len__(self) -> int: ... def get_index_for_name(self, name: str) -> int: ... - def register(self, item: _T, name: str, priority: float) -> None: ... + def register(self, item: _T, name: str, priority: FloatInt) -> None: ... def deregister(self, name: str, strict: bool = True) -> None: ... diff --git a/stubs/PyAutoGUI/pyautogui/__init__.pyi b/stubs/PyAutoGUI/pyautogui/__init__.pyi index 17ac847943c7..a783554416db 100644 --- a/stubs/PyAutoGUI/pyautogui/__init__.pyi +++ b/stubs/PyAutoGUI/pyautogui/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import contextlib from _typeshed import ConvertibleToInt from collections.abc import Callable, Iterable, Sequence @@ -36,18 +37,18 @@ G_LOG_SCREENSHOTS_FILENAMES: list[str] # Implementation details QWERTY: Final[str] QWERTZ: Final[str] -MINIMUM_SLEEP: Final[float] +MINIMUM_SLEEP: Final[FloatInt] # These are meant to be overridable LOG_SCREENSHOTS: bool LOG_SCREENSHOTS_LIMIT: int | None # https://pyautogui.readthedocs.io/en/latest/index.html#fail-safes FAILSAFE: bool -PAUSE: float -DARWIN_CATCH_UP_TIME: float +PAUSE: FloatInt +DARWIN_CATCH_UP_TIME: FloatInt FAILSAFE_POINTS: list[tuple[int, int]] # https://pyautogui.readthedocs.io/en/latest/mouse.htmln#mouse-movement -MINIMUM_DURATION: float +MINIMUM_DURATION: FloatInt class PyAutoGUIException(Exception): ... class FailSafeException(PyAutoGUIException): ... @@ -66,8 +67,8 @@ class Size(NamedTuple): width: int height: int -def getPointOnLine(x1: float, y1: float, x2: float, y2: float, n: float) -> tuple[float, float]: ... -def linear(n: float) -> float: ... +def getPointOnLine(x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, n: FloatInt) -> tuple[float, float]: ... +def linear(n: FloatInt) -> float: ... def position(x: int | None = None, y: int | None = None) -> Point: ... def size() -> Size: ... @@ -79,8 +80,8 @@ def mouseDown( y: SupportsInt | None = None, # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` button: str = "primary", - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... @@ -89,8 +90,8 @@ def mouseUp( y: SupportsInt | None = None, # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` button: str = "primary", - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... @@ -98,79 +99,79 @@ def click( x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, clicks: SupportsIndex = 1, - interval: float = 0.0, + interval: FloatInt = 0.0, # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` button: str = "primary", - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... def leftClick( x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, - interval: float = 0.0, - duration: float = 0.0, - tween: Callable[[float], float] = ..., + interval: FloatInt = 0.0, + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... def rightClick( x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, - interval: float = 0.0, - duration: float = 0.0, - tween: Callable[[float], float] = ..., + interval: FloatInt = 0.0, + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... def middleClick( x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, - interval: float = 0.0, - duration: float = 0.0, - tween: Callable[[float], float] = ..., + interval: FloatInt = 0.0, + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... def doubleClick( x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, - interval: float = 0.0, + interval: FloatInt = 0.0, # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` button: str = "left", - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... def tripleClick( x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, - interval: float = 0.0, + interval: FloatInt = 0.0, # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` button: str = "left", - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... def scroll( - clicks: float, + clicks: FloatInt, x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... def hscroll( - clicks: float, + clicks: FloatInt, x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... def vscroll( - clicks: float, + clicks: FloatInt, x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, logScreenshot: bool | None = None, @@ -179,16 +180,16 @@ def vscroll( def moveTo( x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool = False, _pause: bool = True, ) -> None: ... def moveRel( xOffset: _NormalizeableXArg | None = None, yOffset: SupportsInt | None = None, - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., logScreenshot: bool = False, _pause: bool = True, ) -> None: ... @@ -198,8 +199,8 @@ move = moveRel def dragTo( x: _NormalizeableXArg | None = None, y: SupportsInt | None = None, - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` button: str = "primary", logScreenshot: bool | None = None, @@ -209,8 +210,8 @@ def dragTo( def dragRel( xOffset: _NormalizeableXArg | None = 0, yOffset: SupportsInt | None = 0, - duration: float = 0.0, - tween: Callable[[float], float] = ..., + duration: FloatInt = 0.0, + tween: Callable[[FloatInt], float] = ..., # Docstring says `button` can also be `int`, but `.lower()` is called unconditionally in `_normalizeButton()` button: str = "primary", logScreenshot: bool | None = None, @@ -226,7 +227,7 @@ def keyUp(key: str, logScreenshot: bool | None = None, _pause: bool = True) -> N def press( keys: str | Iterable[str], presses: SupportsIndex = 1, - interval: float = 0.0, + interval: FloatInt = 0.0, logScreenshot: bool | None = None, _pause: bool = True, ) -> None: ... @@ -234,18 +235,18 @@ def hold( keys: str | Iterable[str], logScreenshot: bool | None = None, _pause: bool = True ) -> contextlib._GeneratorContextManager[None]: ... def typewrite( - message: str | Sequence[str], interval: float = 0.0, logScreenshot: bool | None = None, _pause: bool = True + message: str | Sequence[str], interval: FloatInt = 0.0, logScreenshot: bool | None = None, _pause: bool = True ) -> None: ... write = typewrite -def hotkey(*args: str, logScreenshot: bool | None = None, interval: float = 0.0) -> None: ... +def hotkey(*args: str, logScreenshot: bool | None = None, interval: FloatInt = 0.0) -> None: ... shortcut = hotkey def failSafeCheck() -> None: ... -def displayMousePosition(xOffset: float = 0, yOffset: float = 0) -> None: ... -def sleep(seconds: float) -> None: ... +def displayMousePosition(xOffset: FloatInt = 0, yOffset: FloatInt = 0) -> None: ... +def sleep(seconds: FloatInt) -> None: ... def countdown(seconds: SupportsIndex) -> None: ... def run(commandStr: str, _ssCount: Sequence[int] | None = None) -> None: ... def printInfo(dontPrint: bool = False) -> str: ... diff --git a/stubs/PyMeeus/pymeeus/Angle.pyi b/stubs/PyMeeus/pymeeus/Angle.pyi index 5f65ee04f79b..ae7162da5138 100644 --- a/stubs/PyMeeus/pymeeus/Angle.pyi +++ b/stubs/PyMeeus/pymeeus/Angle.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import overload from typing_extensions import Self @@ -7,26 +8,26 @@ class Angle: @overload def __init__(self, a: Angle, /, *, ra: bool = False) -> None: ... @overload - def __init__(self, a: float, /, *, ra: bool = False, radians: bool = False) -> None: ... + def __init__(self, a: FloatInt, /, *, ra: bool = False, radians: bool = False) -> None: ... @overload - def __init__(self, a: list[float] | tuple[float, ...], /, *, ra: bool = False, radians: bool = False) -> None: ... + def __init__(self, a: list[FloatInt] | tuple[FloatInt, ...], /, *, ra: bool = False, radians: bool = False) -> None: ... @overload - def __init__(self, a1: float, a2: float, /, *, ra: bool = False) -> None: ... + def __init__(self, a1: FloatInt, a2: FloatInt, /, *, ra: bool = False) -> None: ... @overload - def __init__(self, a1: float, a2: float, a3: float, /, *, ra: bool = False) -> None: ... + def __init__(self, a1: FloatInt, a2: FloatInt, a3: FloatInt, /, *, ra: bool = False) -> None: ... @overload - def __init__(self, a1: float, a2: float, a3: float, a4: float, /, *, ra: bool = False) -> None: ... + def __init__(self, a1: FloatInt, a2: FloatInt, a3: FloatInt, a4: FloatInt, /, *, ra: bool = False) -> None: ... @staticmethod - def reduce_deg(deg: float | Angle) -> float: ... + def reduce_deg(deg: FloatInt | Angle) -> float: ... @staticmethod - def reduce_dms(degrees: float, minutes: float, seconds: float = 0.0) -> tuple[int, int, float, float]: ... + def reduce_dms(degrees: FloatInt, minutes: FloatInt, seconds: FloatInt = 0.0) -> tuple[int, int, float, float]: ... @staticmethod - def deg2dms(deg: float | Angle) -> tuple[int, int, float, float]: ... + def deg2dms(deg: FloatInt | Angle) -> tuple[int, int, float, float]: ... @staticmethod - def dms2deg(degrees: float, minutes: float, seconds: float = 0.0) -> float: ... + def dms2deg(degrees: FloatInt, minutes: FloatInt, seconds: FloatInt = 0.0) -> float: ... def get_tolerance(self) -> float: ... - def set_tolerance(self, tol: float) -> None: ... + def set_tolerance(self, tol: FloatInt) -> None: ... def __call__(self) -> float: ... @overload @@ -34,28 +35,28 @@ class Angle: @overload def set(self, a: Angle, /, *, ra: bool = False) -> None: ... @overload - def set(self, a: float, /, *, ra: bool = False, radians: bool = False) -> None: ... + def set(self, a: FloatInt, /, *, ra: bool = False, radians: bool = False) -> None: ... @overload - def set(self, a: list[float] | tuple[float, ...], /, *, ra: bool = False, radians: bool = False) -> None: ... + def set(self, a: list[FloatInt] | tuple[FloatInt, ...], /, *, ra: bool = False, radians: bool = False) -> None: ... @overload - def set(self, a1: float, a2: float, /, *, ra: bool = False) -> None: ... + def set(self, a1: FloatInt, a2: FloatInt, /, *, ra: bool = False) -> None: ... @overload - def set(self, a1: float, a2: float, a3: float, /, *, ra: bool = False) -> None: ... + def set(self, a1: FloatInt, a2: FloatInt, a3: FloatInt, /, *, ra: bool = False) -> None: ... @overload - def set(self, a1: float, a2: float, a3: float, a4: float, /, *, ra: bool = False) -> None: ... + def set(self, a1: FloatInt, a2: FloatInt, a3: FloatInt, a4: FloatInt, /, *, ra: bool = False) -> None: ... - def set_radians(self, rads: float) -> None: ... + def set_radians(self, rads: FloatInt) -> None: ... @overload def set_ra(self) -> None: ... @overload - def set_ra(self, a: float | Angle | list[float] | tuple[float, ...], /) -> None: ... + def set_ra(self, a: FloatInt | Angle | list[FloatInt] | tuple[FloatInt, ...], /) -> None: ... @overload - def set_ra(self, a1: float, a2: float, /) -> None: ... + def set_ra(self, a1: FloatInt, a2: FloatInt, /) -> None: ... @overload - def set_ra(self, a1: float, a2: float, a3: float, /) -> None: ... + def set_ra(self, a1: FloatInt, a2: FloatInt, a3: FloatInt, /) -> None: ... @overload - def set_ra(self, a1: float, a2: float, a3: float, a4: float, /) -> None: ... + def set_ra(self, a1: FloatInt, a2: FloatInt, a3: FloatInt, a4: FloatInt, /) -> None: ... def dms_str(self, fancy: bool | None = True, n_dec: int = -1) -> str: ... def get_ra(self) -> float: ... @@ -64,37 +65,37 @@ class Angle: def dms_tuple(self) -> tuple[int, int, float, float]: ... def ra_tuple(self) -> tuple[int, int, float, float]: ... def to_positive(self) -> Self: ... - def __eq__(self, b: float | Angle) -> bool: ... # type: ignore[override] - def __ne__(self, b: float | Angle) -> bool: ... # type: ignore[override] - def __lt__(self, b: float | Angle) -> bool: ... - def __ge__(self, b: float | Angle) -> bool: ... - def __gt__(self, b: float | Angle) -> bool: ... - def __le__(self, b: float | Angle) -> bool: ... + def __eq__(self, b: FloatInt | Angle) -> bool: ... # type: ignore[override] + def __ne__(self, b: FloatInt | Angle) -> bool: ... # type: ignore[override] + def __lt__(self, b: FloatInt | Angle) -> bool: ... + def __ge__(self, b: FloatInt | Angle) -> bool: ... + def __gt__(self, b: FloatInt | Angle) -> bool: ... + def __le__(self, b: FloatInt | Angle) -> bool: ... def __neg__(self) -> Angle: ... def __abs__(self) -> Angle: ... - def __mod__(self, b: float | Angle) -> Angle: ... - def __add__(self, b: float | Angle) -> Angle: ... - def __sub__(self, b: float | Angle) -> Angle: ... - def __mul__(self, b: float | Angle) -> Angle: ... - def __div__(self, b: float | Angle) -> Angle: ... - def __truediv__(self, b: float | Angle) -> Angle: ... - def __pow__(self, b: float | Angle) -> Angle: ... - def __imod__(self, b: float | Angle) -> Self: ... - def __iadd__(self, b: float | Angle) -> Self: ... - def __isub__(self, b: float | Angle) -> Self: ... - def __imul__(self, b: float | Angle) -> Self: ... - def __idiv__(self, b: float | Angle) -> Angle: ... - def __itruediv__(self, b: float | Angle) -> Self: ... - def __ipow__(self, b: float | Angle) -> Self: ... - def __rmod__(self, b: float | Angle) -> Angle: ... - def __radd__(self, b: float | Angle) -> Angle: ... - def __rsub__(self, b: float | Angle) -> Angle: ... - def __rmul__(self, b: float | Angle) -> Angle: ... - def __rdiv__(self, b: float | Angle) -> Angle: ... - def __rtruediv__(self, b: float | Angle) -> Angle: ... - def __rpow__(self, b: float | Angle) -> Angle: ... + def __mod__(self, b: FloatInt | Angle) -> Angle: ... + def __add__(self, b: FloatInt | Angle) -> Angle: ... + def __sub__(self, b: FloatInt | Angle) -> Angle: ... + def __mul__(self, b: FloatInt | Angle) -> Angle: ... + def __div__(self, b: FloatInt | Angle) -> Angle: ... + def __truediv__(self, b: FloatInt | Angle) -> Angle: ... + def __pow__(self, b: FloatInt | Angle) -> Angle: ... + def __imod__(self, b: FloatInt | Angle) -> Self: ... + def __iadd__(self, b: FloatInt | Angle) -> Self: ... + def __isub__(self, b: FloatInt | Angle) -> Self: ... + def __imul__(self, b: FloatInt | Angle) -> Self: ... + def __idiv__(self, b: FloatInt | Angle) -> Angle: ... + def __itruediv__(self, b: FloatInt | Angle) -> Self: ... + def __ipow__(self, b: FloatInt | Angle) -> Self: ... + def __rmod__(self, b: FloatInt | Angle) -> Angle: ... + def __radd__(self, b: FloatInt | Angle) -> Angle: ... + def __rsub__(self, b: FloatInt | Angle) -> Angle: ... + def __rmul__(self, b: FloatInt | Angle) -> Angle: ... + def __rdiv__(self, b: FloatInt | Angle) -> Angle: ... + def __rtruediv__(self, b: FloatInt | Angle) -> Angle: ... + def __rpow__(self, b: FloatInt | Angle) -> Angle: ... def __float__(self) -> float: ... def __int__(self) -> int: ... - def __round__(self, n: float = 0) -> Angle: ... + def __round__(self, n: FloatInt = 0) -> Angle: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/Coordinates.pyi b/stubs/PyMeeus/pymeeus/Coordinates.pyi index 05814b68c48f..775702319852 100644 --- a/stubs/PyMeeus/pymeeus/Coordinates.pyi +++ b/stubs/PyMeeus/pymeeus/Coordinates.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from typing import Final, overload @@ -5,63 +6,63 @@ from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch NUTATION_ARG_TABLE: Final[list[list[int]]] -NUTATION_SINE_COEF_TABLE: Final[list[list[float]]] -NUTATION_COSINE_COEF_TABLE: Final[list[list[float]]] +NUTATION_SINE_COEF_TABLE: Final[list[list[FloatInt]]] +NUTATION_COSINE_COEF_TABLE: Final[list[list[FloatInt]]] @overload def mean_obliquity( - a: Epoch | list[float] | tuple[float, ...] | datetime.date, + a: Epoch | list[FloatInt] | tuple[FloatInt, ...] | datetime.date, /, *, - leap_seconds: float = 0, + leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False, ) -> Angle: ... @overload def mean_obliquity( - year: int, month: int, day: int, /, *, leap_seconds: float = 0, local: bool = False, utc: bool = False + year: int, month: int, day: int, /, *, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False ) -> Angle: ... @overload def true_obliquity( - a: Epoch | list[float] | tuple[float, ...] | datetime.date, + a: Epoch | list[FloatInt] | tuple[FloatInt, ...] | datetime.date, /, *, - leap_seconds: float = 0, + leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False, ) -> Angle: ... @overload def true_obliquity( - year: int, month: int, day: int, /, *, leap_seconds: float = 0, local: bool = False, utc: bool = False + year: int, month: int, day: int, /, *, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False ) -> Angle: ... @overload def nutation_longitude( - a: Epoch | list[float] | tuple[float, ...] | datetime.date, + a: Epoch | list[FloatInt] | tuple[FloatInt, ...] | datetime.date, /, *, - leap_seconds: float = 0, + leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False, ) -> Angle: ... @overload def nutation_longitude( - year: int, month: int, day: int, /, *, leap_seconds: float = 0, local: bool = False, utc: bool = False + year: int, month: int, day: int, /, *, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False ) -> Angle: ... @overload def nutation_obliquity( - a: Epoch | list[float] | tuple[float, ...] | datetime.date, + a: Epoch | list[FloatInt] | tuple[FloatInt, ...] | datetime.date, /, *, - leap_seconds: float = 0, + leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False, ) -> Angle: ... @overload def nutation_obliquity( - year: int, month: int, day: int, /, *, leap_seconds: float = 0, local: bool = False, utc: bool = False + year: int, month: int, day: int, /, *, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False ) -> Angle: ... def precession_equatorial( @@ -69,16 +70,16 @@ def precession_equatorial( final_epoch: Epoch, start_ra: Angle, start_dec: Angle, - p_motion_ra: float | Angle = 0.0, - p_motion_dec: float | Angle = 0.0, + p_motion_ra: FloatInt | Angle = 0.0, + p_motion_dec: FloatInt | Angle = 0.0, ) -> tuple[Angle, Angle]: ... def precession_ecliptical( start_epoch: Epoch, final_epoch: Epoch, start_lon: Angle, start_lat: Angle, - p_motion_lon: float | Angle = 0.0, - p_motion_lat: float | Angle = 0.0, + p_motion_lon: FloatInt | Angle = 0.0, + p_motion_lat: FloatInt | Angle = 0.0, ) -> tuple[Angle, Angle]: ... def p_motion_equa2eclip( p_motion_ra: Angle, p_motion_dec: Angle, ra: Angle, dec: Angle, lat: Angle, epsilon: Angle @@ -88,17 +89,17 @@ def precession_newcomb( final_epoch: Epoch, start_ra: Angle, start_dec: Angle, - p_motion_ra: float | Angle = 0.0, - p_motion_dec: float | Angle = 0.0, + p_motion_ra: FloatInt | Angle = 0.0, + p_motion_dec: FloatInt | Angle = 0.0, ) -> tuple[Angle, Angle]: ... def motion_in_space( start_ra: Angle, start_dec: Angle, - distance: float, - velocity: float, - p_motion_ra: float | Angle, - p_motion_dec: float | Angle, - time: float, + distance: FloatInt, + velocity: FloatInt, + p_motion_ra: FloatInt | Angle, + p_motion_dec: FloatInt | Angle, + time: FloatInt, ) -> tuple[Angle, Angle]: ... def equatorial2ecliptical(right_ascension: Angle, declination: Angle, obliquity: Angle) -> tuple[Angle, Angle]: ... def ecliptical2equatorial(longitude: Angle, latitude: Angle, obliquity: Angle) -> tuple[Angle, Angle]: ... @@ -120,11 +121,11 @@ def times_rise_transit_set( alpha3: Angle, delta3: Angle, h0: Angle, - delta_t: float, + delta_t: FloatInt, theta0: Angle, ) -> tuple[float, float, float] | tuple[None, None, None]: ... -def refraction_apparent2true(apparent_elevation: Angle, pressure: float = 1010.0, temperature: float = 10.0) -> Angle: ... -def refraction_true2apparent(true_elevation: Angle, pressure: float = 1010.0, temperature: float = 10.0) -> Angle: ... +def refraction_apparent2true(apparent_elevation: Angle, pressure: FloatInt = 1010.0, temperature: FloatInt = 10.0) -> Angle: ... +def refraction_true2apparent(true_elevation: Angle, pressure: FloatInt = 1010.0, temperature: FloatInt = 10.0) -> Angle: ... def angular_separation(alpha1: Angle, delta1: Angle, alpha2: Angle, delta2: Angle) -> Angle: ... def minimum_angular_separation( alpha1_1: Angle, @@ -163,34 +164,34 @@ def straight_line( ) -> tuple[Angle, Angle]: ... def circle_diameter(alpha1: Angle, delta1: Angle, alpha2: Angle, delta2: Angle, alpha3: Angle, delta3: Angle) -> Angle: ... def vsop_pos( - epoch: Epoch, vsop_l: list[list[list[float]]], vsop_b: list[list[list[float]]], vsop_r: list[list[list[float]]] + epoch: Epoch, vsop_l: list[list[list[FloatInt]]], vsop_b: list[list[list[FloatInt]]], vsop_r: list[list[list[FloatInt]]] ) -> tuple[Angle, Angle, float]: ... def geometric_vsop_pos( epoch: Epoch, - vsop_l: list[list[list[float]]], - vsop_b: list[list[list[float]]], - vsop_r: list[list[list[float]]], + vsop_l: list[list[list[FloatInt]]], + vsop_b: list[list[list[FloatInt]]], + vsop_r: list[list[list[FloatInt]]], tofk5: bool | None = True, ) -> tuple[Angle, Angle, float]: ... def apparent_vsop_pos( epoch: Epoch, - vsop_l: list[list[list[float]]], - vsop_b: list[list[list[float]]], - vsop_r: list[list[list[float]]], + vsop_l: list[list[list[FloatInt]]], + vsop_b: list[list[list[FloatInt]]], + vsop_r: list[list[list[FloatInt]]], nutation: bool | None = True, ) -> tuple[Angle, Angle, float]: ... def apparent_position(epoch: Epoch, alpha: Angle, delta: Angle, sun_lon: Angle) -> tuple[Angle, Angle]: ... def orbital_equinox2equinox(epoch0: Epoch, epoch: Epoch, i0: Angle, arg0: Angle, lon0: Angle) -> tuple[Angle, Angle, Angle]: ... -def kepler_equation(eccentricity: float, mean_anomaly: Angle) -> tuple[Angle, Angle]: ... +def kepler_equation(eccentricity: FloatInt, mean_anomaly: Angle) -> tuple[Angle, Angle]: ... def orbital_elements( - epoch: Epoch, parameters1: list[list[float]], parameters2: list[list[float]] + epoch: Epoch, parameters1: list[list[FloatInt]], parameters2: list[list[FloatInt]] ) -> tuple[Angle, float, float, Angle, Angle, Angle]: ... -def velocity(r: float, a: float) -> float: ... -def velocity_perihelion(e: float, a: float) -> float: ... -def velocity_aphelion(e: float, a: float) -> float: ... -def length_orbit(e: float, a: float) -> float: ... -def passage_nodes_elliptic(omega: Angle, e: float, a: float, t: Epoch, ascending: bool | None = True) -> tuple[Epoch, float]: ... -def passage_nodes_parabolic(omega: Angle, q: float, t: Epoch, ascending: bool | None = True) -> tuple[Epoch, float]: ... -def phase_angle(sun_dist: float, earth_dist: float, sun_earth_dist: float) -> Angle: ... -def illuminated_fraction(sun_dist: float, earth_dist: float, sun_earth_dist: float) -> float: ... +def velocity(r: FloatInt, a: FloatInt) -> float: ... +def velocity_perihelion(e: FloatInt, a: FloatInt) -> float: ... +def velocity_aphelion(e: FloatInt, a: FloatInt) -> float: ... +def length_orbit(e: FloatInt, a: FloatInt) -> float: ... +def passage_nodes_elliptic(omega: Angle, e: FloatInt, a: FloatInt, t: Epoch, ascending: bool | None = True) -> tuple[Epoch, float]: ... +def passage_nodes_parabolic(omega: Angle, q: FloatInt, t: Epoch, ascending: bool | None = True) -> tuple[Epoch, float]: ... +def phase_angle(sun_dist: FloatInt, earth_dist: FloatInt, sun_earth_dist: FloatInt) -> Angle: ... +def illuminated_fraction(sun_dist: FloatInt, earth_dist: FloatInt, sun_earth_dist: FloatInt) -> float: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/CurveFitting.pyi b/stubs/PyMeeus/pymeeus/CurveFitting.pyi index 00ba40a02d7f..fb886229a3e9 100644 --- a/stubs/PyMeeus/pymeeus/CurveFitting.pyi +++ b/stubs/PyMeeus/pymeeus/CurveFitting.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import overload @@ -9,14 +10,14 @@ class CurveFitting: @overload def __init__(self, a: CurveFitting, /) -> None: ... @overload - def __init__(self, a: list[float | Angle] | tuple[float | Angle, ...], /) -> None: ... + def __init__(self, a: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], /) -> None: ... @overload def __init__( - self, a1: list[float | Angle] | tuple[float | Angle, ...], a2: list[float | Angle] | tuple[float | Angle, ...], / + self, a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], / ) -> None: ... @overload def __init__( - self, a1: float | Angle, a2: float | Angle, a3: float | Angle, a4: float | Angle, /, *rest: float | Angle + self, a1: FloatInt | Angle, a2: FloatInt | Angle, a3: FloatInt | Angle, a4: FloatInt | Angle, /, *rest: FloatInt | Angle ) -> None: ... @overload @@ -24,14 +25,14 @@ class CurveFitting: @overload def set(self, a: CurveFitting, /) -> None: ... @overload - def set(self, a: list[float | Angle] | tuple[float | Angle, ...], /) -> None: ... + def set(self, a: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], /) -> None: ... @overload def set( - self, a1: list[float | Angle] | tuple[float | Angle, ...], a2: list[float | Angle] | tuple[float | Angle, ...], / + self, a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], / ) -> None: ... @overload def set( - self, a1: float | Angle, a2: float | Angle, a3: float | Angle, a4: float | Angle, /, *rest: float | Angle + self, a1: FloatInt | Angle, a2: FloatInt | Angle, a3: FloatInt | Angle, a4: FloatInt | Angle, /, *rest: FloatInt | Angle ) -> None: ... def __len__(self) -> int: ... diff --git a/stubs/PyMeeus/pymeeus/Earth.pyi b/stubs/PyMeeus/pymeeus/Earth.pyi index 764b459f3836..80cf0e3b432c 100644 --- a/stubs/PyMeeus/pymeeus/Earth.pyi +++ b/stubs/PyMeeus/pymeeus/Earth.pyi @@ -1,18 +1,19 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -VSOP87_L: Final[list[list[list[float]]]] -VSOP87_B: Final[list[list[list[float]]]] -VSOP87_R: Final[list[list[list[float]]]] -VSOP87_L_J2000: Final[list[list[list[float]]]] -VSOP87_B_J2000: Final[list[list[list[float]]]] -ORBITAL_ELEM: Final[list[list[float]]] -ORBITAL_ELEM_J2000: Final[list[list[float]]] +VSOP87_L: Final[list[list[list[FloatInt]]]] +VSOP87_B: Final[list[list[list[FloatInt]]]] +VSOP87_R: Final[list[list[list[FloatInt]]]] +VSOP87_L_J2000: Final[list[list[list[FloatInt]]]] +VSOP87_B_J2000: Final[list[list[list[FloatInt]]]] +ORBITAL_ELEM: Final[list[list[FloatInt]]] +ORBITAL_ELEM_J2000: Final[list[list[FloatInt]]] class Ellipsoid: - def __init__(self, a: float, f: float, omega: float) -> None: ... + def __init__(self, a: FloatInt, f: FloatInt, omega: FloatInt) -> None: ... def b(self) -> float: ... def e(self) -> float: ... @@ -22,14 +23,14 @@ WGS84: Final[Ellipsoid] class Earth: def __init__(self, ellipsoid: Ellipsoid = ...) -> None: ... def set(self, ellipsoid: Ellipsoid) -> None: ... - def rho(self, latitude: float | Angle) -> float: ... - def rho_sinphi(self, latitude: float | Angle, height: float) -> float: ... - def rho_cosphi(self, latitude: float | Angle, height: float) -> float: ... - def rp(self, latitude: float | Angle) -> float: ... - def linear_velocity(self, latitude: float | Angle) -> float: ... - def rm(self, latitude: float | Angle) -> float: ... + def rho(self, latitude: FloatInt | Angle) -> float: ... + def rho_sinphi(self, latitude: FloatInt | Angle, height: FloatInt) -> float: ... + def rho_cosphi(self, latitude: FloatInt | Angle, height: FloatInt) -> float: ... + def rp(self, latitude: FloatInt | Angle) -> float: ... + def linear_velocity(self, latitude: FloatInt | Angle) -> float: ... + def rm(self, latitude: FloatInt | Angle) -> float: ... def distance( - self, lon1: float | Angle, lat1: float | Angle, lon2: float | Angle, lat2: float | Angle + self, lon1: FloatInt | Angle, lat1: FloatInt | Angle, lon2: FloatInt | Angle, lat2: FloatInt | Angle ) -> tuple[float, float]: ... @staticmethod def geometric_heliocentric_position(epoch: Epoch, tofk5: bool = True) -> tuple[Angle, Angle, float]: ... @@ -47,7 +48,7 @@ class Earth: def passage_nodes(epoch: Epoch, ascending: bool = True) -> tuple[Epoch, float]: ... @staticmethod def parallax_correction( - right_ascension: Angle, declination: Angle, latitude: Angle, distance: float, hour_angle: Angle, height: float = 0.0 + right_ascension: Angle, declination: Angle, latitude: Angle, distance: FloatInt, hour_angle: Angle, height: FloatInt = 0.0 ) -> tuple[Angle, Angle]: ... @staticmethod def parallax_ecliptical( @@ -57,8 +58,8 @@ class Earth: obs_lat: Angle, obliquity: Angle, sidereal_time: Angle, - distance: float, - height: float = 0.0, + distance: FloatInt, + height: FloatInt = 0.0, ) -> tuple[Angle, Angle, Angle]: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/Epoch.pyi b/stubs/PyMeeus/pymeeus/Epoch.pyi index 22dce2c398dc..6e481ace54d1 100644 --- a/stubs/PyMeeus/pymeeus/Epoch.pyi +++ b/stubs/PyMeeus/pymeeus/Epoch.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from typing import Final, Literal, overload from typing_extensions import Self @@ -7,22 +8,22 @@ from pymeeus.Angle import Angle DAY2SEC: Final = 86400.0 DAY2MIN: Final = 1440.0 DAY2HOURS: Final = 24.0 -LEAP_TABLE: Final[dict[float, int]] +LEAP_TABLE: Final[dict[FloatInt, int]] class Epoch: @overload def __init__(self) -> None: ... @overload def __init__( - self, year: int, month: int, day: int, /, *time: float, leap_seconds: float = 0, local: bool = False, utc: bool = False + self, year: int, month: int, day: int, /, *time: FloatInt, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False ) -> None: ... @overload def __init__( self, - a: float | Epoch | list[float] | tuple[float, ...] | datetime.date, + a: FloatInt | Epoch | list[FloatInt] | tuple[FloatInt, ...] | datetime.date, /, *, - leap_seconds: float = 0, + leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False, ) -> None: ... @@ -33,15 +34,15 @@ class Epoch: def set(self) -> None: ... @overload def set( - self, year: int, month: int, day: int, /, *time: float, leap_seconds: float = 0, local: bool = False, utc: bool = False + self, year: int, month: int, day: int, /, *time: FloatInt, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False ) -> None: ... @overload def set( self, - a: float | Epoch | list[float] | tuple[float, ...] | datetime.date, + a: FloatInt | Epoch | list[FloatInt] | tuple[FloatInt, ...] | datetime.date, /, *, - leap_seconds: float = 0, + leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False, ) -> None: ... @@ -50,17 +51,17 @@ class Epoch: @overload @staticmethod def check_input_date( - a: Epoch | list[float] | tuple[float, ...] | datetime.date, + a: Epoch | list[FloatInt] | tuple[FloatInt, ...] | datetime.date, /, *, - leap_seconds: float = 0, + leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False, ) -> Epoch: ... @overload @staticmethod def check_input_date( - year: int, month: int, day: int, /, *, leap_seconds: float = 0, local: bool = False, utc: bool = False + year: int, month: int, day: int, /, *, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False ) -> Epoch: ... @staticmethod @@ -69,19 +70,19 @@ class Epoch: @overload @staticmethod - def get_month(month: float | str, as_string: Literal[True]) -> str: ... + def get_month(month: FloatInt | str, as_string: Literal[True]) -> str: ... @overload @staticmethod - def get_month(month: float | str, as_string: Literal[False] | None = False) -> int: ... + def get_month(month: FloatInt | str, as_string: Literal[False] | None = False) -> int: ... @staticmethod - def is_leap(year: float) -> bool: ... + def is_leap(year: FloatInt) -> bool: ... def leap(self) -> bool: ... @staticmethod def get_doy(yyyy: int, mm: int, dd: int) -> float: ... def doy(self) -> float: ... @staticmethod - def doy2date(year: int, doy: float) -> tuple[int, int, float]: ... + def doy2date(year: int, doy: FloatInt) -> tuple[int, int, float]: ... @staticmethod def leap_seconds(year: int, month: int) -> int: ... @staticmethod @@ -89,16 +90,16 @@ class Epoch: @staticmethod def utc2local() -> float: ... @staticmethod - def easter(year: float) -> tuple[int, int]: ... + def easter(year: FloatInt) -> tuple[int, int]: ... @staticmethod - def jewish_pesach(year: float) -> tuple[int, int]: ... + def jewish_pesach(year: FloatInt) -> tuple[int, int]: ... @staticmethod - def moslem2gregorian(year: float, month: float, day: float) -> tuple[int, int, int]: ... + def moslem2gregorian(year: FloatInt, month: FloatInt, day: FloatInt) -> tuple[int, int, int]: ... @staticmethod - def gregorian2moslem(year: float, month: float, day: float) -> tuple[int, int, int]: ... - def get_date(self, *, utc: bool = False, leap_seconds: float = 0.0, local: bool = ...) -> tuple[int, int, float]: ... + def gregorian2moslem(year: FloatInt, month: FloatInt, day: FloatInt) -> tuple[int, int, int]: ... + def get_date(self, *, utc: bool = False, leap_seconds: FloatInt = 0.0, local: bool = ...) -> tuple[int, int, float]: ... def get_full_date( - self, *, utc: bool = False, leap_seconds: float = 0.0, local: bool = ... + self, *, utc: bool = False, leap_seconds: FloatInt = 0.0, local: bool = ... ) -> tuple[int, int, int, int, int, float]: ... @staticmethod def tt2ut(year: int, month: int) -> float: ... @@ -109,30 +110,30 @@ class Epoch: def dow(self, as_string: Literal[False] | None = False) -> int: ... def mean_sidereal_time(self) -> float: ... - def apparent_sidereal_time(self, true_obliquity: float | Angle, nutation_longitude: float | Angle) -> float: ... + def apparent_sidereal_time(self, true_obliquity: FloatInt | Angle, nutation_longitude: FloatInt | Angle) -> float: ... def mjd(self) -> float: ... def jde(self) -> float: ... def year(self) -> float: ... - def rise_set(self, latitude: Angle, longitude: Angle, altitude: float = 0.0) -> tuple[Epoch, Epoch]: ... + def rise_set(self, latitude: Angle, longitude: Angle, altitude: FloatInt = 0.0) -> tuple[Epoch, Epoch]: ... def __call__(self) -> float: ... - def __add__(self, b: float) -> Epoch: ... + def __add__(self, b: FloatInt) -> Epoch: ... @overload - def __sub__(self, b: float) -> Epoch: ... + def __sub__(self, b: FloatInt) -> Epoch: ... @overload def __sub__(self, b: Epoch) -> float: ... - def __iadd__(self, b: float) -> Self: ... - def __isub__(self, b: float) -> Self: ... # type: ignore[misc] # __sub__ and __isub__ are incompatible - def __radd__(self, b: float) -> Epoch: ... + def __iadd__(self, b: FloatInt) -> Self: ... + def __isub__(self, b: FloatInt) -> Self: ... # type: ignore[misc] # __sub__ and __isub__ are incompatible + def __radd__(self, b: FloatInt) -> Epoch: ... def __int__(self) -> int: ... def __float__(self) -> float: ... - def __eq__(self, b: float | Epoch) -> bool: ... # type: ignore[override] - def __ne__(self, b: float | Epoch) -> bool: ... # type: ignore[override] - def __lt__(self, b: float | Epoch) -> bool: ... - def __ge__(self, b: float | Epoch) -> bool: ... - def __gt__(self, b: float | Epoch) -> bool: ... - def __le__(self, b: float | Epoch) -> bool: ... + def __eq__(self, b: FloatInt | Epoch) -> bool: ... # type: ignore[override] + def __ne__(self, b: FloatInt | Epoch) -> bool: ... # type: ignore[override] + def __lt__(self, b: FloatInt | Epoch) -> bool: ... + def __ge__(self, b: FloatInt | Epoch) -> bool: ... + def __gt__(self, b: FloatInt | Epoch) -> bool: ... + def __le__(self, b: FloatInt | Epoch) -> bool: ... JDE2000: Epoch diff --git a/stubs/PyMeeus/pymeeus/Interpolation.pyi b/stubs/PyMeeus/pymeeus/Interpolation.pyi index d3e821633d03..6c764c40c7ef 100644 --- a/stubs/PyMeeus/pymeeus/Interpolation.pyi +++ b/stubs/PyMeeus/pymeeus/Interpolation.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import overload from pymeeus.Angle import Angle @@ -8,14 +9,14 @@ class Interpolation: @overload def __init__(self, a: Interpolation, /) -> None: ... @overload - def __init__(self, a: list[float | Angle] | tuple[float | Angle, ...], /) -> None: ... + def __init__(self, a: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], /) -> None: ... @overload def __init__( - self, a1: list[float | Angle] | tuple[float | Angle, ...], a2: list[float | Angle] | tuple[float | Angle, ...], / + self, a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], / ) -> None: ... @overload def __init__( - self, a1: float | Angle, a2: float | Angle, a3: float | Angle, a4: float | Angle, /, *rest: float | Angle + self, a1: FloatInt | Angle, a2: FloatInt | Angle, a3: FloatInt | Angle, a4: FloatInt | Angle, /, *rest: FloatInt | Angle ) -> None: ... @overload @@ -23,22 +24,22 @@ class Interpolation: @overload def set(self, a: Interpolation, /) -> None: ... @overload - def set(self, a: list[float | Angle] | tuple[float | Angle, ...], /) -> None: ... + def set(self, a: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], /) -> None: ... @overload def set( - self, a1: list[float | Angle] | tuple[float | Angle, ...], a2: list[float | Angle] | tuple[float | Angle, ...], / + self, a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], / ) -> None: ... @overload def set( - self, a1: float | Angle, a2: float | Angle, a3: float | Angle, a4: float | Angle, /, *rest: float | Angle + self, a1: FloatInt | Angle, a2: FloatInt | Angle, a3: FloatInt | Angle, a4: FloatInt | Angle, /, *rest: FloatInt | Angle ) -> None: ... def __len__(self) -> int: ... def get_tolerance(self) -> float: ... - def set_tolerance(self, tol: float) -> None: ... - def __call__(self, x: float | Angle) -> float | Angle: ... - def derivative(self, x: float | Angle) -> float: ... - def root(self, xl: float | Angle = 0, xh: float | Angle = 0, max_iter: int = 1000) -> float | Angle: ... - def minmax(self, xl: float | Angle = 0, xh: float | Angle = 0, max_iter: int = 1000) -> float | Angle: ... + def set_tolerance(self, tol: FloatInt) -> None: ... + def __call__(self, x: FloatInt | Angle) -> float | Angle: ... + def derivative(self, x: FloatInt | Angle) -> float: ... + def root(self, xl: FloatInt | Angle = 0, xh: FloatInt | Angle = 0, max_iter: int = 1000) -> float | Angle: ... + def minmax(self, xl: FloatInt | Angle = 0, xh: FloatInt | Angle = 0, max_iter: int = 1000) -> float | Angle: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/Jupiter.pyi b/stubs/PyMeeus/pymeeus/Jupiter.pyi index 8d62086bc09b..999383760ead 100644 --- a/stubs/PyMeeus/pymeeus/Jupiter.pyi +++ b/stubs/PyMeeus/pymeeus/Jupiter.pyi @@ -1,13 +1,14 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -VSOP87_L: Final[list[list[list[float]]]] -VSOP87_B: Final[list[list[list[float]]]] -VSOP87_R: Final[list[list[list[float]]]] -ORBITAL_ELEM: Final[list[list[float]]] -ORBITAL_ELEM_J2000: Final[list[list[float]]] +VSOP87_L: Final[list[list[list[FloatInt]]]] +VSOP87_B: Final[list[list[list[FloatInt]]]] +VSOP87_R: Final[list[list[list[FloatInt]]]] +ORBITAL_ELEM: Final[list[list[FloatInt]]] +ORBITAL_ELEM_J2000: Final[list[list[FloatInt]]] class Jupiter: @staticmethod @@ -33,6 +34,6 @@ class Jupiter: @staticmethod def passage_nodes(epoch: Epoch, ascending: bool = True) -> tuple[Epoch, float]: ... @staticmethod - def magnitude(sun_dist: float, earth_dist: float) -> float: ... + def magnitude(sun_dist: FloatInt, earth_dist: FloatInt) -> float: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/JupiterMoons.pyi b/stubs/PyMeeus/pymeeus/JupiterMoons.pyi index f86ebf994723..822ffb3db8d2 100644 --- a/stubs/PyMeeus/pymeeus/JupiterMoons.pyi +++ b/stubs/PyMeeus/pymeeus/JupiterMoons.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal, overload from pymeeus.Angle import Angle @@ -17,30 +18,30 @@ class JupiterMoons: @staticmethod def apparent_rectangular_coordinates( epoch: Epoch, - X: float, - Y: float, - Z: float, - OMEGA: float, - psi: float, - i: float, - lambda_0: float, - beta_0: float, - D: float = 0, + X: FloatInt, + Y: FloatInt, + Z: FloatInt, + OMEGA: FloatInt, + psi: FloatInt, + i: FloatInt, + lambda_0: FloatInt, + beta_0: FloatInt, + D: FloatInt = 0, isFictional: Literal[True] = ..., ) -> float: ... @overload @staticmethod def apparent_rectangular_coordinates( epoch: Epoch, - X: float, - Y: float, - Z: float, - OMEGA: float, - psi: float, - i: float, - lambda_0: float, - beta_0: float, - D: float = 0, + X: FloatInt, + Y: FloatInt, + Z: FloatInt, + OMEGA: FloatInt, + psi: FloatInt, + i: FloatInt, + lambda_0: FloatInt, + beta_0: FloatInt, + D: FloatInt = 0, isFictional: Literal[False] | None = False, ) -> tuple[float, float, float]: ... @@ -52,12 +53,12 @@ class JupiterMoons: @overload @staticmethod def correct_rectangular_positions( - R: float, i_sat: int, DELTA: float, X_coordinate: list[float] | tuple[float, float, float] + R: FloatInt, i_sat: int, DELTA: FloatInt, X_coordinate: list[FloatInt] | tuple[FloatInt, FloatInt, FloatInt] ) -> tuple[float, float, float]: ... @overload @staticmethod def correct_rectangular_positions( - R: float, i_sat: int, DELTA: float, X_coordinate: float, Y_coordinate: float = 0, Z_coordinate: float = 0 + R: FloatInt, i_sat: int, DELTA: FloatInt, X_coordinate: FloatInt, Y_coordinate: FloatInt = 0, Z_coordinate: FloatInt = 0 ) -> tuple[float, float, float]: ... @overload @@ -70,14 +71,14 @@ class JupiterMoons: @staticmethod def is_phenomena(epoch: Epoch) -> list[list[bool]]: ... @staticmethod - def check_coordinates(X: float, Y: float) -> float: ... + def check_coordinates(X: FloatInt, Y: FloatInt) -> float: ... @staticmethod def check_occultation( - X: float = 0, Y: float = 0, Z: float = 0, epoch: Epoch | None = None, i_sat: int | None = None + X: FloatInt = 0, Y: FloatInt = 0, Z: FloatInt = 0, epoch: Epoch | None = None, i_sat: int | None = None ) -> float: ... @staticmethod def check_eclipse( - X_0: float = 0, Y_0: float = 0, Z_0: float = 0, epoch: Epoch | None = None, i_sat: int | None = None + X_0: FloatInt = 0, Y_0: FloatInt = 0, Z_0: FloatInt = 0, epoch: Epoch | None = None, i_sat: int | None = None ) -> float: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/Mars.pyi b/stubs/PyMeeus/pymeeus/Mars.pyi index 083c06a0b54e..58f79a4d71cd 100644 --- a/stubs/PyMeeus/pymeeus/Mars.pyi +++ b/stubs/PyMeeus/pymeeus/Mars.pyi @@ -1,13 +1,14 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -VSOP87_L: Final[list[list[list[float]]]] -VSOP87_B: Final[list[list[list[float]]]] -VSOP87_R: Final[list[list[list[float]]]] -ORBITAL_ELEM: Final[list[list[float]]] -ORBITAL_ELEM_J2000: Final[list[list[float]]] +VSOP87_L: Final[list[list[list[FloatInt]]]] +VSOP87_B: Final[list[list[list[FloatInt]]]] +VSOP87_R: Final[list[list[list[FloatInt]]]] +ORBITAL_ELEM: Final[list[list[FloatInt]]] +ORBITAL_ELEM_J2000: Final[list[list[FloatInt]]] class Mars: @staticmethod @@ -33,6 +34,6 @@ class Mars: @staticmethod def passage_nodes(epoch: Epoch, ascending: bool = True) -> tuple[Epoch, float]: ... @staticmethod - def magnitude(sun_dist: float, earth_dist: float, phase_angle: float | Angle) -> float: ... + def magnitude(sun_dist: FloatInt, earth_dist: FloatInt, phase_angle: FloatInt | Angle) -> float: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/Mercury.pyi b/stubs/PyMeeus/pymeeus/Mercury.pyi index e5b53a02b941..c8be28fa89ad 100644 --- a/stubs/PyMeeus/pymeeus/Mercury.pyi +++ b/stubs/PyMeeus/pymeeus/Mercury.pyi @@ -1,13 +1,14 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -VSOP87_L: Final[list[list[list[float]]]] -VSOP87_B: Final[list[list[list[float]]]] -VSOP87_R: Final[list[list[list[float]]]] -ORBITAL_ELEM: Final[list[list[float]]] -ORBITAL_ELEM_J2000: Final[list[list[float]]] +VSOP87_L: Final[list[list[list[FloatInt]]]] +VSOP87_B: Final[list[list[list[FloatInt]]]] +VSOP87_R: Final[list[list[list[FloatInt]]]] +ORBITAL_ELEM: Final[list[list[FloatInt]]] +ORBITAL_ELEM_J2000: Final[list[list[FloatInt]]] class Mercury: @staticmethod @@ -37,6 +38,6 @@ class Mercury: @staticmethod def passage_nodes(epoch: Epoch, ascending: bool = True) -> tuple[Epoch, float]: ... @staticmethod - def magnitude(sun_dist: float, earth_dist: float, phase_angle: float | Angle) -> float: ... + def magnitude(sun_dist: FloatInt, earth_dist: FloatInt, phase_angle: FloatInt | Angle) -> float: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/Minor.pyi b/stubs/PyMeeus/pymeeus/Minor.pyi index 54e6d380204d..1c72743eeb55 100644 --- a/stubs/PyMeeus/pymeeus/Minor.pyi +++ b/stubs/PyMeeus/pymeeus/Minor.pyi @@ -1,9 +1,10 @@ +from _typeshed import FloatInt from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch class Minor: - def __init__(self, q: float, e: float, i: Angle, omega: Angle, w: Angle, t: Epoch) -> None: ... - def set(self, q: float, e: float, i: Angle, omega: Angle, w: Angle, t: Epoch) -> None: ... + def __init__(self, q: FloatInt, e: FloatInt, i: Angle, omega: Angle, w: Angle, t: Epoch) -> None: ... + def set(self, q: FloatInt, e: FloatInt, i: Angle, omega: Angle, w: Angle, t: Epoch) -> None: ... def geocentric_position(self, epoch: Epoch) -> tuple[Angle, Angle, Angle]: ... def heliocentric_ecliptical_position(self, epoch: Epoch) -> tuple[Angle, Angle]: ... diff --git a/stubs/PyMeeus/pymeeus/Moon.pyi b/stubs/PyMeeus/pymeeus/Moon.pyi index 2a4ce12ae5f2..ebf22ae90f73 100644 --- a/stubs/PyMeeus/pymeeus/Moon.pyi +++ b/stubs/PyMeeus/pymeeus/Moon.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt from typing import Final, Literal from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -PERIODIC_TERMS_LR_TABLE: Final[list[list[float]]] -PERIODIC_TERMS_B_TABLE: Final[list[list[float]]] +PERIODIC_TERMS_LR_TABLE: Final[list[list[FloatInt]]] +PERIODIC_TERMS_B_TABLE: Final[list[list[FloatInt]]] class Moon: @staticmethod diff --git a/stubs/PyMeeus/pymeeus/Neptune.pyi b/stubs/PyMeeus/pymeeus/Neptune.pyi index 3dd5e2a418b2..a43f97060373 100644 --- a/stubs/PyMeeus/pymeeus/Neptune.pyi +++ b/stubs/PyMeeus/pymeeus/Neptune.pyi @@ -1,13 +1,14 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -VSOP87_L: Final[list[list[list[float]]]] -VSOP87_B: Final[list[list[list[float]]]] -VSOP87_R: Final[list[list[list[float]]]] -ORBITAL_ELEM: Final[list[list[float]]] -ORBITAL_ELEM_J2000: Final[list[list[float]]] +VSOP87_L: Final[list[list[list[FloatInt]]]] +VSOP87_B: Final[list[list[list[FloatInt]]]] +VSOP87_R: Final[list[list[list[FloatInt]]]] +ORBITAL_ELEM: Final[list[list[FloatInt]]] +ORBITAL_ELEM_J2000: Final[list[list[FloatInt]]] class Neptune: @staticmethod @@ -25,6 +26,6 @@ class Neptune: @staticmethod def opposition(epoch: Epoch) -> Epoch: ... @staticmethod - def magnitude(sun_dist: float, earth_dist: float) -> float: ... + def magnitude(sun_dist: FloatInt, earth_dist: FloatInt) -> float: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/Pluto.pyi b/stubs/PyMeeus/pymeeus/Pluto.pyi index bbe9825c81e9..bb405c0d2742 100644 --- a/stubs/PyMeeus/pymeeus/Pluto.pyi +++ b/stubs/PyMeeus/pymeeus/Pluto.pyi @@ -1,12 +1,13 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -PLUTO_ARGUMENT: Final[list[tuple[float, float, float]]] -PLUTO_LONGITUDE: Final[list[tuple[float, float]]] -PLUTO_LATITUDE: Final[list[tuple[float, float]]] -PLUTO_RADIUS_VECTOR: Final[list[tuple[float, float]]] +PLUTO_ARGUMENT: Final[list[tuple[FloatInt, FloatInt, FloatInt]]] +PLUTO_LONGITUDE: Final[list[tuple[FloatInt, FloatInt]]] +PLUTO_LATITUDE: Final[list[tuple[FloatInt, FloatInt]]] +PLUTO_RADIUS_VECTOR: Final[list[tuple[FloatInt, FloatInt]]] class Pluto: @staticmethod diff --git a/stubs/PyMeeus/pymeeus/Saturn.pyi b/stubs/PyMeeus/pymeeus/Saturn.pyi index 9794c54542e3..54ae72e018ce 100644 --- a/stubs/PyMeeus/pymeeus/Saturn.pyi +++ b/stubs/PyMeeus/pymeeus/Saturn.pyi @@ -1,13 +1,14 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -VSOP87_L: Final[list[list[list[float]]]] -VSOP87_B: Final[list[list[list[float]]]] -VSOP87_R: Final[list[list[list[float]]]] -ORBITAL_ELEM: Final[list[list[float]]] -ORBITAL_ELEM_J2000: Final[list[list[float]]] +VSOP87_L: Final[list[list[list[FloatInt]]]] +VSOP87_B: Final[list[list[list[FloatInt]]]] +VSOP87_R: Final[list[list[list[FloatInt]]]] +ORBITAL_ELEM: Final[list[list[FloatInt]]] +ORBITAL_ELEM_J2000: Final[list[list[FloatInt]]] class Saturn: @staticmethod @@ -33,7 +34,7 @@ class Saturn: @staticmethod def passage_nodes(epoch: Epoch, ascending: bool = True) -> tuple[Epoch, float]: ... @staticmethod - def magnitude(sun_dist: float, earth_dist: float, delta_U: float | Angle, B: float | Angle) -> float: ... + def magnitude(sun_dist: FloatInt, earth_dist: FloatInt, delta_U: FloatInt | Angle, B: FloatInt | Angle) -> float: ... @staticmethod def ring_inclination(epoch: Epoch) -> Angle: ... @staticmethod diff --git a/stubs/PyMeeus/pymeeus/Uranus.pyi b/stubs/PyMeeus/pymeeus/Uranus.pyi index ff2f3885f025..c53191021a08 100644 --- a/stubs/PyMeeus/pymeeus/Uranus.pyi +++ b/stubs/PyMeeus/pymeeus/Uranus.pyi @@ -1,13 +1,14 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -VSOP87_L: Final[list[list[list[float]]]] -VSOP87_B: Final[list[list[list[float]]]] -VSOP87_R: Final[list[list[list[float]]]] -ORBITAL_ELEM: Final[list[list[float]]] -ORBITAL_ELEM_J2000: Final[list[list[float]]] +VSOP87_L: Final[list[list[list[FloatInt]]]] +VSOP87_B: Final[list[list[list[FloatInt]]]] +VSOP87_R: Final[list[list[list[FloatInt]]]] +ORBITAL_ELEM: Final[list[list[FloatInt]]] +ORBITAL_ELEM_J2000: Final[list[list[FloatInt]]] class Uranus: @staticmethod @@ -29,6 +30,6 @@ class Uranus: @staticmethod def passage_nodes(epoch: Epoch, ascending: bool = True) -> tuple[Epoch, float]: ... @staticmethod - def magnitude(sun_dist: float, earth_dist: float) -> float: ... + def magnitude(sun_dist: FloatInt, earth_dist: FloatInt) -> float: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/Venus.pyi b/stubs/PyMeeus/pymeeus/Venus.pyi index 3fae751f4af6..f60136b1ab4f 100644 --- a/stubs/PyMeeus/pymeeus/Venus.pyi +++ b/stubs/PyMeeus/pymeeus/Venus.pyi @@ -1,13 +1,14 @@ +from _typeshed import FloatInt from typing import Final from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch -VSOP87_L: Final[list[list[list[float]]]] -VSOP87_B: Final[list[list[list[float]]]] -VSOP87_R: Final[list[list[list[float]]]] -ORBITAL_ELEM: Final[list[list[float]]] -ORBITAL_ELEM_J2000: Final[list[list[float]]] +VSOP87_L: Final[list[list[list[FloatInt]]]] +VSOP87_B: Final[list[list[list[FloatInt]]]] +VSOP87_R: Final[list[list[list[FloatInt]]]] +ORBITAL_ELEM: Final[list[list[FloatInt]]] +ORBITAL_ELEM_J2000: Final[list[list[FloatInt]]] class Venus: @staticmethod @@ -39,6 +40,6 @@ class Venus: @staticmethod def illuminated_fraction(epoch: Epoch) -> float: ... @staticmethod - def magnitude(sun_dist: float, earth_dist: float, phase_angle: float | Angle) -> float: ... + def magnitude(sun_dist: FloatInt, earth_dist: FloatInt, phase_angle: FloatInt | Angle) -> float: ... def main() -> None: ... diff --git a/stubs/PyMeeus/pymeeus/base.pyi b/stubs/PyMeeus/pymeeus/base.pyi index e61004af8567..7a3c152b4fc3 100644 --- a/stubs/PyMeeus/pymeeus/base.pyi +++ b/stubs/PyMeeus/pymeeus/base.pyi @@ -1,8 +1,9 @@ +from _typeshed import FloatInt from typing import Final, Literal TOL: Final = 1e-10 def machine_accuracy() -> tuple[float, int]: ... -def get_ordinal_suffix(ordinal: float) -> Literal["st", "nd", "rd", "th"]: ... -def iint(number: float) -> int: ... +def get_ordinal_suffix(ordinal: FloatInt) -> Literal["st", "nd", "rd", "th"]: ... +def iint(number: FloatInt) -> int: ... def main() -> None: ... diff --git a/stubs/PyMySQL/pymysql/connections.pyi b/stubs/PyMySQL/pymysql/connections.pyi index 7d03d41f4b25..27f949108696 100644 --- a/stubs/PyMySQL/pymysql/connections.pyi +++ b/stubs/PyMySQL/pymysql/connections.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, Unused from collections.abc import Callable from socket import _Address, socket as _socket @@ -49,7 +50,7 @@ class Connection(Generic[_C]): use_unicode: bool client_flag: int cursorclass: type[_C] - connect_timeout: float | None + connect_timeout: FloatInt | None host_info: str sql_mode: str | None init_command: str | None @@ -79,15 +80,15 @@ class Connection(Generic[_C]): client_flag: int = 0, cursorclass: type[_C] = ..., init_command: str | None = None, - connect_timeout: float = 10, + connect_timeout: FloatInt = 10, read_default_group: str | None = None, autocommit: bool | None = False, local_infile: bool = False, max_allowed_packet: int = 16_777_216, defer_connect: bool = False, auth_plugin_map: dict[str, Callable[[Connection[Any]], Any]] | None = None, - read_timeout: float | None = None, - write_timeout: float | None = None, + read_timeout: FloatInt | None = None, + write_timeout: FloatInt | None = None, bind_address: str | None = None, binary_prefix: bool = False, program_name: str | None = None, @@ -126,15 +127,15 @@ class Connection(Generic[_C]): client_flag: int = 0, cursorclass: type[_C] = ..., init_command: str | None = None, - connect_timeout: float = 10, + connect_timeout: FloatInt = 10, read_default_group: str | None = None, autocommit: bool | None = False, local_infile: bool = False, max_allowed_packet: int = 16_777_216, defer_connect: bool = False, auth_plugin_map: dict[str, Callable[[Connection[Any]], Any]] | None = None, - read_timeout: float | None = None, - write_timeout: float | None = None, + read_timeout: FloatInt | None = None, + write_timeout: FloatInt | None = None, bind_address: str | None = None, binary_prefix: bool = False, program_name: str | None = None, @@ -173,15 +174,15 @@ class Connection(Generic[_C]): client_flag: int = 0, cursorclass: type[_C] = ..., init_command: str | None = None, - connect_timeout: float = 10, + connect_timeout: FloatInt = 10, read_default_group: str | None = None, autocommit: bool | None = False, local_infile: bool = False, max_allowed_packet: int = 16_777_216, defer_connect: bool = False, auth_plugin_map: dict[str, Callable[[Connection[Any]], Any]] | None = None, - read_timeout: float | None = None, - write_timeout: float | None = None, + read_timeout: FloatInt | None = None, + write_timeout: FloatInt | None = None, bind_address: str | None = None, binary_prefix: bool = False, program_name: str | None = None, diff --git a/stubs/PyMySQL/pymysql/converters.pyi b/stubs/PyMySQL/pymysql/converters.pyi index f94dcc5323aa..6a6f715f3f5f 100644 --- a/stubs/PyMySQL/pymysql/converters.pyi +++ b/stubs/PyMySQL/pymysql/converters.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime import re import time @@ -17,7 +18,7 @@ def escape_sequence(val: Sequence[object], charset: object = None, mapping: _Esc def escape_set(val: set[object], charset: object = None, mapping: _EscaperMapping = None) -> str: ... def escape_bool(value: bool, mapping: _EscaperMapping = None) -> str: ... def escape_int(value: int, mapping: _EscaperMapping = None) -> str: ... -def escape_float(value: float, mapping: _EscaperMapping = None) -> str: ... +def escape_float(value: FloatInt, mapping: _EscaperMapping = None) -> str: ... def escape_string(value: str, mapping: _EscaperMapping = None) -> str: ... def escape_bytes(value: bytes, mapping: _EscaperMapping = None) -> str: ... def escape_str(value: str, mapping: _EscaperMapping = None) -> str: ... diff --git a/stubs/PyMySQL/pymysql/times.pyi b/stubs/PyMySQL/pymysql/times.pyi index 2c4f86f7ae31..d73a41fc8b7e 100644 --- a/stubs/PyMySQL/pymysql/times.pyi +++ b/stubs/PyMySQL/pymysql/times.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from datetime import date, datetime, time, timedelta Date: type[date] @@ -5,6 +6,6 @@ Time: type[time] TimeDelta: type[timedelta] Timestamp: type[datetime] -def DateFromTicks(ticks: float | None) -> date: ... -def TimeFromTicks(ticks: float | None) -> time: ... -def TimestampFromTicks(ticks: float | None) -> datetime: ... +def DateFromTicks(ticks: FloatInt | None) -> date: ... +def TimeFromTicks(ticks: FloatInt | None) -> time: ... +def TimestampFromTicks(ticks: FloatInt | None) -> datetime: ... diff --git a/stubs/PyScreeze/pyscreeze/__init__.pyi b/stubs/PyScreeze/pyscreeze/__init__.pyi index 5e1e7c7fb771..8c4a17527def 100644 --- a/stubs/PyScreeze/pyscreeze/__init__.pyi +++ b/stubs/PyScreeze/pyscreeze/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import ConvertibleToFloat, Incomplete, StrOrBytesPath, Unused from collections.abc import Callable, Generator @@ -75,7 +76,7 @@ def locate( @overload def locateOnScreen( image: str | Image.Image | _MatLike, - minSearchTime: float = 0, + minSearchTime: FloatInt = 0, *, grayscale: bool | None = None, limit: Unused = 1, @@ -88,7 +89,7 @@ def locateOnScreen( @overload def locateOnScreen( image: str | Image.Image, - minSearchTime: float = 0, + minSearchTime: FloatInt = 0, *, grayscale: bool | None = None, limit: Unused = 1, @@ -126,7 +127,7 @@ def locateAllOnScreen( def locateCenterOnScreen( image: str | Image.Image | _MatLike, *, - minSearchTime: float = 0, + minSearchTime: FloatInt = 0, grayscale: bool | None = None, limit: Unused = 1, region: tuple[int, int, int, int] | None = None, @@ -139,7 +140,7 @@ def locateCenterOnScreen( def locateCenterOnScreen( image: str | Image.Image, *, - minSearchTime: float = 0, + minSearchTime: FloatInt = 0, grayscale: bool | None = None, limit: Unused = 1, region: tuple[int, int, int, int] | None = None, diff --git a/stubs/PySocks/socks.pyi b/stubs/PySocks/socks.pyi index 18ecec651ef6..859c58e506b0 100644 --- a/stubs/PySocks/socks.pyi +++ b/stubs/PySocks/socks.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging import socket import types @@ -98,7 +99,7 @@ class socksocket(_BaseSocket): def __init__( self, family: socket.AddressFamily = ..., type: socket.SocketKind = ..., proto: int = 0, fileno: int | None = None ) -> None: ... - def settimeout(self, timeout: float | None) -> None: ... + def settimeout(self, timeout: FloatInt | None) -> None: ... def gettimeout(self) -> float | None: ... def setblocking(self, v: bool) -> None: ... def set_proxy( diff --git a/stubs/PySocks/sockshandler.pyi b/stubs/PySocks/sockshandler.pyi index 94d1ceec399f..ecfec5b3ec42 100644 --- a/stubs/PySocks/sockshandler.pyi +++ b/stubs/PySocks/sockshandler.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import http.client import ssl import sys @@ -28,7 +29,7 @@ class SocksiPyConnection(http.client.HTTPConnection): # undocumented password: str | None = None, host: str | None = None, port: int | None = None, - timeout: float | None = ..., + timeout: FloatInt | None = ..., source_address: tuple[str, int] | None = None, blocksize: int = 8192, ) -> None: ... @@ -49,7 +50,7 @@ class SocksiPyConnectionS(http.client.HTTPSConnection): # undocumented host: str | None = None, port: int | None = None, *, - timeout: float | None = ..., + timeout: FloatInt | None = ..., source_address: tuple[str, int] | None = None, context: ssl.SSLContext | None = None, blocksize: int = 8192, @@ -67,7 +68,7 @@ class SocksiPyConnectionS(http.client.HTTPSConnection): # undocumented port: int | None = None, key_file: str | None = None, cert_file: str | None = None, - timeout: float | None = ..., + timeout: FloatInt | None = ..., source_address: tuple[str, int] | None = None, *, context: ssl.SSLContext | None = None, diff --git a/stubs/PyYAML/yaml/constructor.pyi b/stubs/PyYAML/yaml/constructor.pyi index 96d6661cbb70..8cc459261099 100644 --- a/stubs/PyYAML/yaml/constructor.pyi +++ b/stubs/PyYAML/yaml/constructor.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Generator, Hashable from datetime import date @@ -50,8 +51,8 @@ class SafeConstructor(BaseConstructor): bool_values: ClassVar[dict[str, bool]] def construct_yaml_bool(self, node: ScalarNode) -> bool: ... def construct_yaml_int(self, node: ScalarNode) -> int: ... - inf_value: ClassVar[float] - nan_value: ClassVar[float] + inf_value: ClassVar[FloatInt] + nan_value: ClassVar[FloatInt] def construct_yaml_float(self, node: ScalarNode) -> float: ... def construct_yaml_binary(self, node: ScalarNode) -> bytes: ... timestamp_regexp: ClassVar[Pattern[str]] diff --git a/stubs/PyYAML/yaml/dumper.pyi b/stubs/PyYAML/yaml/dumper.pyi index a414124d233e..c7f28b5d0846 100644 --- a/stubs/PyYAML/yaml/dumper.pyi +++ b/stubs/PyYAML/yaml/dumper.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Mapping from typing import TypeAlias @@ -10,7 +11,7 @@ from .emitter import _WriteStream, _YAMLObject # Ideally, there would be a way to limit these values to only +/- float("inf"), # but that's not possible at the moment (https://github.com/python/typing/issues/1160). -_Inf: TypeAlias = float +_Inf: TypeAlias = FloatInt class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__( diff --git a/stubs/PyYAML/yaml/representer.pyi b/stubs/PyYAML/yaml/representer.pyi index 9e1dd7c4d53d..5ba96089c91d 100644 --- a/stubs/PyYAML/yaml/representer.pyi +++ b/stubs/PyYAML/yaml/representer.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from _typeshed import Incomplete, ReadableBuffer, SupportsItems from collections.abc import Callable, Iterable, Mapping @@ -39,14 +40,14 @@ class BaseRepresenter: def ignore_aliases(self, data) -> bool: ... class SafeRepresenter(BaseRepresenter): - inf_value: ClassVar[float] + inf_value: ClassVar[FloatInt] def ignore_aliases(self, data) -> bool: ... def represent_none(self, data) -> ScalarNode: ... def represent_str(self, data: str) -> ScalarNode: ... def represent_binary(self, data: ReadableBuffer) -> ScalarNode: ... def represent_bool(self, data: bool) -> ScalarNode: ... def represent_int(self, data: int) -> ScalarNode: ... - def represent_float(self, data: float) -> ScalarNode: ... + def represent_float(self, data: FloatInt) -> ScalarNode: ... def represent_list(self, data: Iterable[Incomplete]) -> SequenceNode: ... def represent_dict( self, data: SupportsItems[Incomplete, Incomplete] | Iterable[tuple[Incomplete, Incomplete]] diff --git a/stubs/Pygments/pygments/lexer.pyi b/stubs/Pygments/pygments/lexer.pyi index 124ba720f15e..9f6c9d5be4bc 100644 --- a/stubs/Pygments/pygments/lexer.pyi +++ b/stubs/Pygments/pygments/lexer.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterable, Iterator, Sequence from re import Pattern, RegexFlag @@ -33,7 +34,7 @@ class Lexer(metaclass=LexerMeta): filenames: ClassVar[Sequence[str]] alias_filenames: ClassVar[Sequence[str]] mimetypes: ClassVar[Sequence[str]] - priority: ClassVar[float] + priority: ClassVar[FloatInt] url: ClassVar[str] # Set to None, but always overridden with a non-None value in subclasses. version_added: ClassVar[str] # Set to None, but always overridden with a non-None value in subclasses. options: Incomplete diff --git a/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi b/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi index 75b3139f45ae..2362f1506711 100644 --- a/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi +++ b/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import Final, Literal, TypeAlias, TypedDict, type_check_only @@ -59,8 +60,8 @@ def gpio_function(channel: int, /) -> int: ... def setwarnings(gpio_warnings: bool, /) -> None: ... class PWM: - def __init__(self, channel: int, frequency: float, /) -> None: ... - def start(self, dutycycle: float, /) -> None: ... - def ChangeDutyCycle(self, dutycycle: float, /) -> None: ... - def ChangeFrequency(self, frequency: float, /) -> None: ... + def __init__(self, channel: int, frequency: FloatInt, /) -> None: ... + def start(self, dutycycle: FloatInt, /) -> None: ... + def ChangeDutyCycle(self, dutycycle: FloatInt, /) -> None: ... + def ChangeFrequency(self, frequency: FloatInt, /) -> None: ... def stop(self) -> None: ... diff --git a/stubs/WTForms/wtforms/fields/numeric.pyi b/stubs/WTForms/wtforms/fields/numeric.pyi index 5ec1dd522848..a1083ac09983 100644 --- a/stubs/WTForms/wtforms/fields/numeric.pyi +++ b/stubs/WTForms/wtforms/fields/numeric.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Sequence from decimal import Decimal from typing import Any, Literal, overload @@ -129,10 +130,10 @@ class DecimalField(LocaleAwareNumberField): ) -> None: ... class FloatField(Field): - data: float | None + data: FloatInt | None # technically this is not as strict and will accept anything # that can be passed into float(), but we might as well be - default: float | Callable[[], float] | None + default: FloatInt | Callable[[], float] | None def __init__( self, label: _Text | None = None, @@ -142,7 +143,7 @@ class FloatField(Field): filters: Sequence[_Filter] = (), description: _Text = "", id: str | None = None, - default: float | Callable[[], float] | None = None, + default: FloatInt | Callable[[], float] | None = None, widget: _Widget[Self] | None = None, render_kw: dict[str, Any] | None = None, name: str | None = None, diff --git a/stubs/WTForms/wtforms/validators.pyi b/stubs/WTForms/wtforms/validators.pyi index 24d26e6f9838..372ecd3545b7 100644 --- a/stubs/WTForms/wtforms/validators.pyi +++ b/stubs/WTForms/wtforms/validators.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Collection, Iterable from datetime import date, datetime from decimal import Decimal @@ -69,14 +70,14 @@ class Length: def __call__(self, form: BaseForm, field: StringField) -> None: ... class NumberRange: - min: float | Decimal | Callable[[], float | Decimal | None] | None - max: float | Decimal | Callable[[], float | Decimal | None] | None + min: FloatInt | Decimal | Callable[[], float | Decimal | None] | None + max: FloatInt | Decimal | Callable[[], float | Decimal | None] | None message: _Text | None field_flags: dict[str, Any] def __init__( self, - min: float | Decimal | Callable[[], float | Decimal | None] | None = None, - max: float | Decimal | Callable[[], float | Decimal | None] | None = None, + min: FloatInt | Decimal | Callable[[], float | Decimal | None] | None = None, + max: FloatInt | Decimal | Callable[[], float | Decimal | None] | None = None, message: _Text | None = None, ) -> None: ... # any numeric field will work, for now we don't try to use a union diff --git a/stubs/WTForms/wtforms/widgets/core.pyi b/stubs/WTForms/wtforms/widgets/core.pyi index 0c75643b70e6..2d1919aec286 100644 --- a/stubs/WTForms/wtforms/widgets/core.pyi +++ b/stubs/WTForms/wtforms/widgets/core.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from decimal import Decimal from typing import Any, Literal, TypeAlias @@ -128,14 +129,14 @@ class TimeInput(Input): ... class DateTimeLocalInput(Input): ... class NumberInput(Input): - step: Decimal | float | str | None - min: Decimal | float | str | None - max: Decimal | float | str | None + step: Decimal | FloatInt | str | None + min: Decimal | FloatInt | str | None + max: Decimal | FloatInt | str | None def __init__( self, - step: Decimal | float | str | None = None, - min: Decimal | float | str | None = None, - max: Decimal | float | str | None = None, + step: Decimal | FloatInt | str | None = None, + min: Decimal | FloatInt | str | None = None, + max: Decimal | FloatInt | str | None = None, ) -> None: ... class RangeInput(Input): ... diff --git a/stubs/WebOb/webob/acceptparse.pyi b/stubs/WebOb/webob/acceptparse.pyi index 77917501bc6d..b94ead8b8194 100644 --- a/stubs/WebOb/webob/acceptparse.pyi +++ b/stubs/WebOb/webob/acceptparse.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsItems from collections.abc import Callable, Iterable, Iterator, Sequence from typing import Any, Literal, NamedTuple, Protocol, TypeAlias, TypeVar, overload, type_check_only @@ -7,7 +8,7 @@ from webob._types import AsymmetricPropertyWithDelete _T = TypeVar("_T") _ListOrTuple: TypeAlias = list[_T] | tuple[_T, ...] -_ParsedAccept: TypeAlias = tuple[str, float, list[tuple[str, str]], list[str | tuple[str, str]]] +_ParsedAccept: TypeAlias = tuple[str, FloatInt, list[tuple[str, str]], list[str | tuple[str, str]]] @type_check_only class _SupportsStr(Protocol): @@ -22,8 +23,8 @@ _AcceptProperty: TypeAlias = AsymmetricPropertyWithDelete[ _AnyAcceptHeader, ( _AnyAcceptHeader - | SupportsItems[str, float | tuple[float, str]] - | _ListOrTuple[str | tuple[str, float, str] | list[Any]] + | SupportsItems[str, FloatInt | tuple[FloatInt, str]] + | _ListOrTuple[str | tuple[str, FloatInt, str] | list[Any]] | _SupportsStr | str | None @@ -33,8 +34,8 @@ _AcceptCharsetProperty: TypeAlias = AsymmetricPropertyWithDelete[ _AnyAcceptCharsetHeader, ( _AnyAcceptCharsetHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -44,8 +45,8 @@ _AcceptEncodingProperty: TypeAlias = AsymmetricPropertyWithDelete[ _AnyAcceptEncodingHeader, ( _AnyAcceptEncodingHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -55,8 +56,8 @@ _AcceptLanguageProperty: TypeAlias = AsymmetricPropertyWithDelete[ _AnyAcceptLanguageHeader, ( _AnyAcceptLanguageHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -89,8 +90,8 @@ class AcceptValidHeader(Accept): self, other: ( _AnyAcceptHeader - | SupportsItems[str, float | tuple[float, str]] - | _ListOrTuple[str | tuple[str, float, str] | list[Any]] + | SupportsItems[str, FloatInt | tuple[FloatInt, str]] + | _ListOrTuple[str | tuple[str, FloatInt, str] | list[Any]] | _SupportsStr | str | None @@ -103,8 +104,8 @@ class AcceptValidHeader(Accept): self, other: ( _AnyAcceptHeader - | SupportsItems[str, float | tuple[float, str]] - | _ListOrTuple[str | tuple[str, float, str] | list[Any]] + | SupportsItems[str, FloatInt | tuple[FloatInt, str]] + | _ListOrTuple[str | tuple[str, FloatInt, str] | list[Any]] | _SupportsStr | str | None @@ -116,9 +117,9 @@ class AcceptValidHeader(Accept): def acceptable_offers(self, offers: Sequence[str]) -> list[tuple[str, float]]: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: None = None) -> str | None: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: str) -> str: ... def quality(self, offer: str) -> float | None: ... @@ -132,9 +133,9 @@ class _AcceptInvalidOrNoHeader(Accept): def acceptable_offers(self, offers: Sequence[str]) -> list[tuple[str, float]]: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: None = None) -> str | None: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: str) -> str: ... def quality(self, offer: str) -> float: ... @@ -155,8 +156,8 @@ class AcceptNoHeader(_AcceptInvalidOrNoHeader): self, other: ( _AnyAcceptHeader - | SupportsItems[str, float | tuple[float, str]] - | _ListOrTuple[str | tuple[str, float, str] | list[Any]] + | SupportsItems[str, FloatInt | tuple[FloatInt, str]] + | _ListOrTuple[str | tuple[str, FloatInt, str] | list[Any]] | _SupportsStr | str | None @@ -172,8 +173,8 @@ class AcceptNoHeader(_AcceptInvalidOrNoHeader): self, other: ( _AnyAcceptHeader - | SupportsItems[str, float | tuple[float, str]] - | _ListOrTuple[str | tuple[str, float, str] | list[Any]] + | SupportsItems[str, FloatInt | tuple[FloatInt, str]] + | _ListOrTuple[str | tuple[str, FloatInt, str] | list[Any]] | _SupportsStr | str | None @@ -197,8 +198,8 @@ class AcceptInvalidHeader(_AcceptInvalidOrNoHeader): self, other: ( _AnyAcceptHeader - | SupportsItems[str, float | tuple[float, str]] - | _ListOrTuple[str | tuple[str, float, str] | list[Any]] + | SupportsItems[str, FloatInt | tuple[FloatInt, str]] + | _ListOrTuple[str | tuple[str, FloatInt, str] | list[Any]] | _SupportsStr | str | None @@ -214,8 +215,8 @@ class AcceptInvalidHeader(_AcceptInvalidOrNoHeader): self, other: ( _AnyAcceptHeader - | SupportsItems[str, float | tuple[float, str]] - | _ListOrTuple[str | tuple[str, float, str] | list[Any]] + | SupportsItems[str, FloatInt | tuple[FloatInt, str]] + | _ListOrTuple[str | tuple[str, FloatInt, str] | list[Any]] | _SupportsStr | str | None @@ -250,8 +251,8 @@ class AcceptCharsetValidHeader(AcceptCharset): self, other: ( _AnyAcceptCharsetHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -264,8 +265,8 @@ class AcceptCharsetValidHeader(AcceptCharset): self, other: ( _AnyAcceptCharsetHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -274,9 +275,9 @@ class AcceptCharsetValidHeader(AcceptCharset): def acceptable_offers(self, offers: Sequence[str]) -> list[tuple[str, float]]: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: None = None) -> str | None: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: str) -> str: ... def quality(self, offer: str) -> float | None: ... @@ -287,9 +288,9 @@ class _AcceptCharsetInvalidOrNoHeader(AcceptCharset): def acceptable_offers(self, offers: Iterable[str]) -> list[tuple[str, float]]: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: None = None) -> str | None: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: str) -> str: ... def quality(self, offer: str) -> float | None: ... @@ -310,8 +311,8 @@ class AcceptCharsetNoHeader(_AcceptCharsetInvalidOrNoHeader): self, other: ( _AnyAcceptCharsetHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -327,8 +328,8 @@ class AcceptCharsetNoHeader(_AcceptCharsetInvalidOrNoHeader): self, other: ( _AnyAcceptCharsetHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -354,8 +355,8 @@ class AcceptCharsetInvalidHeader(_AcceptCharsetInvalidOrNoHeader): self, other: ( _AnyAcceptCharsetHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -373,8 +374,8 @@ class AcceptCharsetInvalidHeader(_AcceptCharsetInvalidOrNoHeader): self, other: ( _AnyAcceptCharsetHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -409,8 +410,8 @@ class AcceptEncodingValidHeader(AcceptEncoding): self, other: ( _AnyAcceptEncodingHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -423,8 +424,8 @@ class AcceptEncodingValidHeader(AcceptEncoding): self, other: ( _AnyAcceptEncodingHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -433,9 +434,9 @@ class AcceptEncodingValidHeader(AcceptEncoding): def acceptable_offers(self, offers: Sequence[str]) -> list[tuple[str, float]]: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: None = None) -> str | None: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: str) -> str: ... def quality(self, offer: str) -> float | None: ... @@ -446,9 +447,9 @@ class _AcceptEncodingInvalidOrNoHeader(AcceptEncoding): def acceptable_offers(self, offers: Iterable[str]) -> list[tuple[str, float]]: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: None = None) -> str | None: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: str) -> str: ... def quality(self, offer: str) -> float | None: ... @@ -469,8 +470,8 @@ class AcceptEncodingNoHeader(_AcceptEncodingInvalidOrNoHeader): self, other: ( _AnyAcceptEncodingHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -486,8 +487,8 @@ class AcceptEncodingNoHeader(_AcceptEncodingInvalidOrNoHeader): self, other: ( _AnyAcceptEncodingHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -511,8 +512,8 @@ class AcceptEncodingInvalidHeader(_AcceptEncodingInvalidOrNoHeader): self, other: ( _AnyAcceptEncodingHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -528,8 +529,8 @@ class AcceptEncodingInvalidHeader(_AcceptEncodingInvalidOrNoHeader): self, other: ( _AnyAcceptEncodingHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -564,8 +565,8 @@ class AcceptLanguageValidHeader(AcceptLanguage): self, other: ( _AnyAcceptLanguageHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -578,8 +579,8 @@ class AcceptLanguageValidHeader(AcceptLanguage): self, other: ( _AnyAcceptLanguageHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -588,9 +589,9 @@ class AcceptLanguageValidHeader(AcceptLanguage): def basic_filtering(self, language_tags: Sequence[str]) -> list[tuple[str, float]]: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: None = None) -> str | None: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: str) -> str: ... @overload def lookup( @@ -631,9 +632,9 @@ class _AcceptLanguageInvalidOrNoHeader(AcceptLanguage): def basic_filtering(self, language_tags: Iterable[str]) -> list[tuple[str, float]]: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: None = None) -> str | None: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: None = None) -> str | None: ... @overload - def best_match(self, offers: Iterable[str | tuple[str, float] | list[Any]], default_match: str) -> str: ... + def best_match(self, offers: Iterable[str | tuple[str, FloatInt] | list[Any]], default_match: str) -> str: ... @overload def lookup(self, language_tags: object, default_range: object, default_tag: str, default: object = None) -> str: ... @@ -672,8 +673,8 @@ class AcceptLanguageNoHeader(_AcceptLanguageInvalidOrNoHeader): self, other: ( _AnyAcceptLanguageHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -689,8 +690,8 @@ class AcceptLanguageNoHeader(_AcceptLanguageInvalidOrNoHeader): self, other: ( _AnyAcceptLanguageHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -716,8 +717,8 @@ class AcceptLanguageInvalidHeader(_AcceptLanguageInvalidOrNoHeader): self, other: ( _AnyAcceptLanguageHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None @@ -735,8 +736,8 @@ class AcceptLanguageInvalidHeader(_AcceptLanguageInvalidOrNoHeader): self, other: ( _AnyAcceptLanguageHeader - | SupportsItems[str, float] - | _ListOrTuple[str | tuple[str, float] | list[Any]] + | SupportsItems[str, FloatInt] + | _ListOrTuple[str | tuple[str, FloatInt] | list[Any]] | _SupportsStr | str | None diff --git a/stubs/WebOb/webob/datetime_utils.pyi b/stubs/WebOb/webob/datetime_utils.pyi index 68c45d2f12db..ba8bfb60af7b 100644 --- a/stubs/WebOb/webob/datetime_utils.pyi +++ b/stubs/WebOb/webob/datetime_utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from datetime import date, datetime, timedelta, tzinfo from time import _TimeTuple, struct_time @@ -35,6 +36,6 @@ month: timedelta year: timedelta def parse_date(value: str | bytes | None) -> datetime | None: ... -def serialize_date(dt: datetime | date | timedelta | _TimeTuple | struct_time | float | str | bytes) -> str: ... +def serialize_date(dt: datetime | date | timedelta | _TimeTuple | struct_time | FloatInt | str | bytes) -> str: ... def parse_date_delta(value: str | bytes | None) -> datetime | None: ... -def serialize_date_delta(value: datetime | date | timedelta | _TimeTuple | struct_time | float | str | bytes) -> str: ... +def serialize_date_delta(value: datetime | date | timedelta | _TimeTuple | struct_time | FloatInt | str | bytes) -> str: ... diff --git a/stubs/WebOb/webob/descriptors.pyi b/stubs/WebOb/webob/descriptors.pyi index 0cc3bfc51cff..df31cc214c32 100644 --- a/stubs/WebOb/webob/descriptors.pyi +++ b/stubs/WebOb/webob/descriptors.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Iterable from datetime import date, datetime, timedelta from time import _TimeTuple, struct_time @@ -17,7 +18,7 @@ _DescriptorT = TypeVar("_DescriptorT", bound=AsymmetricPropertyWithDelete[Any, A _StringProperty: TypeAlias = SymmetricPropertyWithDelete[str | None] _ListProperty: TypeAlias = AsymmetricPropertyWithDelete[tuple[str, ...] | None, Iterable[str] | str | None] _DateProperty: TypeAlias = AsymmetricPropertyWithDelete[ - datetime | None, date | datetime | timedelta | _TimeTuple | struct_time | float | str | None + datetime | None, date | datetime | timedelta | _TimeTuple | struct_time | FloatInt | str | None ] _ContentRangeParams: TypeAlias = ( ContentRange diff --git a/stubs/WebTest/webtest/http.pyi b/stubs/WebTest/webtest/http.pyi index 8c0e3314db38..f988a2910135 100644 --- a/stubs/WebTest/webtest/http.pyi +++ b/stubs/WebTest/webtest/http.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment from collections.abc import Iterable @@ -13,7 +14,7 @@ from waitress.server import TcpWSGIServer _WSGIServerParams: TypeAlias = Incomplete def get_free_port() -> tuple[str, int]: ... -def check_server(host: str, port: int, path_info: str = "/", timeout: float = 3, retries: int = 30) -> int: ... +def check_server(host: str, port: int, path_info: str = "/", timeout: FloatInt = 3, retries: int = 30) -> int: ... class StopableWSGIServer(TcpWSGIServer): was_shutdown: bool diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi index 8b4e17c6e4a1..559f3a0bb1dc 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from logging import Logger from traceback import StackSummary @@ -12,19 +13,19 @@ ORIGIN_TRACE_HEADER_ATTR_KEY: Final = "_origin_trace_header" class Entity: id: str name: str - start_time: float + start_time: FloatInt parent_id: str | None sampled: bool in_progress: bool http: dict[str, dict[str, str | int]] - annotations: dict[str, float | str | bool] + annotations: dict[str, FloatInt | str | bool] metadata: dict[str, dict[str, Any]] # value is any object that can be serialized into JSON string aws: dict[str, Incomplete] cause: dict[str, str | list[Throwable]] subsegments: list[Subsegment] - end_time: float + end_time: FloatInt def __init__(self, name: str, entity_id: str | None = None) -> None: ... - def close(self, end_time: float | None = None) -> None: ... + def close(self, end_time: FloatInt | None = None) -> None: ... def add_subsegment(self, subsegment: Subsegment) -> None: ... def remove_subsegment(self, subsegment: Subsegment) -> None: ... @@ -33,7 +34,7 @@ class Entity: @overload def put_http_meta(self, key: Literal["url", "method", "user_agent", "client_ip", "x_forwarded_for"], value: str) -> None: ... - def put_annotation(self, key: str, value: float | str | bool) -> None: ... + def put_annotation(self, key: str, value: FloatInt | str | bool) -> None: ... def put_metadata( self, key: str, value: Any, namespace: str = "default" # value is any object that can be serialized into JSON string ) -> None: ... diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi index 27481f85870b..41b69bdcd06b 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable from types import TracebackType @@ -35,6 +36,6 @@ class Subsegment(Entity): def __init__(self, name: str, namespace: str, segment: Segment) -> None: ... def add_subsegment(self, subsegment: Subsegment) -> None: ... def remove_subsegment(self, subsegment: Subsegment) -> None: ... - def close(self, end_time: float | None = None) -> None: ... + def close(self, end_time: FloatInt | None = None) -> None: ... def set_sql(self, sql: dict[str, Incomplete]) -> None: ... def to_dict(self) -> dict[str, Incomplete]: ... diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/local/sampling_rule.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/local/sampling_rule.pyi index 418c386559e6..e788c03b912b 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/local/sampling_rule.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/local/sampling_rule.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import ClassVar, TypedDict, type_check_only from typing_extensions import NotRequired @@ -11,7 +12,7 @@ class _Rule(TypedDict): http_method: NotRequired[str] url_path: NotRequired[str] fixed_target: NotRequired[int] - rate: NotRequired[float] + rate: NotRequired[FloatInt] class SamplingRule: FIXED_TARGET: ClassVar[str] diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/rule_cache.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/rule_cache.pyi index e28044cf0880..260983bfd3e0 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/rule_cache.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/sampling/rule_cache.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt from typing import Final TTL: Final = 3600 class RuleCache: def __init__(self) -> None: ... - def get_matched_rule(self, sampling_req, now: float): ... + def get_matched_rule(self, sampling_req, now: FloatInt): ... def load_rules(self, rules) -> None: ... def load_targets(self, targets_dict) -> None: ... diff --git a/stubs/boltons/boltons/cacheutils.pyi b/stubs/boltons/boltons/cacheutils.pyi index 978da569d563..56c2e71d97c8 100644 --- a/stubs/boltons/boltons/cacheutils.pyi +++ b/stubs/boltons/boltons/cacheutils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import weakref from _typeshed import Incomplete, SupportsItems, SupportsKeysAndGetItem from collections.abc import Callable, Generator, Hashable, Iterable, Iterator, Mapping @@ -118,7 +119,7 @@ class cachedproperty(Generic[_KT, _VT]): class ThresholdCounter(Generic[_T]): total: int - def __init__(self, threshold: float = 0.001) -> None: ... + def __init__(self, threshold: FloatInt = 0.001) -> None: ... @property def threshold(self) -> float: ... def add(self, key: _T) -> None: ... diff --git a/stubs/boltons/boltons/ecoutils.pyi b/stubs/boltons/boltons/ecoutils.pyi index c02820701d97..819ae2722c3f 100644 --- a/stubs/boltons/boltons/ecoutils.pyi +++ b/stubs/boltons/boltons/ecoutils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any ECO_VERSION: str @@ -16,7 +17,7 @@ HAVE_THREADING: bool HAVE_IPV6: bool RLIMIT_FDS_SOFT: int RLIMIT_FDS_HARD: int -START_TIME_INFO: dict[str, str | float] +START_TIME_INFO: dict[str, str | FloatInt] def getrandbits(k: int) -> int: ... def get_python_info() -> dict[str, Any]: ... diff --git a/stubs/boltons/boltons/iterutils.pyi b/stubs/boltons/boltons/iterutils.pyi index cf0251567288..cc8843107d30 100644 --- a/stubs/boltons/boltons/iterutils.pyi +++ b/stubs/boltons/boltons/iterutils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Generator, Iterable from typing import TypeVar @@ -25,10 +26,10 @@ def pairwise(src, end=...): ... def pairwise_iter(src, end=...): ... def windowed(src, size, fill=...): ... def windowed_iter(src, size, fill=...): ... -def xfrange(stop, start=None, step: float = 1.0) -> Generator[Incomplete]: ... -def frange(stop, start=None, step: float = 1.0): ... -def backoff(start, stop, count=None, factor: float = 2.0, jitter: bool = False): ... -def backoff_iter(start, stop, count=None, factor: float = 2.0, jitter: bool = False) -> Generator[Incomplete]: ... +def xfrange(stop, start=None, step: FloatInt = 1.0) -> Generator[Incomplete]: ... +def frange(stop, start=None, step: FloatInt = 1.0): ... +def backoff(start, stop, count=None, factor: FloatInt = 2.0, jitter: bool = False): ... +def backoff_iter(start, stop, count=None, factor: FloatInt = 2.0, jitter: bool = False) -> Generator[Incomplete]: ... def bucketize(src, key=..., value_transform=None, key_filter=None): ... def partition(src, key=..., *keys: str | Callable[..., Incomplete]) -> tuple[list[Incomplete], ...]: ... def unique(src, key=None): ... diff --git a/stubs/boltons/boltons/jsonutils.pyi b/stubs/boltons/boltons/jsonutils.pyi index 276db26ef881..b46c565630f4 100644 --- a/stubs/boltons/boltons/jsonutils.pyi +++ b/stubs/boltons/boltons/jsonutils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Generator from typing import IO, Any, overload from typing_extensions import Self @@ -14,7 +15,7 @@ def reverse_iter_lines(file_obj: IO[str], blocksize: int, preseek: bool, encodin class JSONLIterator: ignore_errors: bool def __init__( - self, file_obj: IO[str], ignore_errors: bool = False, reverse: bool = False, rel_seek: float | None = None + self, file_obj: IO[str], ignore_errors: bool = False, reverse: bool = False, rel_seek: FloatInt | None = None ) -> None: ... @property def cur_byte_pos(self) -> int: ... diff --git a/stubs/boltons/boltons/mathutils.pyi b/stubs/boltons/boltons/mathutils.pyi index 42920bcf99a4..096cd435e98d 100644 --- a/stubs/boltons/boltons/mathutils.pyi +++ b/stubs/boltons/boltons/mathutils.pyi @@ -1,17 +1,18 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import overload -def clamp(x: float, lower: float = ..., upper: float = ...) -> float: ... +def clamp(x: FloatInt, lower: FloatInt = ..., upper: FloatInt = ...) -> float: ... @overload -def ceil(x: float, options: None = None) -> int: ... +def ceil(x: FloatInt, options: None = None) -> int: ... @overload -def ceil(x: float, options: Iterable[float]) -> float: ... +def ceil(x: FloatInt, options: Iterable[FloatInt]) -> float: ... @overload -def floor(x: float, options: None = None) -> int: ... +def floor(x: FloatInt, options: None = None) -> int: ... @overload -def floor(x: float, options: Iterable[float]) -> float: ... +def floor(x: FloatInt, options: Iterable[FloatInt]) -> float: ... class Bits: __slots__ = ("val", "len") diff --git a/stubs/boltons/boltons/socketutils.pyi b/stubs/boltons/boltons/socketutils.pyi index 30b438e689c3..24ea87c5e144 100644 --- a/stubs/boltons/boltons/socketutils.pyi +++ b/stubs/boltons/boltons/socketutils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import socket from _typeshed import ReadableBuffer, SliceableBuffer @@ -11,21 +12,21 @@ class BufferedSocket: maxsize: int timeout: int def __init__(self, sock: socket.socket, timeout: int = ..., maxsize: int = 32768, recvsize: int = ...) -> None: ... - def settimeout(self, timeout: float) -> None: ... + def settimeout(self, timeout: FloatInt) -> None: ... def gettimeout(self) -> float: ... def setblocking(self, blocking: bool) -> None: ... def setmaxsize(self, maxsize) -> None: ... def getrecvbuffer(self) -> bytes: ... def getsendbuffer(self) -> bytes: ... - def recv(self, size: int, flags: int = 0, timeout: float = ...) -> bytes: ... - def peek(self, size: int, timeout: float = ...) -> bytes: ... - def recv_close(self, timeout: float = ..., maxsize: int = ...) -> bytes: ... + def recv(self, size: int, flags: int = 0, timeout: FloatInt = ...) -> bytes: ... + def peek(self, size: int, timeout: FloatInt = ...) -> bytes: ... + def recv_close(self, timeout: FloatInt = ..., maxsize: int = ...) -> bytes: ... def recv_until( - self, delimiter: ReadableBuffer, timeout: float = ..., maxsize: int = ..., with_delimiter: bool = False + self, delimiter: ReadableBuffer, timeout: FloatInt = ..., maxsize: int = ..., with_delimiter: bool = False ) -> bytes: ... - def recv_size(self, size: int, timeout: float = ...) -> bytes: ... - def send(self, data: SliceableBuffer, flags: int = 0, timeout: float = ...) -> str: ... - def sendall(self, data: SliceableBuffer, flags: int = 0, timeout: float = ...) -> str: ... + def recv_size(self, size: int, timeout: FloatInt = ...) -> bytes: ... + def send(self, data: SliceableBuffer, flags: int = 0, timeout: FloatInt = ...) -> str: ... + def sendall(self, data: SliceableBuffer, flags: int = 0, timeout: FloatInt = ...) -> str: ... def flush(self) -> None: ... def buffer(self, data: SliceableBuffer) -> None: ... def getsockname(self) -> str: ... @@ -50,17 +51,17 @@ class MessageTooLong(Error): def __init__(self, bytes_read: int | None = None, delimiter: str | None = None) -> None: ... class Timeout(socket.timeout, Error): - def __init__(self, timeout: float, extra: str = "") -> None: ... + def __init__(self, timeout: FloatInt, extra: str = "") -> None: ... class NetstringSocket: bsock: BufferedSocket - timeout: float + timeout: FloatInt maxsize: int - def __init__(self, sock: socket.socket, timeout: float = 10, maxsize: int = 32768) -> None: ... + def __init__(self, sock: socket.socket, timeout: FloatInt = 10, maxsize: int = 32768) -> None: ... def fileno(self) -> int: ... - def settimeout(self, timeout: float) -> None: ... + def settimeout(self, timeout: FloatInt) -> None: ... def setmaxsize(self, maxsize: int) -> None: ... - def read_ns(self, timeout: float = ..., maxsize: int = ...): ... + def read_ns(self, timeout: FloatInt = ..., maxsize: int = ...): ... def write_ns(self, payload: bytes) -> None: ... class NetstringProtocolError(Error): ... diff --git a/stubs/boltons/boltons/statsutils.pyi b/stubs/boltons/boltons/statsutils.pyi index 4165b8a16373..998c174bbaee 100644 --- a/stubs/boltons/boltons/statsutils.pyi +++ b/stubs/boltons/boltons/statsutils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, Incomplete from collections.abc import Callable, Iterable, Iterator from typing import Any, Literal, overload @@ -16,16 +17,16 @@ class _StatsProperty: def __get__(self, obj: Stats, objtype: object = None) -> float: ... class Stats: - data: list[float] - default: float + data: list[FloatInt] + default: FloatInt @overload - def __init__(self, data: list[float], default: float = 0.0, *, use_copy: Literal[False], is_sorted: bool = False) -> None: ... + def __init__(self, data: list[FloatInt], default: FloatInt = 0.0, *, use_copy: Literal[False], is_sorted: bool = False) -> None: ... @overload - def __init__(self, data: list[float], default: float, use_copy: Literal[False], is_sorted: bool = False) -> None: ... + def __init__(self, data: list[FloatInt], default: FloatInt, use_copy: Literal[False], is_sorted: bool = False) -> None: ... @overload def __init__( - self, data: Iterable[float], default: float = 0.0, use_copy: Literal[True] = True, is_sorted: bool = False + self, data: Iterable[FloatInt], default: FloatInt = 0.0, use_copy: Literal[True] = True, is_sorted: bool = False ) -> None: ... def __len__(self) -> int: ... @@ -47,16 +48,16 @@ class Stats: kurtosis: _StatsProperty pearson_type: _StatsProperty def get_quantile(self, q: ConvertibleToFloat) -> float: ... - def get_zscore(self, value: float) -> float: ... - def trim_relative(self, amount: float = 0.15) -> None: ... - def get_histogram_counts(self, bins: int | list[float] | None = None, **kw) -> list[tuple[float, int]]: ... - def format_histogram(self, bins: int | list[float] | None = None, **kw) -> str: ... + def get_zscore(self, value: FloatInt) -> float: ... + def trim_relative(self, amount: FloatInt = 0.15) -> None: ... + def get_histogram_counts(self, bins: int | list[FloatInt] | None = None, **kw) -> list[tuple[float, int]]: ... + def format_histogram(self, bins: int | list[FloatInt] | None = None, **kw) -> str: ... def describe( - self, quantiles: Iterable[float] | None = None, format: str | None = None + self, quantiles: Iterable[FloatInt] | None = None, format: str | None = None ) -> dict[str, float] | list[tuple[str, float]] | str: ... def describe( - data: Iterable[float], quantiles: Iterable[float] | None = None, format: str | None = None + data: Iterable[FloatInt], quantiles: Iterable[FloatInt] | None = None, format: str | None = None ) -> dict[str, float] | list[tuple[str, float]] | str: ... mean: Incomplete @@ -72,5 +73,5 @@ kurtosis: Incomplete pearson_type: Incomplete def format_histogram_counts( - bin_counts: list[float], width: int | None = None, format_bin: Callable[..., Any] | None = None + bin_counts: list[FloatInt], width: int | None = None, format_bin: Callable[..., Any] | None = None ) -> str: ... diff --git a/stubs/capturer/capturer.pyi b/stubs/capturer/capturer.pyi index 0bd324a760ea..c1201eafb849 100644 --- a/stubs/capturer/capturer.pyi +++ b/stubs/capturer/capturer.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptorOrPath, SupportsWrite from collections.abc import Callable from io import BufferedReader @@ -13,7 +14,7 @@ __version__: str aliases: dict[str, Any] DEFAULT_TEXT_ENCODING: str GRACEFUL_SHUTDOWN_SIGNAL: Signals -TERMINATION_DELAY: float +TERMINATION_DELAY: FloatInt PARTIAL_DEFAULT: bool STDOUT_FD: int STDERR_FD: int @@ -35,7 +36,7 @@ class CaptureOutput(MultiProcessHelper): encoding: str merged: bool relay: bool - termination_delay: float + termination_delay: FloatInt pseudo_terminals: list[PseudoTerminal] streams: list[tuple[int, Stream]] stdout_stream: Stream @@ -45,7 +46,7 @@ class CaptureOutput(MultiProcessHelper): stdout: PseudoTerminal stderr: PseudoTerminal def __init__( - self, merged: bool = True, encoding: str = ..., termination_delay: float = ..., chunk_size: int = 1024, relay: bool = True + self, merged: bool = True, encoding: str = ..., termination_delay: FloatInt = ..., chunk_size: int = 1024, relay: bool = True ) -> None: ... def initialize_stream(self, file_obj: IO[str], expected_fd: int) -> Stream: ... def __enter__(self) -> Self: ... @@ -79,7 +80,7 @@ class OutputBuffer: class PseudoTerminal(MultiProcessHelper): encoding: str - termination_delay: float + termination_delay: FloatInt chunk_size: int relay_fd: int | None output_queue: Queue[tuple[Any, bytes]] | None @@ -92,7 +93,7 @@ class PseudoTerminal(MultiProcessHelper): def __init__( self, encoding: str, - termination_delay: float, + termination_delay: FloatInt, chunk_size: int, relay_fd: int | None, output_queue: Queue[tuple[int, bytes]] | None, diff --git a/stubs/cffi/cffi/api.pyi b/stubs/cffi/cffi/api.pyi index 05ea2daecbfc..962f62c1d1ab 100644 --- a/stubs/cffi/cffi/api.pyi +++ b/stubs/cffi/cffi/api.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys import types from _typeshed import ReadableBuffer, WriteableBuffer @@ -45,7 +46,7 @@ class FFI: free: Callable[[CData], Any] | None = None, should_clear_after_alloc: bool = True, ) -> _cffi_backend._Allocator: ... - def cast(self, cdecl: str | CType, source: CData | float) -> CData: ... + def cast(self, cdecl: str | CType, source: CData | FloatInt) -> CData: ... def string(self, cdata: CData, maxlen: int = -1) -> bytes | str: ... def unpack(self, cdata: CData, length: int) -> bytes | str | list[Any]: ... diff --git a/stubs/cffi/cffi/backend_ctypes.pyi b/stubs/cffi/cffi/backend_ctypes.pyi index 04c0e8a8ffbe..d25d98ad50c5 100644 --- a/stubs/cffi/cffi/backend_ctypes.pyi +++ b/stubs/cffi/cffi/backend_ctypes.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable unicode = str long = int xrange = range -bytechr: Callable[[float], bytes] +bytechr: Callable[[FloatInt], bytes] class CTypesType(type): ... diff --git a/stubs/channels/channels/layers.pyi b/stubs/channels/channels/layers.pyi index a527e5873b7e..b5a0bc899f14 100644 --- a/stubs/channels/channels/layers.pyi +++ b/stubs/channels/channels/layers.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import asyncio from re import Pattern from typing import Any, ClassVar, TypeAlias, overload @@ -65,11 +66,11 @@ class BaseChannelLayer: @deprecated("Use require_valid_group_name instead.") def valid_group_name(self, group_name: str) -> bool: ... -_InMemoryQueueData: TypeAlias = tuple[float, dict[str, Any]] +_InMemoryQueueData: TypeAlias = tuple[FloatInt, dict[str, Any]] class InMemoryChannelLayer(BaseChannelLayer): channels: dict[str, asyncio.Queue[_InMemoryQueueData]] - groups: dict[str, dict[str, float]] + groups: dict[str, dict[str, FloatInt]] group_expiry: int def __init__( diff --git a/stubs/channels/channels/testing/application.pyi b/stubs/channels/channels/testing/application.pyi index db3f567c1d61..ef2b79c84482 100644 --- a/stubs/channels/channels/testing/application.pyi +++ b/stubs/channels/channels/testing/application.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any from asgiref.testing import ApplicationCommunicator as BaseApplicationCommunicator @@ -11,11 +12,11 @@ class ApplicationCommunicator(BaseApplicationCommunicator): # - WebSocket: {"type": "websocket.receive", "bytes": b"binary data"} or {"text": "string"} # - Custom protocols: Application-specific message dictionaries async def send_input(self, message: dict[str, Any]) -> None: ... - async def receive_output(self, timeout: float = 1) -> dict[str, Any]: ... + async def receive_output(self, timeout: FloatInt = 1) -> dict[str, Any]: ... # The following methods are not present in the original source code, # but are commonly used in practice. Since the base package doesn't # provide type hints for them, they are added here to improve type correctness. - async def receive_nothing(self, timeout: float = 0.1, interval: float = 0.01) -> bool: ... - async def wait(self, timeout: float = 1) -> None: ... + async def receive_nothing(self, timeout: FloatInt = 0.1, interval: FloatInt = 0.01) -> bool: ... + async def wait(self, timeout: FloatInt = 1) -> None: ... def stop(self, exceptions: bool = True) -> None: ... diff --git a/stubs/channels/channels/testing/http.pyi b/stubs/channels/channels/testing/http.pyi index 6eb6650036c8..c589cfa6bea7 100644 --- a/stubs/channels/channels/testing/http.pyi +++ b/stubs/channels/channels/testing/http.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import Literal, TypedDict, type_check_only @@ -38,4 +39,4 @@ class HttpCommunicator(ApplicationCommunicator): body: bytes = b"", headers: Iterable[tuple[bytes, bytes]] | None = None, ) -> None: ... - async def get_response(self, timeout: float = 1) -> _HTTPTestResponse: ... + async def get_response(self, timeout: FloatInt = 1) -> _HTTPTestResponse: ... diff --git a/stubs/channels/channels/testing/websocket.pyi b/stubs/channels/channels/testing/websocket.pyi index 9b79d7dc10eb..f9aa1d661c47 100644 --- a/stubs/channels/channels/testing/websocket.pyi +++ b/stubs/channels/channels/testing/websocket.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import Any, Literal, TypeAlias, TypedDict, overload, type_check_only from typing_extensions import NotRequired @@ -40,9 +41,9 @@ class WebsocketCommunicator(ApplicationCommunicator): subprotocols: Iterable[str] | None = None, spec_version: int | None = None, ) -> None: ... - async def connect(self, timeout: float = 1) -> _WebsocketConnectResponse: ... + async def connect(self, timeout: FloatInt = 1) -> _WebsocketConnectResponse: ... async def send_to(self, text_data: str | None = None, bytes_data: bytes | None = None) -> None: ... - async def receive_from(self, timeout: float = 1) -> str | bytes: ... + async def receive_from(self, timeout: FloatInt = 1) -> str | bytes: ... # These overloads reflect common usage, where users typically send and receive `dict[str, Any]`. # The base case allows `Any` to support broader `json.dumps` / `json.loads` compatibility. @@ -51,5 +52,5 @@ class WebsocketCommunicator(ApplicationCommunicator): @overload async def send_json_to(self, data: Any) -> None: ... - async def receive_json_from(self, timeout: float = 1) -> Any: ... - async def disconnect(self, code: int = 1000, timeout: float = 1) -> None: ... + async def receive_json_from(self, timeout: FloatInt = 1) -> Any: ... + async def disconnect(self, code: int = 1000, timeout: FloatInt = 1) -> None: ... diff --git a/stubs/colorful/colorful/ansi.pyi b/stubs/colorful/colorful/ansi.pyi index ed25609c6766..453cadad10f7 100644 --- a/stubs/colorful/colorful/ansi.pyi +++ b/stubs/colorful/colorful/ansi.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final MODIFIERS: Final[dict[str, tuple[int, int]]] @@ -9,6 +10,6 @@ CSI: Final[str] ANSI_ESCAPE_CODE: Final[str] NEST_PLACEHOLDER: Final[str] -def round(value: float) -> int: ... +def round(value: FloatInt) -> int: ... def rgb_to_ansi256(r: int, g: int, b: int) -> int: ... def rgb_to_ansi16(r: int, g: int, b: int, use_bright: bool = False) -> int: ... diff --git a/stubs/console-menu/consolemenu/console_menu.pyi b/stubs/console-menu/consolemenu/console_menu.pyi index 49bbdd7cbe4e..f64b254bfba2 100644 --- a/stubs/console-menu/consolemenu/console_menu.pyi +++ b/stubs/console-menu/consolemenu/console_menu.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from consolemenu.menu_formatter import MenuFormatBuilder as MenuFormatBuilder @@ -49,11 +50,11 @@ class ConsoleMenu: def show(self, show_exit_option: bool | None = None) -> None: ... def draw(self) -> None: ... def is_running(self) -> bool: ... - def wait_for_start(self, timeout: float | None = None) -> bool: ... + def wait_for_start(self, timeout: FloatInt | None = None) -> bool: ... def is_alive(self) -> bool: ... def pause(self) -> None: ... def resume(self) -> None: ... - def join(self, timeout: float | None = None) -> None: ... + def join(self, timeout: FloatInt | None = None) -> None: ... def get_input(self) -> int: ... def process_user_input(self) -> int | None: ... def go_to(self, option: int) -> None: ... diff --git a/stubs/convertdate/convertdate/armenian.pyi b/stubs/convertdate/convertdate/armenian.pyi index 3ff93da6847c..36fec402b6ab 100644 --- a/stubs/convertdate/convertdate/armenian.pyi +++ b/stubs/convertdate/convertdate/armenian.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal EPOCH: Final = 1922501.5 @@ -7,7 +8,7 @@ MONTHS_ARM: Final[list[str]] def leap(year: int) -> bool: ... def to_jd(year: int, month: int, day: int, method: Literal["sarkawag", "moveable"] | None = None) -> float: ... -def from_jd(jd: float, method: Literal["sarkawag", "moveable"] | None = None) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt, method: Literal["sarkawag", "moveable"] | None = None) -> tuple[int, int, int]: ... def to_julian(year: int, month: int, day: int, method: Literal["sarkawag", "moveable"] | None = None) -> tuple[int, int, int]: ... def from_julian( year: int, month: int, day: int, method: Literal["sarkawag", "moveable"] | None = None diff --git a/stubs/convertdate/convertdate/bahai.pyi b/stubs/convertdate/convertdate/bahai.pyi index 53a426b839e3..6f6b4d39689b 100644 --- a/stubs/convertdate/convertdate/bahai.pyi +++ b/stubs/convertdate/convertdate/bahai.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final EPOCH: Final = 2394646.5 @@ -29,7 +30,7 @@ ALA: Final = 20 def gregorian_nawruz(year: int) -> tuple[int, int]: ... def to_jd(year: int, month: int, day: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int]: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def month_length(year: int, month: int) -> int: ... diff --git a/stubs/convertdate/convertdate/coptic.pyi b/stubs/convertdate/convertdate/coptic.pyi index dca579cabf68..93e829cc8db6 100644 --- a/stubs/convertdate/convertdate/coptic.pyi +++ b/stubs/convertdate/convertdate/coptic.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal EPOCH: Final = 1825029.5 @@ -6,7 +7,7 @@ WEEKDAYS: Final = ["Tkyriaka", "Pesnau", "Pshoment", "Peftoou", "Ptiou", "Psoou" def is_leap(year: int) -> bool: ... def to_jd(year: int, month: int, day: int) -> float: ... -def from_jd(jdc: float) -> tuple[int, int, int]: ... +def from_jd(jdc: FloatInt) -> tuple[int, int, int]: ... def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def month_length(year: int, month: int) -> Literal[5, 6, 30]: ... diff --git a/stubs/convertdate/convertdate/daycount.pyi b/stubs/convertdate/convertdate/daycount.pyi index e2029ede976e..91c4a79445b4 100644 --- a/stubs/convertdate/convertdate/daycount.pyi +++ b/stubs/convertdate/convertdate/daycount.pyi @@ -1,12 +1,13 @@ +from _typeshed import FloatInt import datetime class DayCount: - epoch: float - def __init__(self, epoch: float) -> None: ... + epoch: FloatInt + def __init__(self, epoch: FloatInt) -> None: ... def to_gregorian(self, dc: int) -> tuple[int, int, int]: ... def from_gregorian(self, year: int, month: int, day: int) -> float: ... def to_jd(self, dc: int) -> float: ... - def from_jd(self, jdc: float) -> float: ... + def from_jd(self, jdc: FloatInt) -> float: ... def from_julian(self, year: int, month: int, day: int) -> float: ... def to_julian(self, dc: int) -> tuple[int, int, int]: ... def to_datetime(self, dc: int) -> datetime.datetime: ... diff --git a/stubs/convertdate/convertdate/dublin.pyi b/stubs/convertdate/convertdate/dublin.pyi index 5c28661a945c..8cd00824037a 100644 --- a/stubs/convertdate/convertdate/dublin.pyi +++ b/stubs/convertdate/convertdate/dublin.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from typing import Final @@ -6,7 +7,7 @@ EPOCH: Final = 2415020 def to_gregorian(dc: int) -> tuple[int, int, int]: ... def from_gregorian(year: int, month: int, day: int) -> float: ... def to_jd(dc: int) -> float: ... -def from_jd(jdc: float) -> float: ... +def from_jd(jdc: FloatInt) -> float: ... def from_julian(year: int, month: int, day: int) -> float: ... def to_julian(dc: int) -> tuple[int, int, int]: ... def to_datetime(dc: int) -> datetime.datetime: ... diff --git a/stubs/convertdate/convertdate/french_republican.pyi b/stubs/convertdate/convertdate/french_republican.pyi index d8c0c029a7ba..2575b6923f7e 100644 --- a/stubs/convertdate/convertdate/french_republican.pyi +++ b/stubs/convertdate/convertdate/french_republican.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal EPOCH: Final = 2375839.5 @@ -9,14 +10,14 @@ LEAP_CYCLE_DAYS: Final = 1461.0 LEAP_CYCLE_YEARS: Final = 4.0 def leap(year: int, method: Literal[4, 100, 128, "continuous", "madler", "romme", "equinox"] | None = None) -> bool: ... -def premier_da_la_annee(jd: float) -> float: ... +def premier_da_la_annee(jd: FloatInt) -> float: ... def to_jd( year: int, month: int, day: int, method: Literal[4, 100, 128, "continuous", "madler", "romme", "equinox"] | None = None ) -> float: ... def from_jd( - jd: float, method: Literal[4, 100, 128, "continuous", "madler", "romme", "equinox"] | None = None + jd: FloatInt, method: Literal[4, 100, 128, "continuous", "madler", "romme", "equinox"] | None = None ) -> tuple[int, int, int]: ... -def decade(jour: float) -> int: ... +def decade(jour: FloatInt) -> int: ... def day_name(month: int, day: int) -> str: ... def from_gregorian( year: int, month: int, day: int, method: Literal[4, 100, 128, "continuous", "madler", "romme", "equinox"] | None = None diff --git a/stubs/convertdate/convertdate/gregorian.pyi b/stubs/convertdate/convertdate/gregorian.pyi index 8d9c2df9044a..2e67f953b632 100644 --- a/stubs/convertdate/convertdate/gregorian.pyi +++ b/stubs/convertdate/convertdate/gregorian.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal EPOCH: Final = 1721425.5 @@ -14,7 +15,7 @@ HAVE_31_DAYS: Final = (1, 3, 5, 7, 8, 10, 12) def legal_date(year: int, month: int, day: int) -> Literal[True]: ... def to_jd2(year: int, month: int, day: int) -> float: ... def to_jd(year: int, month: int, day: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int]: ... def month_length(year: int, month: int) -> int: ... def monthcalendar(year: int, month: int) -> list[list[int | None]]: ... def format(year: int, month: int, day: int, format_string: str = "%-d %B %y") -> str: ... diff --git a/stubs/convertdate/convertdate/hebrew.pyi b/stubs/convertdate/convertdate/hebrew.pyi index dfe5544d185d..fe79fdf56c82 100644 --- a/stubs/convertdate/convertdate/hebrew.pyi +++ b/stubs/convertdate/convertdate/hebrew.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal from typing_extensions import deprecated @@ -28,7 +29,7 @@ def month_length(year: int, month: int) -> Literal[29, 30]: ... @deprecated("The `month_days` function is deprecated. Use `month_length` instead.") def month_days(year: int, month: int) -> Literal[29, 30]: ... def to_jd(year: int, month: int, day: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int]: ... def to_civil(year: int, month: int, day: int) -> tuple[int, int, int]: ... def to_jd_gregorianyear(gregorianyear: int, hebrew_month: int, hebrew_day: int) -> float: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... diff --git a/stubs/convertdate/convertdate/indian_civil.pyi b/stubs/convertdate/convertdate/indian_civil.pyi index d3121e0f3bba..64131c3299a4 100644 --- a/stubs/convertdate/convertdate/indian_civil.pyi +++ b/stubs/convertdate/convertdate/indian_civil.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal WEEKDAYS: Final = ("Ravivāra", "Somavāra", "Maṅgalavāra", "Budhavāra", "Guruvāra", "Śukravāra", "Śanivāra") @@ -7,7 +8,7 @@ HAVE_30_DAYS: Final = (7, 8, 9, 10, 11, 12) SAKA_EPOCH: Final = 78 def to_jd(year: int, month: int, day: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int]: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def month_length(year: int, month: int) -> Literal[30, 31]: ... diff --git a/stubs/convertdate/convertdate/islamic.pyi b/stubs/convertdate/convertdate/islamic.pyi index a1b29ee695c9..07840c66e259 100644 --- a/stubs/convertdate/convertdate/islamic.pyi +++ b/stubs/convertdate/convertdate/islamic.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal EPOCH: Final = 1948439.5 @@ -8,7 +9,7 @@ HAS_30_DAYS: Final = (1, 3, 5, 7, 9, 11) def leap(year: int) -> bool: ... def to_jd(year: int, month: int, day: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int]: ... def to_jd_gregorianyear(gregorianyear: int, islamic_month: int, islamic_day: int) -> float: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... diff --git a/stubs/convertdate/convertdate/iso.pyi b/stubs/convertdate/convertdate/iso.pyi index f8f6021cf11a..3be29604554d 100644 --- a/stubs/convertdate/convertdate/iso.pyi +++ b/stubs/convertdate/convertdate/iso.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from typing import Final, Literal @@ -10,7 +11,7 @@ SAT: Final = 5 SUN: Final = 6 def to_jd(year: int, week: int, day: int) -> float: ... -def from_jd(jd: float) -> datetime._IsoCalendarDate: ... +def from_jd(jd: FloatInt) -> datetime._IsoCalendarDate: ... def weeks_per_year(year: int) -> Literal[52, 53]: ... def from_gregorian(year: int, month: int, day: int) -> datetime._IsoCalendarDate: ... def to_gregorian(year: int, week: int, day: int) -> tuple[int, int, int]: ... diff --git a/stubs/convertdate/convertdate/julian.pyi b/stubs/convertdate/convertdate/julian.pyi index 4ef363bb981c..695e54bc0d85 100644 --- a/stubs/convertdate/convertdate/julian.pyi +++ b/stubs/convertdate/convertdate/julian.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal J0000: Final = 1721424.5 @@ -12,7 +13,7 @@ HAVE_31_DAYS: Final = (1, 3, 5, 7, 8, 10, 12) def leap(year: int) -> bool: ... def month_length(year: int, month: int) -> Literal[28, 29, 30, 31]: ... def legal_date(year: int, month: int, day: int) -> Literal[True]: ... -def from_jd(jd: float) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int]: ... def to_jd(year: int, month: int, day: int) -> float: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... diff --git a/stubs/convertdate/convertdate/julianday.pyi b/stubs/convertdate/convertdate/julianday.pyi index cedad663b7ab..887fa4705232 100644 --- a/stubs/convertdate/convertdate/julianday.pyi +++ b/stubs/convertdate/convertdate/julianday.pyi @@ -1,8 +1,9 @@ +from _typeshed import FloatInt import datetime -def to_datetime(jdc: float) -> datetime.datetime: ... +def to_datetime(jdc: FloatInt) -> datetime.datetime: ... def from_datetime(dt: datetime.datetime) -> float: ... -def to_gregorian(jdc: float) -> tuple[int, int, int]: ... +def to_gregorian(jdc: FloatInt) -> tuple[int, int, int]: ... def from_gregorian(year: int, month: int, day: int) -> float: ... -def to_julian(jdc: float) -> tuple[int, int, int]: ... +def to_julian(jdc: FloatInt) -> tuple[int, int, int]: ... def from_julian(year: int, month: int, day: int) -> float: ... diff --git a/stubs/convertdate/convertdate/mayan.pyi b/stubs/convertdate/convertdate/mayan.pyi index 310f04093135..78a927026e02 100644 --- a/stubs/convertdate/convertdate/mayan.pyi +++ b/stubs/convertdate/convertdate/mayan.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Unused from collections.abc import Generator from typing import Final, Literal, overload @@ -10,11 +11,11 @@ TZOLKIN: Final[list[str]] TZOLKIN_TRANSLATIONS: Final[list[str]] def to_jd(baktun: int, katun: int, tun: int, uinal: int, kin: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int, int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int, int, int]: ... def to_gregorian(baktun: int, katun: int, tun: int, uinal: int, kin: int) -> tuple[int, int, int]: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int, int, int]: ... -def to_haab(jd: float) -> tuple[int, str]: ... -def to_tzolkin(jd: float) -> tuple[int, str]: ... +def to_haab(jd: FloatInt) -> tuple[int, str]: ... +def to_tzolkin(jd: FloatInt) -> tuple[int, str]: ... def lc_to_haab(baktun: int, katun: int, tun: int, uinal: int, kin: int) -> tuple[int, str]: ... def lc_to_tzolkin(baktun: int, katun: int, tun: int, uinal: int, kin: int) -> tuple[int, str]: ... def lc_to_haab_tzolkin(baktun: int, katun: int, tun: int, uinal: int, kin: int) -> str: ... @@ -24,9 +25,9 @@ def tzolkin_generator(number: int | None = None, name: str | None = None) -> Gen def longcount_generator( baktun: int, katun: int, tun: int, uinal: int, kin: int ) -> Generator[tuple[int, int, int, int, int], None, Never]: ... -def next_haab(month: str, jd: float) -> float: ... -def next_tzolkin(tzolkin: tuple[int, str], jd: float) -> float: ... -def next_tzolkin_haab(tzolkin: tuple[int, str], haab: tuple[int, str], jd: float) -> float: ... +def next_haab(month: str, jd: FloatInt) -> float: ... +def next_tzolkin(tzolkin: tuple[int, str], jd: FloatInt) -> float: ... +def next_tzolkin_haab(tzolkin: tuple[int, str], haab: tuple[int, str], jd: FloatInt) -> float: ... def month_length(month: str) -> Literal[5, 20]: ... @overload @@ -35,9 +36,9 @@ def haab_monthcalendar( ) -> list[list[tuple[int | None, tuple[int, str] | None, tuple[int, int, int, int, int] | None]]]: ... @overload def haab_monthcalendar( - baktun: Unused = None, katun: Unused = None, tun: Unused = None, uinal: Unused = None, kin: Unused = None, jdc: float = ... + baktun: Unused = None, katun: Unused = None, tun: Unused = None, uinal: Unused = None, kin: Unused = None, jdc: FloatInt = ... ) -> list[list[tuple[int | None, tuple[int, str] | None, tuple[int, int, int, int, int] | None]]]: ... def haab_monthcalendar_prospective( - haabmonth: str, jdc: float + haabmonth: str, jdc: FloatInt ) -> list[list[tuple[int | None, tuple[int, str] | None, tuple[int, int, int, int, int] | None]]]: ... diff --git a/stubs/convertdate/convertdate/ordinal.pyi b/stubs/convertdate/convertdate/ordinal.pyi index 893fc7abb1be..93829d2dfffe 100644 --- a/stubs/convertdate/convertdate/ordinal.pyi +++ b/stubs/convertdate/convertdate/ordinal.pyi @@ -1,4 +1,5 @@ +from _typeshed import FloatInt def to_jd(year: int, dayofyear: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int]: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int]: ... def to_gregorian(year: int, dayofyear: int) -> tuple[int, int, int]: ... diff --git a/stubs/convertdate/convertdate/persian.pyi b/stubs/convertdate/convertdate/persian.pyi index 35746af8adc7..5c9a4d00d992 100644 --- a/stubs/convertdate/convertdate/persian.pyi +++ b/stubs/convertdate/convertdate/persian.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal EPOCH: Final = 1948320.5 @@ -8,10 +9,10 @@ HAS_30_DAYS: Final = (7, 8, 9, 10, 11) def leap(year: int) -> bool: ... def equinox_jd(gyear: int) -> int: ... -def last_equinox_jd(jd: float) -> int: ... -def jd_to_pyear(jd: float) -> tuple[int, int]: ... +def last_equinox_jd(jd: FloatInt) -> int: ... +def jd_to_pyear(jd: FloatInt) -> tuple[int, int]: ... def to_jd(year: int, month: int, day: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int]: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def month_length(year: int, month: int) -> Literal[29, 30, 31]: ... diff --git a/stubs/convertdate/convertdate/positivist.pyi b/stubs/convertdate/convertdate/positivist.pyi index 51dcfd398dc4..467cd13ac6f4 100644 --- a/stubs/convertdate/convertdate/positivist.pyi +++ b/stubs/convertdate/convertdate/positivist.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Literal EPOCH: Final = 2374479.5 @@ -7,7 +8,7 @@ MONTHS: Final[tuple[str, ...]] def legal_date(year: int, month: int, day: int) -> Literal[True]: ... def to_jd(year: int, month: int, day: int) -> float: ... -def from_jd(jd: float) -> tuple[int, int, int]: ... +def from_jd(jd: FloatInt) -> tuple[int, int, int]: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def to_gregorian(year: int, month: int, day: int) -> tuple[int, int, int]: ... def dayname(year: int, month: int, day: int) -> tuple[str, str]: ... diff --git a/stubs/convertdate/convertdate/utils.pyi b/stubs/convertdate/convertdate/utils.pyi index 3e6f89a2e981..d628b57c88e4 100644 --- a/stubs/convertdate/convertdate/utils.pyi +++ b/stubs/convertdate/convertdate/utils.pyi @@ -1,53 +1,54 @@ +from _typeshed import FloatInt from typing import Final, Literal, overload -TROPICALYEAR: Final[float] +TROPICALYEAR: Final[FloatInt] @overload -def amod(a: float, b: int) -> int: ... +def amod(a: FloatInt, b: int) -> int: ... @overload -def amod(a: float, b: float) -> float: ... +def amod(a: FloatInt, b: FloatInt) -> float: ... -def jwday(j: float) -> int: ... +def jwday(j: FloatInt) -> int: ... @overload def weekday_before(weekday: int, jd: int) -> int: ... @overload -def weekday_before(weekday: int, jd: float) -> float: ... +def weekday_before(weekday: int, jd: FloatInt) -> float: ... @overload def search_weekday(weekday: int, jd: int, direction: Literal[-1, 1], offset: int) -> int: ... @overload -def search_weekday(weekday: int, jd: float, direction: Literal[-1, 1], offset: int) -> float: ... +def search_weekday(weekday: int, jd: FloatInt, direction: Literal[-1, 1], offset: int) -> float: ... @overload def nearest_weekday(weekday: int, jd: int) -> int: ... @overload -def nearest_weekday(weekday: int, jd: float) -> float: ... +def nearest_weekday(weekday: int, jd: FloatInt) -> float: ... @overload def next_weekday(weekday: int, jd: int) -> int: ... @overload -def next_weekday(weekday: int, jd: float) -> float: ... +def next_weekday(weekday: int, jd: FloatInt) -> float: ... @overload def next_or_current_weekday(weekday: int, jd: int) -> int: ... @overload -def next_or_current_weekday(weekday: int, jd: float) -> float: ... +def next_or_current_weekday(weekday: int, jd: FloatInt) -> float: ... @overload def previous_weekday(weekday: int, jd: int) -> int: ... @overload -def previous_weekday(weekday: int, jd: float) -> float: ... +def previous_weekday(weekday: int, jd: FloatInt) -> float: ... @overload def previous_or_current_weekday(weekday: int, jd: int) -> int: ... @overload -def previous_or_current_weekday(weekday: int, jd: float) -> float: ... +def previous_or_current_weekday(weekday: int, jd: FloatInt) -> float: ... @overload def n_weeks(weekday: int, jd: int, nthweek: int) -> int: ... @overload -def n_weeks(weekday: int, jd: float, nthweek: int) -> float: ... +def n_weeks(weekday: int, jd: FloatInt, nthweek: int) -> float: ... def monthcalendarhelper(start_weekday: int, month_length: int) -> list[list[int | None]]: ... def nth_day_of_month(n: int, weekday: int, month: int, year: int) -> tuple[int, int, int]: ... diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index ce5ecf5a59cf..2bdc3acbcfe0 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from _typeshed import Unused from collections.abc import Generator, Iterable @@ -14,11 +15,11 @@ ExpandedExpression: TypeAlias = list[int | Literal["*", "l"]] class _AllIter(Protocol[_R_co]): @overload def __call__( - self, ret_type: type[_R2_co], start_time: float | datetime.datetime | None = None, update_current: bool | None = None + self, ret_type: type[_R2_co], start_time: FloatInt | datetime.datetime | None = None, update_current: bool | None = None ) -> Generator[_R2_co]: ... @overload def __call__( - self, ret_type: None = None, start_time: float | datetime.datetime | None = None, update_current: bool | None = None + self, ret_type: None = None, start_time: FloatInt | datetime.datetime | None = None, update_current: bool | None = None ) -> Generator[_R_co]: ... def is_32bit() -> bool: ... @@ -104,9 +105,9 @@ class croniter(Generic[_R_co]): second_at_beginning: bool tzinfo: datetime.tzinfo | None - start_time: float - dst_start_time: float - cur: float + start_time: FloatInt + dst_start_time: FloatInt + cur: FloatInt expanded: list[list[str]] nth_weekday_of_month: dict[str, set[int]] @@ -118,7 +119,7 @@ class croniter(Generic[_R_co]): def __new__( cls, expr_format: str, - start_time: float | datetime.datetime | None = None, + start_time: FloatInt | datetime.datetime | None = None, ret_type: type[float] = ..., day_or: bool = True, max_years_between_matches: int | None = None, @@ -132,7 +133,7 @@ class croniter(Generic[_R_co]): def __new__( cls, expr_format: str, - start_time: float | datetime.datetime | None, + start_time: FloatInt | datetime.datetime | None, ret_type: type[datetime.datetime], day_or: bool = True, max_years_between_matches: int | None = None, @@ -160,7 +161,7 @@ class croniter(Generic[_R_co]): def __init__( self, expr_format: str, - start_time: float | datetime.datetime | None = None, + start_time: FloatInt | datetime.datetime | None = None, ret_type: type[_R_co] = ..., day_or: bool = True, max_years_between_matches: int | None = None, @@ -173,20 +174,20 @@ class croniter(Generic[_R_co]): @overload def get_next( - self, ret_type: type[_R2_co], start_time: float | datetime.datetime | None = None, update_current: bool = True + self, ret_type: type[_R2_co], start_time: FloatInt | datetime.datetime | None = None, update_current: bool = True ) -> _R2_co: ... @overload def get_next( - self, ret_type: None = None, start_time: float | datetime.datetime | None = None, update_current: bool = True + self, ret_type: None = None, start_time: FloatInt | datetime.datetime | None = None, update_current: bool = True ) -> _R_co: ... @overload def get_prev( - self, ret_type: type[_R2_co], start_time: float | datetime.datetime | None = None, update_current: bool = True + self, ret_type: type[_R2_co], start_time: FloatInt | datetime.datetime | None = None, update_current: bool = True ) -> _R2_co: ... @overload def get_prev( - self, ret_type: None = None, start_time: float | datetime.datetime | None = None, update_current: bool = True + self, ret_type: None = None, start_time: FloatInt | datetime.datetime | None = None, update_current: bool = True ) -> _R_co: ... @overload @@ -194,27 +195,27 @@ class croniter(Generic[_R_co]): @overload def get_current(self, ret_type: None = None) -> _R_co: ... - def set_current(self, start_time: float | datetime.datetime | None, force: bool = True) -> float: ... + def set_current(self, start_time: FloatInt | datetime.datetime | None, force: bool = True) -> float: ... @staticmethod def datetime_to_timestamp(d: datetime.datetime) -> float: ... - def timestamp_to_datetime(self, timestamp: float, tzinfo: datetime.tzinfo | None = ...) -> datetime.datetime: ... + def timestamp_to_datetime(self, timestamp: FloatInt, tzinfo: datetime.tzinfo | None = ...) -> datetime.datetime: ... @overload def all_next( - self, ret_type: type[_R2_co], start_time: float | datetime.datetime | None = None, update_current: bool | None = None + self, ret_type: type[_R2_co], start_time: FloatInt | datetime.datetime | None = None, update_current: bool | None = None ) -> Generator[_R2_co]: ... @overload def all_next( - self, ret_type: None = None, start_time: float | datetime.datetime | None = None, update_current: bool | None = None + self, ret_type: None = None, start_time: FloatInt | datetime.datetime | None = None, update_current: bool | None = None ) -> Generator[_R_co]: ... @overload def all_prev( - self, ret_type: type[_R2_co], start_time: float | datetime.datetime | None = None, update_current: bool | None = None + self, ret_type: type[_R2_co], start_time: FloatInt | datetime.datetime | None = None, update_current: bool | None = None ) -> Generator[_R2_co]: ... @overload def all_prev( - self, ret_type: None = None, start_time: float | datetime.datetime | None = None, update_current: bool | None = None + self, ret_type: None = None, start_time: FloatInt | datetime.datetime | None = None, update_current: bool | None = None ) -> Generator[_R_co]: ... def iter(self, *args: Unused, **kwargs: Unused) -> _AllIter[_R_co]: ... @@ -224,7 +225,7 @@ class croniter(Generic[_R_co]): def next( self, ret_type: type[_R2_co], - start_time: float | datetime.datetime | None = None, + start_time: FloatInt | datetime.datetime | None = None, is_prev: bool | None = None, update_current: bool | None = None, ) -> _R2_co: ... @@ -232,7 +233,7 @@ class croniter(Generic[_R_co]): def next( self, ret_type: None = None, - start_time: float | datetime.datetime | None = None, + start_time: FloatInt | datetime.datetime | None = None, is_prev: bool | None = None, update_current: bool | None = None, ) -> _R_co: ... @@ -252,7 +253,7 @@ class croniter(Generic[_R_co]): expr_format: str, hash_id: bytes | None = None, second_at_beginning: bool = False, - from_timestamp: float | None = None, + from_timestamp: FloatInt | None = None, strict: bool = False, strict_year: int | Iterable[int] | None = None, ) -> tuple[list[ExpandedExpression], dict[str, set[int]]]: ... @@ -270,7 +271,7 @@ class croniter(Generic[_R_co]): def match( cls, cron_expression: str, - testdate: float | datetime.datetime | None, + testdate: FloatInt | datetime.datetime | None, day_or: bool = True, second_at_beginning: bool = False, precision_in_seconds: int | None = None, @@ -288,8 +289,8 @@ class croniter(Generic[_R_co]): @overload def croniter_range( - start: float | datetime.datetime, - stop: float | datetime.datetime, + start: FloatInt | datetime.datetime, + stop: FloatInt | datetime.datetime, expr_format: str, ret_type: type[_R2_co], day_or: bool = True, @@ -300,8 +301,8 @@ def croniter_range( ) -> Generator[_R2_co]: ... @overload def croniter_range( - start: float, - stop: float | datetime.datetime, + start: FloatInt, + stop: FloatInt | datetime.datetime, expr_format: str, ret_type: None = None, day_or: bool = True, @@ -313,7 +314,7 @@ def croniter_range( @overload def croniter_range( start: datetime.datetime, - stop: float | datetime.datetime, + stop: FloatInt | datetime.datetime, expr_format: str, ret_type: None = None, day_or: bool = True, diff --git a/stubs/dateparser/dateparser/__init__.pyi b/stubs/dateparser/dateparser/__init__.pyi index 2f772d4714cb..4d6ea4e6fc18 100644 --- a/stubs/dateparser/dateparser/__init__.pyi +++ b/stubs/dateparser/dateparser/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from typing import Any, Final, Literal, TypedDict, type_check_only @@ -31,7 +32,7 @@ class _Settings(TypedDict, total=False): # noqa: Y049 DEFAULT_DAYS_IN_MONTH: int PARSERS: list[Literal["timestamp", "relative-time", "custom-formats", "absolute-time", "no-spaces-time"]] DEFAULT_LANGUAGES: list[str] - LANGUAGE_DETECTION_CONFIDENCE_THRESHOLD: float + LANGUAGE_DETECTION_CONFIDENCE_THRESHOLD: FloatInt CACHE_SIZE_LIMIT: int def parse( diff --git a/stubs/dateparser/dateparser/conf.pyi b/stubs/dateparser/dateparser/conf.pyi index ad80b028637e..9988233a0595 100644 --- a/stubs/dateparser/dateparser/conf.pyi +++ b/stubs/dateparser/dateparser/conf.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from collections.abc import Callable from typing import Any, Literal, ParamSpec, TypeVar @@ -29,7 +30,7 @@ class Settings: DEFAULT_DAYS_IN_MONTH: int PARSERS: list[Literal["timestamp", "relative-time", "custom-formats", "absolute-time", "no-spaces-time"]] DEFAULT_LANGUAGES: list[str] - LANGUAGE_DETECTION_CONFIDENCE_THRESHOLD: float + LANGUAGE_DETECTION_CONFIDENCE_THRESHOLD: FloatInt CACHE_SIZE_LIMIT: int def __new__(cls, *args, **kwargs) -> Self: ... diff --git a/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi b/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi index e7440af40333..704e4e1320c4 100644 --- a/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi +++ b/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi @@ -1 +1,2 @@ -def detect_languages(text: str, confidence_threshold: float) -> list[str]: ... +from _typeshed import FloatInt +def detect_languages(text: str, confidence_threshold: FloatInt) -> list[str]: ... diff --git a/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi b/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi index e7440af40333..704e4e1320c4 100644 --- a/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi +++ b/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi @@ -1 +1,2 @@ -def detect_languages(text: str, confidence_threshold: float) -> list[str]: ... +from _typeshed import FloatInt +def detect_languages(text: str, confidence_threshold: FloatInt) -> list[str]: ... diff --git a/stubs/dateparser/dateparser/date.pyi b/stubs/dateparser/dateparser/date.pyi index 465e738b3806..846d291c43d7 100644 --- a/stubs/dateparser/dateparser/date.pyi +++ b/stubs/dateparser/dateparser/date.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re from _typeshed import Incomplete from collections import OrderedDict @@ -11,7 +12,7 @@ from dateparser.languages.locale import Locale _DateT = TypeVar("_DateT", bound=date) -_DetectLanguagesFunction: TypeAlias = Callable[[str, float], list[str]] +_DetectLanguagesFunction: TypeAlias = Callable[[str, FloatInt], list[str]] _Period: TypeAlias = Literal["time", "day", "week", "month", "year"] # Work around attribute and type having the same name. _Weekday: TypeAlias = Incomplete # Actually it's dateutil._common.weekday class diff --git a/stubs/docker/docker/api/container.pyi b/stubs/docker/docker/api/container.pyi index 09322cad2948..ab8016431198 100644 --- a/stubs/docker/docker/api/container.pyi +++ b/stubs/docker/docker/api/container.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from _typeshed import Incomplete from collections.abc import Iterable, Mapping @@ -259,9 +260,9 @@ class ContainerApiMixin: stream: Literal[True], timestamps: bool = False, tail: Literal["all"] | int = "all", - since: datetime.datetime | float | None = None, + since: datetime.datetime | FloatInt | None = None, follow: bool | None = None, - until: datetime.datetime | float | None = None, + until: datetime.datetime | FloatInt | None = None, ) -> CancellableStream[bytes]: ... @overload def logs( @@ -272,9 +273,9 @@ class ContainerApiMixin: stream: Literal[True], timestamps: bool = False, tail: Literal["all"] | int = "all", - since: datetime.datetime | float | None = None, + since: datetime.datetime | FloatInt | None = None, follow: bool | None = None, - until: datetime.datetime | float | None = None, + until: datetime.datetime | FloatInt | None = None, ) -> CancellableStream[bytes]: ... @overload def logs( @@ -285,9 +286,9 @@ class ContainerApiMixin: stream: Literal[False] = False, timestamps: bool = False, tail: Literal["all"] | int = "all", - since: datetime.datetime | float | None = None, + since: datetime.datetime | FloatInt | None = None, follow: bool | None = None, - until: datetime.datetime | float | None = None, + until: datetime.datetime | FloatInt | None = None, ) -> bytes: ... def pause(self, container: _Container) -> None: ... @@ -312,8 +313,8 @@ class ContainerApiMixin: cpu_shares: int | None = None, cpuset_cpus: str | None = None, cpuset_mems: str | None = None, - mem_limit: float | str | None = None, - mem_reservation: float | str | None = None, + mem_limit: FloatInt | str | None = None, + mem_reservation: FloatInt | str | None = None, memswap_limit: int | str | None = None, kernel_memory: int | str | None = None, restart_policy: _RestartPolicy | None = None, diff --git a/stubs/docker/docker/models/containers.pyi b/stubs/docker/docker/models/containers.pyi index f6cb0353801d..f727d7596051 100644 --- a/stubs/docker/docker/models/containers.pyi +++ b/stubs/docker/docker/models/containers.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from _io import _BufferedReaderStream from builtins import list as _list @@ -113,9 +114,9 @@ class Container(Model): stream: Literal[True], timestamps: bool = False, tail: Literal["all"] | int = "all", - since: datetime.datetime | float | None = None, + since: datetime.datetime | FloatInt | None = None, follow: bool | None = None, - until: datetime.datetime | float | None = None, + until: datetime.datetime | FloatInt | None = None, ) -> CancellableStream[bytes]: ... @overload def logs( @@ -126,9 +127,9 @@ class Container(Model): stream: Literal[False] = False, timestamps: bool = False, tail: Literal["all"] | int = "all", - since: datetime.datetime | float | None = None, + since: datetime.datetime | FloatInt | None = None, follow: bool | None = None, - until: datetime.datetime | float | None = None, + until: datetime.datetime | FloatInt | None = None, ) -> bytes: ... def pause(self) -> None: ... @@ -138,7 +139,7 @@ class Container(Model): def rename(self, name: str) -> None: ... def resize(self, height: int, width: int) -> None: ... # Please keep in sync with docker.api.container.ContainerApiMixin.restart - def restart(self, *, timeout: float | None = 10) -> None: ... + def restart(self, *, timeout: FloatInt | None = 10) -> None: ... # Please keep in sync with docker.api.container.ContainerApiMixin.start def start(self) -> None: ... # Please keep in sync with docker.api.container.ContainerApiMixin.stats @@ -146,7 +147,7 @@ class Container(Model): self, *, decode: bool | None = None, stream: bool = True, one_shot: bool | None = None ) -> Iterator[dict[str, Any]] | dict[str, Any]: ... # Please keep in sync with docker.api.container.ContainerApiMixin.stop - def stop(self, *, timeout: float | None = None) -> None: ... + def stop(self, *, timeout: FloatInt | None = None) -> None: ... # Please keep in sync with docker.api.container.ContainerApiMixin.top def top(self, *, ps_args: str | None = None) -> _TopResult: ... def unpause(self) -> None: ... @@ -160,15 +161,15 @@ class Container(Model): cpu_shares: int | None = None, cpuset_cpus: str | None = None, cpuset_mems: str | None = None, - mem_limit: float | str | None = None, - mem_reservation: float | str | None = None, + mem_limit: FloatInt | str | None = None, + mem_reservation: FloatInt | str | None = None, memswap_limit: int | str | None = None, kernel_memory: int | str | None = None, restart_policy: _RestartPolicy | None = None, ): ... # Please keep in sync with docker.api.container.ContainerApiMixin.wait def wait( - self, *, timeout: float | None = None, condition: Literal["not-running", "next-exit", "removed"] | None = None + self, *, timeout: FloatInt | None = None, condition: Literal["not-running", "next-exit", "removed"] | None = None ) -> WaitContainerResponse: ... class ContainerCollection(Collection[Container]): diff --git a/stubs/docker/docker/transport/npipesocket.pyi b/stubs/docker/docker/transport/npipesocket.pyi index f68d4785b082..65fa3b7db766 100644 --- a/stubs/docker/docker/transport/npipesocket.pyi +++ b/stubs/docker/docker/transport/npipesocket.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import io from _typeshed import ReadableBuffer from typing import Any, Literal, TypeAlias @@ -39,7 +40,7 @@ class NpipeSocket: def sendall(self, string: str, flags: int = 0) -> int: ... def sendto(self, string: str, address: str) -> int: ... def setblocking(self, flag: bool) -> None: ... - def settimeout(self, value: float | None) -> None: ... + def settimeout(self, value: FloatInt | None) -> None: ... def gettimeout(self) -> int | None: ... # NotImplementedError def setsockopt(self, level, optname, value) -> Never: ... diff --git a/stubs/docker/docker/types/services.pyi b/stubs/docker/docker/types/services.pyi index b82487a83824..a76a95516bda 100644 --- a/stubs/docker/docker/types/services.pyi +++ b/stubs/docker/docker/types/services.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Mapping from typing import Any, Final, Literal, TypedDict, TypeVar, overload, type_check_only @@ -99,7 +100,7 @@ class UpdateConfig(dict[str, Any]): delay: int | None = None, failure_action: Literal["pause", "continue", "rollback"] = "continue", monitor: int | None = None, - max_failure_ratio: float | None = None, + max_failure_ratio: FloatInt | None = None, order: Literal["start-first", "stop-first"] | None = None, ) -> None: ... diff --git a/stubs/docker/docker/utils/utils.pyi b/stubs/docker/docker/utils/utils.pyi index 7b248df23535..654f094bf314 100644 --- a/stubs/docker/docker/utils/utils.pyi +++ b/stubs/docker/docker/utils/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from _typeshed import FileDescriptorOrPath, ReadableBuffer, Unused from collections.abc import Iterable, Mapping @@ -66,7 +67,7 @@ def parse_devices(devices: Iterable[str | dict[str, str]]) -> list[dict[str, str def kwargs_from_env(environment: Mapping[str, str] | None = None) -> _EnvKWArgs: ... def convert_filters(filters) -> str: ... def datetime_to_timestamp(dt: datetime.datetime) -> int: ... -def parse_bytes(s: float | str) -> float: ... +def parse_bytes(s: FloatInt | str) -> float: ... def normalize_links(links: dict[str, str] | dict[str, None] | dict[str, str | None] | Iterable[tuple[str, str | None]]): ... def parse_env_file(env_file: FileDescriptorOrPath) -> dict[str, str]: ... def split_command(command: str | _ShlexInstream) -> list[str]: ... diff --git a/stubs/docutils/docutils/nodes.pyi b/stubs/docutils/docutils/nodes.pyi index f8a06dd40a1a..2a387ce45c67 100644 --- a/stubs/docutils/docutils/nodes.pyi +++ b/stubs/docutils/docutils/nodes.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys import xml.dom.minidom from _typeshed import Incomplete, MaybeNone, StrPath @@ -772,7 +773,7 @@ def create_keyword_validator(*keywords: str) -> Callable[[str], str]: ... def validate_identifier(value: str) -> str: ... def validate_identifier_list(value: str | list[str]) -> list[str]: ... def validate_measure(measure: str) -> str: ... -def validate_colwidth(measure: str | float) -> float: ... +def validate_colwidth(measure: str | FloatInt) -> float: ... def validate_NMTOKEN(value: str) -> str: ... def validate_NMTOKENS(value: str | list[str]) -> list[str]: ... def validate_refname_list(value: str | list[str]) -> list[str]: ... diff --git a/stubs/docutils/docutils/utils/math/latex2mathml.pyi b/stubs/docutils/docutils/utils/math/latex2mathml.pyi index 8adda7596f3a..2f599e8acbe1 100644 --- a/stubs/docutils/docutils/utils/math/latex2mathml.pyi +++ b/stubs/docutils/docutils/utils/math/latex2mathml.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from docutils.utils.math.mathml_elements import MathElement, mover, msub, msubsup, msup, mtd, munder, munderover @@ -15,8 +16,8 @@ small_operators: dict[str, str] movablelimits: tuple[str, ...] spaces: dict[str, str] accents: dict[str, str] -over: dict[str, tuple[str, float]] -under: dict[str, tuple[str, float]] +over: dict[str, tuple[str, FloatInt]] +under: dict[str, tuple[str, FloatInt]] anomalous_chars: dict[str, str] mathbb: dict[str, str] matrices: dict[str, tuple[str, str]] diff --git a/stubs/docutils/docutils/writers/manpage.pyi b/stubs/docutils/docutils/writers/manpage.pyi index 9b9606008bb3..8bedfa24dc2f 100644 --- a/stubs/docutils/docutils/writers/manpage.pyi +++ b/stubs/docutils/docutils/writers/manpage.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re from _typeshed import Incomplete from collections.abc import Callable @@ -17,8 +18,8 @@ __docformat__: Final = "reStructuredText" FIELD_LIST_INDENT: Final[int] DEFINITION_LIST_INDENT: Final[int] OPTION_LIST_INDENT: Final[int] -BLOCKQOUTE_INDENT: Final[float] -LITERAL_BLOCK_INDENT: Final[float] +BLOCKQOUTE_INDENT: Final[FloatInt] +LITERAL_BLOCK_INDENT: Final[FloatInt] MACRO_DEF: Final[str] NONPRINTING_BREAKPOINT: Final[str] NONBREAKING_INSERT_RE: Final[re.Pattern[str]] @@ -184,7 +185,7 @@ class Translator(nodes.NodeVisitor): def depart_math_block(self, node: nodes.math_block) -> None: ... def visit_note(self, node: nodes.note) -> None: ... def depart_note(self, node: nodes.note) -> None: ... - def indent(self, by: float = 0.5) -> None: ... + def indent(self, by: FloatInt = 0.5) -> None: ... def dedent(self) -> None: ... def visit_option_list(self, node: nodes.option_list) -> None: ... def depart_option_list(self, node: nodes.option_list) -> None: ... diff --git a/stubs/docutils/docutils/writers/odf_odt/__init__.pyi b/stubs/docutils/docutils/writers/odf_odt/__init__.pyi index d9a6795a9438..fbae10479f99 100644 --- a/stubs/docutils/docutils/writers/odf_odt/__init__.pyi +++ b/stubs/docutils/docutils/writers/odf_odt/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import itertools import re import zipfile @@ -357,7 +358,7 @@ class ODFTranslator(nodes.GenericNodeVisitor): def depart_system_message(self, node: nodes.system_message) -> None: ... def get_table_style(self, node) -> TableStyle: ... current_table_style: _ElementInterfaceWrapper - table_width: float + table_width: FloatInt def visit_table(self, node: nodes.table) -> None: ... def depart_table(self, node: nodes.table) -> None: ... def visit_tgroup(self, node: nodes.tgroup) -> None: ... diff --git a/stubs/ephem/ephem/__init__.pyi b/stubs/ephem/ephem/__init__.pyi index 477799ef2be7..21931b3fe47f 100644 --- a/stubs/ephem/ephem/__init__.pyi +++ b/stubs/ephem/ephem/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from datetime import datetime as _datetime, timedelta as _timedelta, tzinfo as _tzinfo from typing import Final, overload @@ -8,28 +9,28 @@ from . import _libastro __version__: Final[str] # Mathematical constants -tau: Final[float] -twopi: Final[float] -halfpi: Final[float] -quarterpi: Final[float] -eighthpi: Final[float] -degree: Final[float] -arcminute: Final[float] -arcsecond: Final[float] -half_arcsecond: Final[float] -tiny: Final[float] +tau: Final[FloatInt] +twopi: Final[FloatInt] +halfpi: Final[FloatInt] +quarterpi: Final[FloatInt] +eighthpi: Final[FloatInt] +degree: Final[FloatInt] +arcminute: Final[FloatInt] +arcsecond: Final[FloatInt] +half_arcsecond: Final[FloatInt] +tiny: Final[FloatInt] # Physical constants -c: Final[float] -meters_per_au: Final[float] -earth_radius: Final[float] -moon_radius: Final[float] -sun_radius: Final[float] +c: Final[FloatInt] +meters_per_au: Final[FloatInt] +earth_radius: Final[FloatInt] +moon_radius: Final[FloatInt] +sun_radius: Final[FloatInt] # Epoch constants -B1900: Final[float] -B1950: Final[float] -J2000: Final[float] +B1900: Final[FloatInt] +B1950: Final[FloatInt] +J2000: Final[FloatInt] # Type imports from _libastro Angle = _libastro.Angle @@ -38,12 +39,12 @@ hours = _libastro.hours Date = _libastro.Date # Time constants -hour: Final[float] -minute: Final[float] -second: Final[float] +hour: Final[FloatInt] +minute: Final[FloatInt] +second: Final[FloatInt] # Precision constants -default_newton_precision: Final[float] +default_newton_precision: Final[FloatInt] rise_set_iterations: Final[tuple[int, int, int, int, int, int, int]] # Function imports from _libastro @@ -159,10 +160,10 @@ class Miranda(PlanetMoon): __planet__: Final = 28 # Newton's method -def newton(f: Callable[[float], float], x0: float, x1: float, precision: float = ...) -> float: ... +def newton(f: Callable[[FloatInt], float], x0: FloatInt, x1: FloatInt, precision: FloatInt = ...) -> float: ... # Equinox and solstice functions -def holiday(d0: _libastro._DateInitType, motion: float, offset: float) -> Date: ... +def holiday(d0: _libastro._DateInitType, motion: FloatInt, offset: FloatInt) -> Date: ... def previous_vernal_equinox(date: _libastro._DateInitType) -> Date: ... def next_vernal_equinox(date: _libastro._DateInitType) -> Date: ... def previous_summer_solstice(date: _libastro._DateInitType) -> Date: ... @@ -212,7 +213,7 @@ class Observer(_libastro.Observer): def next_transit(self, body: Body, start: _libastro._DateInitType | None = None) -> Date: ... def previous_antitransit(self, body: Body, start: _libastro._DateInitType | None = None) -> Date: ... def next_antitransit(self, body: Body, start: _libastro._DateInitType | None = None) -> Date: ... - def disallow_circumpolar(self, declination: float) -> None: ... + def disallow_circumpolar(self, declination: FloatInt) -> None: ... def previous_rising(self, body: Body, start: _libastro._DateInitType | None = None, use_center: bool = False) -> Date: ... def previous_setting(self, body: Body, start: _libastro._DateInitType | None = None, use_center: bool = False) -> Date: ... def next_rising(self, body: Body, start: _libastro._DateInitType | None = None, use_center: bool = False) -> Date: ... @@ -222,7 +223,7 @@ class Observer(_libastro.Observer): ) -> tuple[Date | None, Date | None, Date | None, Date | None, Date | None, Date | None]: ... # Time conversion functions -def localtime(date: Date | float) -> _datetime: ... +def localtime(date: Date | FloatInt) -> _datetime: ... class _UTC(_tzinfo): ZERO: _timedelta @@ -232,7 +233,7 @@ class _UTC(_tzinfo): UTC: _UTC -def to_timezone(date: Date | float, tzinfo: _tzinfo) -> _datetime: ... +def to_timezone(date: Date | FloatInt, tzinfo: _tzinfo) -> _datetime: ... # Coordinate classes class Coordinate: @@ -241,7 +242,7 @@ class Coordinate: @overload def __init__(self, body: Body, *, epoch: _libastro._DateInitType | None = None) -> None: ... @overload - def __init__(self, coord1: float | str, coord2: float | str, *, epoch: _libastro._DateInitType | None = None) -> None: ... + def __init__(self, coord1: FloatInt | str, coord2: FloatInt | str, *, epoch: _libastro._DateInitType | None = None) -> None: ... @overload def __init__(self, coord: Coordinate, *, epoch: _libastro._DateInitType | None = None) -> None: ... @@ -250,7 +251,7 @@ class Equatorial(Coordinate): dec: Angle def get(self) -> tuple[Angle, Angle]: ... - def set(self, ra: float | str, dec: float | str) -> None: ... + def set(self, ra: FloatInt | str, dec: FloatInt | str) -> None: ... to_radec = get from_radec = set @@ -259,7 +260,7 @@ class LonLatCoordinate(Coordinate): lon: Angle lat: Angle - def set(self, lon: float | str, lat: float | str) -> None: ... + def set(self, lon: FloatInt | str, lat: FloatInt | str) -> None: ... def get(self) -> tuple[Angle, Angle]: ... @property @@ -269,11 +270,11 @@ class LonLatCoordinate(Coordinate): class Ecliptic(LonLatCoordinate): def to_radec(self) -> tuple[Angle, Angle]: ... - def from_radec(self, ra: float | str, dec: float | str) -> None: ... + def from_radec(self, ra: FloatInt | str, dec: FloatInt | str) -> None: ... class Galactic(LonLatCoordinate): def to_radec(self) -> tuple[Angle, Angle]: ... - def from_radec(self, ra: float | str, dec: float | str) -> None: ... + def from_radec(self, ra: FloatInt | str, dec: FloatInt | str) -> None: ... # Backwards compatibility aliases date = Date diff --git a/stubs/ephem/ephem/_libastro.pyi b/stubs/ephem/ephem/_libastro.pyi index 1d21f7e04c70..0428663272bd 100644 --- a/stubs/ephem/ephem/_libastro.pyi +++ b/stubs/ephem/ephem/_libastro.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import builtins from _typeshed import Unused from datetime import datetime as _datetime @@ -6,14 +7,14 @@ from typing_extensions import Never, Self, deprecated, disjoint_base _DateInitType: TypeAlias = ( Date - | float + | FloatInt | str | tuple[int] | tuple[int, int] - | tuple[int, int, float] - | tuple[int, int, float, float] - | tuple[int, int, float, float, float] - | tuple[int, int, float, float, float, float] + | tuple[int, int, FloatInt] + | tuple[int, int, FloatInt, FloatInt] + | tuple[int, int, FloatInt, FloatInt, FloatInt] + | tuple[int, int, FloatInt, FloatInt, FloatInt, FloatInt] | _datetime ) @@ -33,7 +34,7 @@ class _AngleDescriptorRadiansHours: @overload def __get__(self, obj: object, objtype: type | None = None) -> Angle: ... - def __set__(self, obj: object, value: float | str) -> None: ... + def __set__(self, obj: object, value: FloatInt | str) -> None: ... @type_check_only class _AngleDescriptorRadiansDegrees: @@ -42,7 +43,7 @@ class _AngleDescriptorRadiansDegrees: @overload def __get__(self, obj: object, objtype: type | None = None) -> Angle: ... - def __set__(self, obj: object, value: float | str) -> None: ... + def __set__(self, obj: object, value: FloatInt | str) -> None: ... @type_check_only class _AngleDescriptorDegreesRadians: @@ -55,14 +56,14 @@ class _AngleDescriptorDegreesRadians: @deprecated("Do not pass Angle objects! The radian value will be incorrectly interpreted as degrees.") def __set__(self, obj: object, value: Angle) -> None: ... @overload - def __set__(self, obj: object, value: float | str) -> None: ... + def __set__(self, obj: object, value: FloatInt | str) -> None: ... -J2000: Final[float] -MJD0: Final[float] -earth_radius: Final[float] -meters_per_au: Final[float] -moon_radius: Final[float] -sun_radius: Final[float] +J2000: Final[FloatInt] +MJD0: Final[FloatInt] +earth_radius: Final[FloatInt] +meters_per_au: Final[FloatInt] +moon_radius: Final[FloatInt] +sun_radius: Final[FloatInt] @disjoint_base class Angle(float): # type: ignore[type-var] @@ -87,18 +88,18 @@ class Observer: lat: _AngleDescriptorRadiansDegrees lon: _AngleDescriptorRadiansDegrees long: _AngleDescriptorRadiansDegrees - elevation: float - elev: float - temp: float - temperature: float - pressure: float + elevation: FloatInt + elev: FloatInt + temp: FloatInt + temperature: FloatInt + pressure: FloatInt horizon: _AngleDescriptorRadiansDegrees epoch: _DateDescriptor date: _DateDescriptor def __init__(self) -> None: ... def sidereal_time(self) -> Angle: ... - def radec_of(self, az: float | str, alt: float | str) -> tuple[Angle, Angle]: ... + def radec_of(self, az: FloatInt | str, alt: FloatInt | str) -> tuple[Angle, Angle]: ... @disjoint_base class Body: @@ -259,15 +260,15 @@ class PlanetMoon: class FixedBody(Body): name: str | None - mag: float + mag: FloatInt _spect: str - _ratio: float + _ratio: FloatInt _pa: _AngleDescriptorRadiansDegrees _epoch: _DateDescriptor _ra: _AngleDescriptorRadiansHours _dec: _AngleDescriptorRadiansDegrees - _pmra: float - _pmdec: float + _pmra: FloatInt + _pmdec: FloatInt _class: str def __init__(self) -> None: ... @@ -280,13 +281,13 @@ class EllipticalBody(Planet): _M: _AngleDescriptorDegreesRadians _epoch_M: _DateDescriptor _epoch: _DateDescriptor - _H: float - _G: float - _g: float - _k: float - _a: float - _size: float - _e: float + _H: FloatInt + _G: FloatInt + _g: FloatInt + _k: FloatInt + _a: FloatInt + _size: FloatInt + _e: FloatInt def __init__(self, *args: Unused, **kwargs: Unused) -> None: ... @@ -297,10 +298,10 @@ class ParabolicBody(Planet): _inc: _AngleDescriptorDegreesRadians _om: _AngleDescriptorDegreesRadians _Om: _AngleDescriptorDegreesRadians - _q: float - _g: float - _k: float - _size: float + _q: FloatInt + _g: FloatInt + _k: FloatInt + _size: FloatInt def __init__(self, *args: Unused, **kwargs: Unused) -> None: ... @@ -311,11 +312,11 @@ class HyperbolicBody(Planet): _inc: _AngleDescriptorDegreesRadians _Om: _AngleDescriptorDegreesRadians _om: _AngleDescriptorDegreesRadians - _e: float - _q: float - _g: float - _k: float - _size: float + _e: FloatInt + _q: FloatInt + _g: FloatInt + _k: FloatInt + _size: FloatInt def __init__(self, *args: Unused, **kwargs: Unused) -> None: ... @@ -328,19 +329,19 @@ class EarthSatellite(Body): _raan: _AngleDescriptorDegreesRadians _ap: _AngleDescriptorDegreesRadians _M: _AngleDescriptorDegreesRadians - n: float - inc: float - raan: float - e: float - ap: float - M: float - decay: float - drag: float - orbit: float - _n: float - _e: float - _decay: float - _drag: float + n: FloatInt + inc: FloatInt + raan: FloatInt + e: FloatInt + ap: FloatInt + M: FloatInt + decay: FloatInt + drag: FloatInt + orbit: FloatInt + _n: FloatInt + _e: FloatInt + _decay: FloatInt + _drag: FloatInt _orbit: int catalog_number: str | None @@ -363,32 +364,32 @@ class _MoonPhases(TypedDict): full: Date def builtin_planets() -> list[tuple[int, str, str]]: ... -def degrees(angle: float | str, /) -> Angle: ... -def hours(angle: float | str, /) -> Angle: ... +def degrees(angle: FloatInt | str, /) -> Angle: ... +def hours(angle: FloatInt | str, /) -> Angle: ... def now() -> Date: ... def separation( - obj1: tuple[float | str, float | str] | Body | Observer, obj2: tuple[float | str, float | str] | Body | Observer, / + obj1: tuple[FloatInt | str, FloatInt | str] | Body | Observer, obj2: tuple[FloatInt | str, FloatInt | str] | Body | Observer, / ) -> Angle: ... def readdb(db_line: str, /) -> Body: ... def readtle(name: str, line1: str, line2: str, /) -> EarthSatellite: ... -def unrefract(pressure: float, temperature: float, apparent_alt: float, /) -> Angle: ... -def uranometria(ra: float | str, dec: float | str, /) -> int: ... -def uranometria2000(ra: float | str, dec: float | str, /) -> int: ... -def millennium_atlas(ra: float | str, dec: float | str, /) -> int: ... +def unrefract(pressure: FloatInt, temperature: FloatInt, apparent_alt: FloatInt, /) -> Angle: ... +def uranometria(ra: FloatInt | str, dec: FloatInt | str, /) -> int: ... +def uranometria2000(ra: FloatInt | str, dec: FloatInt | str, /) -> int: ... +def millennium_atlas(ra: FloatInt | str, dec: FloatInt | str, /) -> int: ... @overload def constellation(position: Body) -> tuple[str, str]: ... @overload -def constellation(position: tuple[Angle | float, Angle | float], epoch: Date | float = ...) -> tuple[str, str]: ... +def constellation(position: tuple[Angle | FloatInt, Angle | FloatInt], epoch: Date | FloatInt = ...) -> tuple[str, str]: ... def julian_date(date: _DateInitType | Observer = ..., /) -> float: ... def delta_t(date: _DateInitType | Observer = ..., /) -> float: ... def moon_phases(date: _DateInitType | Observer = ...) -> _MoonPhases: ... -def eq_ecl(epoch: Date | float, ra: Angle | float, dec: Angle | float, /) -> tuple[Angle, Angle]: ... -def ecl_eq(epoch: Date | float, lon: Angle | float, lat: Angle | float, /) -> tuple[Angle, Angle]: ... -def eq_gal(epoch: Date | float, ra: Angle | float, dec: Angle | float, /) -> tuple[Angle, Angle]: ... -def gal_eq(epoch: Date | float, glon: Angle | float, glat: Angle | float, /) -> tuple[Angle, Angle]: ... -def precess(epoch1: Date | float, epoch2: Date | float, ra: Angle | float, dec: Angle | float, /) -> tuple[Angle, Angle]: ... +def eq_ecl(epoch: Date | FloatInt, ra: Angle | FloatInt, dec: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... +def ecl_eq(epoch: Date | FloatInt, lon: Angle | FloatInt, lat: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... +def eq_gal(epoch: Date | FloatInt, ra: Angle | FloatInt, dec: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... +def gal_eq(epoch: Date | FloatInt, glon: Angle | FloatInt, glat: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... +def precess(epoch1: Date | FloatInt, epoch2: Date | FloatInt, ra: Angle | FloatInt, dec: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... def _next_pass( observer: Observer, body: Body, / ) -> tuple[Date | None, Angle | None, Date | None, Angle | None, Date | None, Angle | None]: ... diff --git a/stubs/flake8/flake8/formatting/base.pyi b/stubs/flake8/flake8/formatting/base.pyi index 8401cdf00ce1..32f788f68c33 100644 --- a/stubs/flake8/flake8/formatting/base.pyi +++ b/stubs/flake8/flake8/formatting/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import argparse from _typeshed import Incomplete @@ -18,7 +19,7 @@ class BaseFormatter: def handle(self, error: Violation) -> None: ... def format(self, error: Violation) -> str | None: ... def show_statistics(self, statistics: Statistics) -> None: ... - def show_benchmarks(self, benchmarks: list[tuple[str, float]]) -> None: ... + def show_benchmarks(self, benchmarks: list[tuple[str, FloatInt]]) -> None: ... def show_source(self, error: Violation) -> str | None: ... def write(self, line: str | None, source: str | None) -> None: ... def _write(self, output: str) -> None: ... diff --git a/stubs/geojson/geojson/geometry.pyi b/stubs/geojson/geojson/geometry.pyi index 57e2f1918e5c..3e068b6af2c0 100644 --- a/stubs/geojson/geojson/geometry.pyi +++ b/stubs/geojson/geojson/geometry.pyi @@ -1,11 +1,12 @@ +from _typeshed import FloatInt from collections.abc import Sequence from decimal import Decimal from typing import TypeAlias from geojson.base import GeoJSON -_InputCoord: TypeAlias = float | Decimal | Geometry | Sequence[_InputCoord] -_CleanCoord: TypeAlias = float | Decimal | list[_CleanCoord] +_InputCoord: TypeAlias = FloatInt | Decimal | Geometry | Sequence[_InputCoord] +_CleanCoord: TypeAlias = FloatInt | Decimal | list[_CleanCoord] DEFAULT_PRECISION: int diff --git a/stubs/geojson/geojson/utils.pyi b/stubs/geojson/geojson/utils.pyi index 9e35c35bfc81..e9896e9d97c0 100644 --- a/stubs/geojson/geojson/utils.pyi +++ b/stubs/geojson/geojson/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Generator from typing import Any, Literal @@ -12,5 +13,5 @@ def map_geometries(func: Callable[[Incomplete], float | Geometry], obj: GeoJSON def generate_random( featureType: Literal["Point", "LineString", "Polygon"], numberVertices: int = 3, - boundingBox: list[float] = [-180.0, -90.0, 180.0, 90.0], + boundingBox: list[FloatInt] = [-180.0, -90.0, 180.0, 90.0], ) -> Point | LineString | Polygon: ... diff --git a/stubs/geopandas/geopandas/array.pyi b/stubs/geopandas/geopandas/array.pyi index 818dede50df4..67b8fe31ab71 100644 --- a/stubs/geopandas/geopandas/array.pyi +++ b/stubs/geopandas/geopandas/array.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import builtins from _typeshed import Incomplete, Unused from collections.abc import Callable, Collection @@ -84,8 +85,8 @@ class GeometryArray(ExtensionArray): @property def is_valid(self) -> _Array1D[np.bool_]: ... def is_valid_reason(self) -> _Array1D[np.object_]: ... - def is_valid_coverage(self, gap_width: float = 0.0) -> bool: ... - def invalid_coverage_edges(self, gap_width: float = 0.0) -> _Array1D[np.object_]: ... + def is_valid_coverage(self, gap_width: FloatInt = 0.0) -> bool: ... + def invalid_coverage_edges(self, gap_width: FloatInt = 0.0) -> _Array1D[np.object_]: ... @property def is_empty(self) -> _Array1D[np.bool_]: ... @property @@ -115,7 +116,7 @@ class GeometryArray(ExtensionArray): def boundary(self) -> GeometryArray: ... @property def centroid(self) -> GeometryArray: ... - def concave_hull(self, ratio: float, allow_holes: bool) -> _Array1D[np.object_]: ... + def concave_hull(self, ratio: FloatInt, allow_holes: bool) -> _Array1D[np.object_]: ... def constrained_delaunay_triangles(self) -> GeometryArray: ... @property def convex_hull(self) -> GeometryArray: ... @@ -127,17 +128,17 @@ class GeometryArray(ExtensionArray): def extract_unique_points(self) -> GeometryArray: ... def offset_curve( self, - distance: float | ArrayLike, + distance: FloatInt | ArrayLike, quad_segs: int = 8, join_style: Literal["round", "bevel", "mitre"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, ) -> GeometryArray: ... @property def interiors(self) -> _Array1D[np.object_]: ... - def remove_repeated_points(self, tolerance: float | ArrayLike = 0.0) -> GeometryArray: ... + def remove_repeated_points(self, tolerance: FloatInt | ArrayLike = 0.0) -> GeometryArray: ... def representative_point(self) -> GeometryArray: ... def minimum_bounding_circle(self) -> GeometryArray: ... - def maximum_inscribed_circle(self, tolerance: float | ArrayLike) -> GeometryArray: ... + def maximum_inscribed_circle(self, tolerance: FloatInt | ArrayLike) -> GeometryArray: ... def minimum_bounding_radius(self) -> _Array1D[np.float64]: ... def minimum_clearance(self) -> _Array1D[np.float64]: ... def minimum_clearance_line(self) -> GeometryArray: ... @@ -145,15 +146,15 @@ class GeometryArray(ExtensionArray): def orient_polygons(self, exterior_cw: bool = False) -> GeometryArray: ... def make_valid(self, method: Literal["linework", "structure"] = "linework", keep_collapsed: bool = True) -> GeometryArray: ... def reverse(self) -> GeometryArray: ... - def segmentize(self, max_segment_length: float | ArrayLike) -> GeometryArray: ... + def segmentize(self, max_segment_length: FloatInt | ArrayLike) -> GeometryArray: ... def force_2d(self) -> GeometryArray: ... - def force_3d(self, z: float | ArrayLike = 0) -> GeometryArray: ... + def force_3d(self, z: FloatInt | ArrayLike = 0) -> GeometryArray: ... def transform( self, transformation: Callable[[NDArray[np.float64]], NDArray[np.float64]], include_z: bool = False ) -> GeometryArray: ... def line_merge(self, directed: bool = False) -> GeometryArray: ... def set_precision( - self, grid_size: float, mode: Literal["valid_output", "pointwise", "keep_collapsed", 0, 1, 2] = "valid_output" + self, grid_size: FloatInt, mode: Literal["valid_output", "pointwise", "keep_collapsed", 0, 1, 2] = "valid_output" ) -> GeometryArray: ... def covers(self, other: _ArrayOrGeom) -> _Array1D[np.bool_]: ... def covered_by(self, other: _ArrayOrGeom) -> _Array1D[np.bool_]: ... @@ -166,41 +167,41 @@ class GeometryArray(ExtensionArray): def overlaps(self, other: _ArrayOrGeom) -> _Array1D[np.bool_]: ... def touches(self, other: _ArrayOrGeom) -> _Array1D[np.bool_]: ... def within(self, other: _ArrayOrGeom) -> _Array1D[np.bool_]: ... - def dwithin(self, other: _ArrayOrGeom, distance: float) -> _Array1D[np.bool_]: ... - def geom_equals_exact(self, other: _ArrayOrGeom, tolerance: float | ArrayLike) -> _Array1D[np.bool_]: ... + def dwithin(self, other: _ArrayOrGeom, distance: FloatInt) -> _Array1D[np.bool_]: ... + def geom_equals_exact(self, other: _ArrayOrGeom, tolerance: FloatInt | ArrayLike) -> _Array1D[np.bool_]: ... def geom_equals_identical(self, other: _ArrayOrGeom) -> _Array1D[np.bool_]: ... - def clip_by_rect(self, xmin: float, ymin: float, xmax: float, ymax: float) -> GeometryArray: ... - def difference(self, other: _ArrayOrGeom, grid_size: float | None = None) -> GeometryArray: ... - def intersection(self, other: _ArrayOrGeom, grid_size: float | None = None) -> GeometryArray: ... - def symmetric_difference(self, other: _ArrayOrGeom, grid_size: float | None = None) -> GeometryArray: ... - def union(self, other: _ArrayOrGeom, grid_size: float | None = None) -> GeometryArray: ... + def clip_by_rect(self, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt) -> GeometryArray: ... + def difference(self, other: _ArrayOrGeom, grid_size: FloatInt | None = None) -> GeometryArray: ... + def intersection(self, other: _ArrayOrGeom, grid_size: FloatInt | None = None) -> GeometryArray: ... + def symmetric_difference(self, other: _ArrayOrGeom, grid_size: FloatInt | None = None) -> GeometryArray: ... + def union(self, other: _ArrayOrGeom, grid_size: FloatInt | None = None) -> GeometryArray: ... def shortest_line(self, other: _ArrayOrGeom) -> GeometryArray: ... - def snap(self, other: _ArrayOrGeom, tolerance: float | ArrayLike) -> GeometryArray: ... + def snap(self, other: _ArrayOrGeom, tolerance: FloatInt | ArrayLike) -> GeometryArray: ... def shared_paths(self, other: _ArrayOrGeom) -> GeometryArray: ... def distance(self, other: _ArrayOrGeom) -> _Array1D[np.float64]: ... def hausdorff_distance(self, other: _ArrayOrGeom, **kwargs) -> _Array1D[np.float64]: ... def frechet_distance(self, other: _ArrayOrGeom, **kwargs) -> _Array1D[np.float64]: ... - def buffer(self, distance: float | ArrayLike, quad_segs: int | None = None, **kwargs) -> GeometryArray: ... - def interpolate(self, distance: float | ArrayLike, normalized: bool = False) -> GeometryArray: ... # type: ignore[override] - def simplify(self, tolerance: float | ArrayLike, preserve_topology: bool = True) -> GeometryArray: ... - def simplify_coverage(self, tolerance: float | ArrayLike, simplify_boundary: bool = True) -> GeometryArray: ... + def buffer(self, distance: FloatInt | ArrayLike, quad_segs: int | None = None, **kwargs) -> GeometryArray: ... + def interpolate(self, distance: FloatInt | ArrayLike, normalized: bool = False) -> GeometryArray: ... # type: ignore[override] + def simplify(self, tolerance: FloatInt | ArrayLike, preserve_topology: bool = True) -> GeometryArray: ... + def simplify_coverage(self, tolerance: FloatInt | ArrayLike, simplify_boundary: bool = True) -> GeometryArray: ... def project(self, other: _ArrayOrGeom, normalized: bool = False) -> _Array1D[np.float64]: ... def relate(self, other: _ArrayOrGeom) -> _Array1D[np.str_]: ... def relate_pattern(self, other: _ArrayOrGeom, pattern: str) -> _Array1D[np.bool_]: ... @deprecated("Use method `union_all` instead.") def unary_union(self) -> BaseGeometry: ... def union_all( - self, method: Literal["coverage", "unary", "disjoint_subset"] = "unary", grid_size: float | None = None + self, method: Literal["coverage", "unary", "disjoint_subset"] = "unary", grid_size: FloatInt | None = None ) -> BaseGeometry: ... def intersection_all(self) -> BaseGeometry: ... - def affine_transform(self, matrix: Collection[float]) -> GeometryArray: ... - def translate(self, xoff: float = 0.0, yoff: float = 0.0, zoff: float = 0.0) -> GeometryArray: ... - def rotate(self, angle: float, origin: _AffinityOrigin = "center", use_radians: bool = False) -> GeometryArray: ... + def affine_transform(self, matrix: Collection[FloatInt]) -> GeometryArray: ... + def translate(self, xoff: FloatInt = 0.0, yoff: FloatInt = 0.0, zoff: FloatInt = 0.0) -> GeometryArray: ... + def rotate(self, angle: FloatInt, origin: _AffinityOrigin = "center", use_radians: bool = False) -> GeometryArray: ... def scale( - self, xfact: float = 1.0, yfact: float = 1.0, zfact: float = 1.0, origin: _AffinityOrigin = "center" + self, xfact: FloatInt = 1.0, yfact: FloatInt = 1.0, zfact: FloatInt = 1.0, origin: _AffinityOrigin = "center" ) -> GeometryArray: ... def skew( - self, xs: float = 0.0, ys: float = 0.0, origin: _AffinityOrigin = "center", use_radians: bool = False + self, xs: FloatInt = 0.0, ys: FloatInt = 0.0, origin: _AffinityOrigin = "center", use_radians: bool = False ) -> GeometryArray: ... def to_crs(self, crs: _ConvertibleToCRS | None = None, epsg: int | None = None) -> GeometryArray: ... def estimate_utm_crs(self, datum_name: str = "WGS 84") -> CRS: ... diff --git a/stubs/geopandas/geopandas/base.pyi b/stubs/geopandas/geopandas/base.pyi index 8bc0a32428a8..6c51bba0bd0e 100644 --- a/stubs/geopandas/geopandas/base.pyi +++ b/stubs/geopandas/geopandas/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsGetItem from collections.abc import Callable, Collection, Hashable, Iterable, Mapping, Sequence from typing import Any, Literal, Protocol, SupportsIndex, TypeAlias, overload, type_check_only @@ -28,10 +29,10 @@ class _SupportsGeoInterface(Protocol): # noqa: Y046 def __geo_interface__(self) -> dict[str, Any]: ... # values are arbitrary _ConvertibleToCRS: TypeAlias = str | int | tuple[str, str] | list[str] | dict[str, Incomplete] | _SupportsToWkt -_AffinityOrigin: TypeAlias = Literal["center", "centroid"] | Point | tuple[float, float] | tuple[float, float, float] -_ClipMask: TypeAlias = GeoDataFrame | GeoSeries | Polygon | MultiPolygon | tuple[float, float, float, float] # noqa: Y047 +_AffinityOrigin: TypeAlias = Literal["center", "centroid"] | Point | tuple[FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] +_ClipMask: TypeAlias = GeoDataFrame | GeoSeries | Polygon | MultiPolygon | tuple[FloatInt, FloatInt, FloatInt, FloatInt] # noqa: Y047 # np.floating[Any] because precision is not important -_BboxLike: TypeAlias = Sequence[float] | NDArray[np.floating[Any]] | Geometry | GeoDataFrame | GeoSeries # noqa: Y047 +_BboxLike: TypeAlias = Sequence[FloatInt] | NDArray[np.floating[Any]] | Geometry | GeoDataFrame | GeoSeries # noqa: Y047 _MaskLike: TypeAlias = dict[str, Incomplete] | Geometry | GeoDataFrame | GeoSeries # noqa: Y047 # Cannot use IndexOpsMixin[Geometry] because of IndexOpsMixin type variable bounds @@ -66,8 +67,8 @@ class GeoPandasBase: @property def is_valid(self) -> pd.Series[bool]: ... def is_valid_reason(self) -> pd.Series[str]: ... - def is_valid_coverage(self, *, gap_width: float = 0.0) -> bool: ... - def invalid_coverage_edges(self, *, gap_width: float = 0.0) -> GeoSeries: ... + def is_valid_coverage(self, *, gap_width: FloatInt = 0.0) -> bool: ... + def invalid_coverage_edges(self, *, gap_width: FloatInt = 0.0) -> GeoSeries: ... @property def is_empty(self) -> pd.Series[bool]: ... def count_coordinates(self) -> pd.Series[int]: ... @@ -91,13 +92,13 @@ class GeoPandasBase: def boundary(self) -> GeoSeries: ... @property def centroid(self) -> GeoSeries: ... - def concave_hull(self, ratio: float = 0.0, allow_holes: bool = False) -> GeoSeries: ... + def concave_hull(self, ratio: FloatInt = 0.0, allow_holes: bool = False) -> GeoSeries: ... def constrained_delaunay_triangles(self) -> GeoSeries: ... @property def convex_hull(self) -> GeoSeries: ... - def delaunay_triangles(self, tolerance: float | ArrayLike = 0.0, only_edges: bool | ArrayLike = False) -> GeoSeries: ... + def delaunay_triangles(self, tolerance: FloatInt | ArrayLike = 0.0, only_edges: bool | ArrayLike = False) -> GeoSeries: ... def voronoi_polygons( - self, tolerance: float | ArrayLike = 0.0, extend_to: Geometry | None = None, only_edges: bool = False + self, tolerance: FloatInt | ArrayLike = 0.0, extend_to: Geometry | None = None, only_edges: bool = False ) -> GeoSeries: ... @property def envelope(self) -> GeoSeries: ... @@ -107,20 +108,20 @@ class GeoPandasBase: def extract_unique_points(self) -> GeoSeries: ... def offset_curve( self, - distance: float | ArrayLike, + distance: FloatInt | ArrayLike, quad_segs: int = 8, join_style: Literal["round", "bevel", "mitre"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, ) -> GeoSeries: ... @property def interiors(self) -> pd.Series[Any]: ... # Cannot use pd.Series[BaseGeometry] - def remove_repeated_points(self, tolerance: float = 0.0) -> GeoSeries: ... + def remove_repeated_points(self, tolerance: FloatInt = 0.0) -> GeoSeries: ... def set_precision( - self, grid_size: float, mode: Literal["valid_output", "pointwise", "keep_collapsed"] = "valid_output" + self, grid_size: FloatInt, mode: Literal["valid_output", "pointwise", "keep_collapsed"] = "valid_output" ) -> GeoSeries: ... def representative_point(self) -> GeoSeries: ... def minimum_bounding_circle(self) -> GeoSeries: ... - def maximum_inscribed_circle(self, *, tolerance: float | ArrayLike | None = None) -> GeoSeries: ... + def maximum_inscribed_circle(self, *, tolerance: FloatInt | ArrayLike | None = None) -> GeoSeries: ... def minimum_bounding_radius(self) -> pd.Series[float]: ... def minimum_clearance(self) -> pd.Series[float]: ... def minimum_clearance_line(self) -> GeoSeries: ... @@ -128,26 +129,26 @@ class GeoPandasBase: def orient_polygons(self, *, exterior_cw: bool = False) -> GeoSeries: ... def make_valid(self, *, method: Literal["linework", "structure"] = "linework", keep_collapsed: bool = True) -> GeoSeries: ... def reverse(self) -> GeoSeries: ... - def segmentize(self, max_segment_length: float | ArrayLike) -> GeoSeries: ... + def segmentize(self, max_segment_length: FloatInt | ArrayLike) -> GeoSeries: ... def transform( self, transformation: Callable[[NDArray[np.float64]], NDArray[np.float64]], include_z: bool = False ) -> GeoSeries: ... def force_2d(self) -> GeoSeries: ... - def force_3d(self, z: float | ArrayLike = 0) -> GeoSeries: ... + def force_3d(self, z: FloatInt | ArrayLike = 0) -> GeoSeries: ... def line_merge(self, directed: bool = False) -> GeoSeries: ... @property @deprecated("Use method `union_all` instead.") def unary_union(self) -> BaseGeometry: ... def union_all( - self, method: Literal["coverage", "unary", "disjoint_subset"] = "unary", *, grid_size: float | None = None + self, method: Literal["coverage", "unary", "disjoint_subset"] = "unary", *, grid_size: FloatInt | None = None ) -> BaseGeometry: ... def intersection_all(self) -> BaseGeometry: ... def contains(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... def contains_properly(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... - def dwithin(self, other: GeoSeries | Geometry, distance: float | ArrayLike, align: bool | None = None) -> pd.Series[bool]: ... + def dwithin(self, other: GeoSeries | Geometry, distance: FloatInt | ArrayLike, align: bool | None = None) -> pd.Series[bool]: ... def geom_equals(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... def geom_equals_exact( - self, other: GeoSeries | Geometry, tolerance: float | ArrayLike, align: bool | None = None + self, other: GeoSeries | Geometry, tolerance: FloatInt | ArrayLike, align: bool | None = None ) -> pd.Series[bool]: ... def geom_equals_identical(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... def crosses(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... @@ -160,22 +161,22 @@ class GeoPandasBase: def covered_by(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... def distance(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[float]: ... def hausdorff_distance( - self, other: GeoSeries | Geometry, align: bool | None = None, densify: float | ArrayLike | None = None + self, other: GeoSeries | Geometry, align: bool | None = None, densify: FloatInt | ArrayLike | None = None ) -> pd.Series[float]: ... def frechet_distance( - self, other: GeoSeries | Geometry, align: bool | None = None, densify: float | ArrayLike | None = None + self, other: GeoSeries | Geometry, align: bool | None = None, densify: FloatInt | ArrayLike | None = None ) -> pd.Series[float]: ... - def difference(self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: float | None = None) -> GeoSeries: ... + def difference(self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: FloatInt | None = None) -> GeoSeries: ... def symmetric_difference( - self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: float | None = None + self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: FloatInt | None = None ) -> GeoSeries: ... - def union(self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: float | None = None) -> GeoSeries: ... + def union(self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: FloatInt | None = None) -> GeoSeries: ... def intersection( - self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: float | None = None + self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: FloatInt | None = None ) -> GeoSeries: ... - def clip_by_rect(self, xmin: float, ymin: float, xmax: float, ymax: float) -> GeoSeries: ... + def clip_by_rect(self, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt) -> GeoSeries: ... def shortest_line(self, other: GeoSeries | Geometry, align: bool | None = None) -> GeoSeries: ... - def snap(self, other: GeoSeries | Geometry, tolerance: float | ArrayLike, align: bool | None = None) -> GeoSeries: ... + def snap(self, other: GeoSeries | Geometry, tolerance: FloatInt | ArrayLike, align: bool | None = None) -> GeoSeries: ... def shared_paths(self, other: GeoSeries | Geometry, align: bool | None = None): ... @property def bounds(self) -> pd.DataFrame: ... @@ -189,11 +190,11 @@ class GeoPandasBase: @overload def buffer( self, - distance: float | ArrayLike, + distance: FloatInt | ArrayLike, quad_segs: int | None = None, cap_style: Literal["round", "square", "flat"] = "round", join_style: Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, single_sided: bool = False, **kwargs, ) -> GeoSeries: ... @@ -201,30 +202,30 @@ class GeoPandasBase: @deprecated("The `resolution` argument to `buffer` is deprecated, use `quad_segs` instead.") def buffer( self, - distance: float | ArrayLike, + distance: FloatInt | ArrayLike, *, resolution: int, cap_style: Literal["round", "square", "flat"] = "round", join_style: Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, single_sided: bool = False, **kwargs, ) -> GeoSeries: ... - def simplify(self, tolerance: float | ArrayLike, preserve_topology: bool = True) -> GeoSeries: ... - def simplify_coverage(self, tolerance: float | ArrayLike, *, simplify_boundary: bool = True) -> GeoSeries: ... + def simplify(self, tolerance: FloatInt | ArrayLike, preserve_topology: bool = True) -> GeoSeries: ... + def simplify_coverage(self, tolerance: FloatInt | ArrayLike, *, simplify_boundary: bool = True) -> GeoSeries: ... def relate(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[str]: ... def relate_pattern(self, other: GeoSeries | Geometry, pattern: str, align: bool | None = None) -> pd.Series[bool]: ... def project(self, other: GeoSeries | Geometry, normalized: bool = False, align: bool | None = None) -> pd.Series[float]: ... - def interpolate(self, distance: float | ArrayLike, normalized: bool = False) -> GeoSeries: ... - def affine_transform(self, matrix: Collection[float]) -> GeoSeries: ... - def translate(self, xoff: float = 0.0, yoff: float = 0.0, zoff: float = 0.0) -> GeoSeries: ... - def rotate(self, angle: float, origin: _AffinityOrigin = "center", use_radians: bool = False) -> GeoSeries: ... + def interpolate(self, distance: FloatInt | ArrayLike, normalized: bool = False) -> GeoSeries: ... + def affine_transform(self, matrix: Collection[FloatInt]) -> GeoSeries: ... + def translate(self, xoff: FloatInt = 0.0, yoff: FloatInt = 0.0, zoff: FloatInt = 0.0) -> GeoSeries: ... + def rotate(self, angle: FloatInt, origin: _AffinityOrigin = "center", use_radians: bool = False) -> GeoSeries: ... def scale( - self, xfact: float = 1.0, yfact: float = 1.0, zfact: float = 1.0, origin: _AffinityOrigin = "center" + self, xfact: FloatInt = 1.0, yfact: FloatInt = 1.0, zfact: FloatInt = 1.0, origin: _AffinityOrigin = "center" ) -> GeoSeries: ... def skew( - self, xs: float = 0.0, ys: float = 0.0, origin: _AffinityOrigin = "center", use_radians: bool = False + self, xs: FloatInt = 0.0, ys: FloatInt = 0.0, origin: _AffinityOrigin = "center", use_radians: bool = False ) -> GeoSeries: ... @property def cx(self) -> SupportsGetItem[tuple[SupportsIndex | slice, SupportsIndex | slice], Self]: ... @@ -232,7 +233,7 @@ class GeoPandasBase: self, include_z: bool = False, ignore_index: bool = False, index_parts: bool = False, *, include_m: bool = False ) -> pd.DataFrame: ... def hilbert_distance( - self, total_bounds: tuple[float, float, float, float] | Iterable[float] | None = None, level: int = 16 + self, total_bounds: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | Iterable[FloatInt] | None = None, level: int = 16 ) -> pd.Series[int]: ... def sample_points( self, @@ -243,10 +244,10 @@ class GeoPandasBase: ) -> GeoSeries: ... def make_grid( self, - cell_size: float, + cell_size: FloatInt, grid_type: Literal["square", "hexagon"] = "square", feature_type: Literal["centers", "corners", "polygons"] = "polygons", - offset: tuple[float, float] | None = None, + offset: tuple[FloatInt, FloatInt] | None = None, intersect: bool = True, flat_topped: bool = False, ) -> GeoSeries: ... diff --git a/stubs/geopandas/geopandas/explore.pyi b/stubs/geopandas/geopandas/explore.pyi index 1ecd3a1cb1cb..da567b9067c7 100644 --- a/stubs/geopandas/geopandas/explore.pyi +++ b/stubs/geopandas/geopandas/explore.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Hashable, MutableMapping, Sequence from typing import Any @@ -26,10 +27,10 @@ def _explore( legend: bool = True, scheme: str | None = None, k: int = 5, - vmin: float | None = None, - vmax: float | None = None, - width: float | str = "100%", - height: float | str = "100%", + vmin: FloatInt | None = None, + vmax: FloatInt | None = None, + width: FloatInt | str = "100%", + height: FloatInt | str = "100%", categories: Sequence[Any] | NDArray[Any] | pd.Series[Any] | pd.Index[Any] | None = None, # categories can have "any" type classification_kwds: MutableMapping[str, Any] | None = None, control_scale: bool = True, @@ -52,8 +53,8 @@ def _explore_geoseries( tiles: str | folium.TileLayer | xyzservices.TileProvider | None = "OpenStreetMap", attr: str | None = None, highlight: bool = True, - width: float | str = "100%", - height: float | str = "100%", + width: FloatInt | str = "100%", + height: FloatInt | str = "100%", control_scale: bool = True, marker_type: str | folium.Marker | None = None, # The following kwds will never be typed more precisely than "Any" diff --git a/stubs/geopandas/geopandas/geodataframe.pyi b/stubs/geopandas/geopandas/geodataframe.pyi index f51ba3119945..47243c809f08 100644 --- a/stubs/geopandas/geopandas/geodataframe.pyi +++ b/stubs/geopandas/geopandas/geodataframe.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import io import os from _typeshed import Incomplete, SupportsGetItem, SupportsLenAndGetItem, SupportsRead, SupportsWrite @@ -322,7 +323,7 @@ class GeoDataFrame(GeoPandasBase, pd.DataFrame): # type: ignore[misc] # pyrefl observed: bool = False, dropna: bool = True, method: Literal["coverage", "unary", "disjoint_subset"] = "unary", - grid_size: float | None = None, + grid_size: FloatInt | None = None, **kwargs, ) -> GeoDataFrame: ... def explode(self, column: IndexLabel | None = None, ignore_index: bool = False, index_parts: bool = False) -> Self: ... @@ -350,7 +351,7 @@ class GeoDataFrame(GeoPandasBase, pd.DataFrame): # type: ignore[misc] # pyrefl rsuffix: str = "right", *, # **kwargs passed to geopandas.sjoin - distance: float | ArrayLike | None = None, + distance: FloatInt | ArrayLike | None = None, on_attribute: str | Sequence[str] | None = None, **kwargs, ) -> GeoDataFrame: ... @@ -358,7 +359,7 @@ class GeoDataFrame(GeoPandasBase, pd.DataFrame): # type: ignore[misc] # pyrefl self, right: GeoDataFrame, how: Literal["left", "right", "inner"] = "inner", - max_distance: float | None = None, + max_distance: FloatInt | None = None, lsuffix: str = "left", rsuffix: str = "right", distance_col: str | None = None, diff --git a/stubs/geopandas/geopandas/io/arrow.pyi b/stubs/geopandas/geopandas/io/arrow.pyi index 88e2419b8d1e..aa56f245334c 100644 --- a/stubs/geopandas/geopandas/io/arrow.pyi +++ b/stubs/geopandas/geopandas/io/arrow.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import os from _typeshed import Incomplete, SupportsGetItem, SupportsKeysAndGetItem from collections.abc import Iterable, Mapping @@ -16,7 +17,7 @@ def _read_parquet( path: str | os.PathLike[str], columns: Iterable[str] | None = None, storage_options: SupportsKeysAndGetItem[str, Any] | None = None, # type depend on the connection - bbox: SupportsGetItem[int, float] | None = None, + bbox: SupportsGetItem[int, FloatInt] | None = None, to_pandas_kwargs: Mapping[str, Incomplete] | None = None, **kwargs, # kwargs passed to pyarrow.parquet.read_table ) -> GeoDataFrame: ... diff --git a/stubs/geopandas/geopandas/plotting.pyi b/stubs/geopandas/geopandas/plotting.pyi index 25e55071d3a7..311d99e0b6d3 100644 --- a/stubs/geopandas/geopandas/plotting.pyi +++ b/stubs/geopandas/geopandas/plotting.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import os from _typeshed import Incomplete from collections.abc import Collection, Hashable, Iterable, Mapping, Sequence @@ -24,16 +25,16 @@ def plot_series( cmap: str | Colormap | None = None, color: _ColorOrColors | None = None, ax: Axes | None = None, - figsize: tuple[float, float] | None = None, - aspect: Literal["auto", "equal"] | float | None = "auto", + figsize: tuple[FloatInt, FloatInt] | None = None, + aspect: Literal["auto", "equal"] | FloatInt | None = "auto", autolim: bool = True, tiles: _Tiles = False, attr: str | None = None, add_labels: bool = True, *, # Extracted from `**style_kwds` - vmin: float = ..., - vmax: float = ..., + vmin: FloatInt = ..., + vmax: FloatInt = ..., facecolor: _ColorOrColors | None = None, norm: Normalize | None = None, **style_kwds, @@ -51,15 +52,15 @@ def plot_dataframe( legend: bool = False, scheme: str | None = None, k: int = 5, - vmin: float | None = None, - vmax: float | None = None, - markersize: str | float | Iterable[float] | ArrayLike | None = None, - figsize: tuple[float, float] | None = None, + vmin: FloatInt | None = None, + vmax: FloatInt | None = None, + markersize: str | FloatInt | Iterable[FloatInt] | ArrayLike | None = None, + figsize: tuple[FloatInt, FloatInt] | None = None, legend_kwds: dict[str, Incomplete] | None = None, categories: Iterable[Hashable] | None = None, classification_kwds: dict[str, Incomplete] | None = None, missing_kwds: dict[str, Incomplete] | None = None, - aspect: Literal["auto", "equal"] | float | None = "auto", + aspect: Literal["auto", "equal"] | FloatInt | None = "auto", autolim: bool = True, tiles: _Tiles = False, attr: str | None = None, @@ -67,10 +68,10 @@ def plot_dataframe( *, # Extracted from `**style_kwds` norm: Normalize | None = None, - alpha: float = 1, + alpha: FloatInt = 1, facecolor: _ColorOrColors | None = None, edgecolor: _ColorOrColors | None = None, - linewidth: float = ..., + linewidth: FloatInt = ..., label: str = "NaN", **style_kwds, ) -> Axes: ... @@ -90,7 +91,7 @@ class GeoplotAccessor(PlotAccessor): sharex: bool | None = None, sharey: bool | None = None, layout: tuple[int, int] | None = None, - figsize: tuple[float, float] | None = None, + figsize: tuple[FloatInt, FloatInt] | None = None, use_index: bool = True, title: str | None = None, grid: bool | None = None, @@ -99,20 +100,20 @@ class GeoplotAccessor(PlotAccessor): logx: bool | Literal["sym"] = False, logy: bool | Literal["sym"] = False, loglog: bool | Literal["sym"] = False, - xticks: Sequence[float] | None = None, - yticks: Sequence[float] | None = None, - xlim: tuple[float, float] | list[float] | None = None, - ylim: tuple[float, float] | list[float] | None = None, + xticks: Sequence[FloatInt] | None = None, + yticks: Sequence[FloatInt] | None = None, + xlim: tuple[FloatInt, FloatInt] | list[FloatInt] | None = None, + ylim: tuple[FloatInt, FloatInt] | list[FloatInt] | None = None, xlabel: str | None = None, ylabel: str | None = None, - rot: float | None = None, - fontsize: float | None = None, + rot: FloatInt | None = None, + fontsize: FloatInt | None = None, cmap: str | Colormap | None = None, # also accepts `colormap` but plot_dataframe uses `cmap` colorbar: bool | None = None, - position: float = 0.5, + position: FloatInt = 0.5, table: bool | pd.Series[Incomplete] | pd.DataFrame = False, - yerr: pd.DataFrame | pd.Series[float] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., - xerr: pd.DataFrame | pd.Series[float] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., + yerr: pd.DataFrame | pd.Series[FloatInt] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., + xerr: pd.DataFrame | pd.Series[FloatInt] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., stacked: bool = ..., # default value depends on kind secondary_y: bool | Sequence[Hashable] = False, mark_right: bool = True, @@ -132,7 +133,7 @@ class GeoplotAccessor(PlotAccessor): sharex: bool | None = None, sharey: bool | None = None, layout: tuple[int, int] | None = None, - figsize: tuple[float, float] | None = None, + figsize: tuple[FloatInt, FloatInt] | None = None, use_index: bool = True, title: str | Collection[str] | None = None, grid: bool | None = None, @@ -141,20 +142,20 @@ class GeoplotAccessor(PlotAccessor): logx: bool | Literal["sym"] = False, logy: bool | Literal["sym"] = False, loglog: bool | Literal["sym"] = False, - xticks: Sequence[float] | None = None, - yticks: Sequence[float] | None = None, - xlim: tuple[float, float] | list[float] | None = None, - ylim: tuple[float, float] | list[float] | None = None, + xticks: Sequence[FloatInt] | None = None, + yticks: Sequence[FloatInt] | None = None, + xlim: tuple[FloatInt, FloatInt] | list[FloatInt] | None = None, + ylim: tuple[FloatInt, FloatInt] | list[FloatInt] | None = None, xlabel: str | None = None, ylabel: str | None = None, - rot: float | None = None, - fontsize: float | None = None, + rot: FloatInt | None = None, + fontsize: FloatInt | None = None, cmap: str | Colormap | None = None, # also accepts `colormap` but plot_dataframe uses `cmap` colorbar: bool | None = None, - position: float = 0.5, + position: FloatInt = 0.5, table: bool | pd.Series[Incomplete] | pd.DataFrame = False, - yerr: pd.DataFrame | pd.Series[float] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., - xerr: pd.DataFrame | pd.Series[float] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., + yerr: pd.DataFrame | pd.Series[FloatInt] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., + xerr: pd.DataFrame | pd.Series[FloatInt] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., stacked: bool = ..., # default value depends on kind secondary_y: bool | Sequence[Hashable] = False, mark_right: bool = True, @@ -174,7 +175,7 @@ class GeoplotAccessor(PlotAccessor): sharex: bool | None = None, sharey: bool | None = None, layout: tuple[int, int] | None = None, - figsize: tuple[float, float] | None = None, + figsize: tuple[FloatInt, FloatInt] | None = None, use_index: bool = True, title: str | Collection[str] | None = None, grid: bool | None = None, @@ -183,20 +184,20 @@ class GeoplotAccessor(PlotAccessor): logx: bool | Literal["sym"] = False, logy: bool | Literal["sym"] = False, loglog: bool | Literal["sym"] = False, - xticks: Sequence[float] | None = None, - yticks: Sequence[float] | None = None, - xlim: tuple[float, float] | list[float] | None = None, - ylim: tuple[float, float] | list[float] | None = None, + xticks: Sequence[FloatInt] | None = None, + yticks: Sequence[FloatInt] | None = None, + xlim: tuple[FloatInt, FloatInt] | list[FloatInt] | None = None, + ylim: tuple[FloatInt, FloatInt] | list[FloatInt] | None = None, xlabel: str | None = None, ylabel: str | None = None, - rot: float | None = None, - fontsize: float | None = None, + rot: FloatInt | None = None, + fontsize: FloatInt | None = None, cmap: str | Colormap | None = None, # also accepts `colormap` but plot_dataframe uses `cmap` colorbar: bool | None = None, - position: float = 0.5, + position: FloatInt = 0.5, table: bool | pd.Series[Incomplete] | pd.DataFrame = False, - yerr: pd.DataFrame | pd.Series[float] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., - xerr: pd.DataFrame | pd.Series[float] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., + yerr: pd.DataFrame | pd.Series[FloatInt] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., + xerr: pd.DataFrame | pd.Series[FloatInt] | ArrayLike | Mapping[Incomplete, ArrayLike] | str = ..., stacked: bool = ..., # default value depends on kind secondary_y: bool | Sequence[Hashable] = False, mark_right: bool = True, @@ -216,23 +217,23 @@ class GeoplotAccessor(PlotAccessor): legend: bool = False, scheme: str | None = None, k: int = 5, - vmin: float | None = None, - vmax: float | None = None, - markersize: str | float | Iterable[float] | ArrayLike | None = None, - figsize: tuple[float, float] | None = None, + vmin: FloatInt | None = None, + vmax: FloatInt | None = None, + markersize: str | FloatInt | Iterable[FloatInt] | ArrayLike | None = None, + figsize: tuple[FloatInt, FloatInt] | None = None, legend_kwds: dict[str, Incomplete] | None = None, categories: Iterable[Hashable] | None = None, classification_kwds: dict[str, Incomplete] | None = None, missing_kwds: dict[str, Incomplete] | None = None, - aspect: Literal["auto", "equal"] | float | None = "auto", + aspect: Literal["auto", "equal"] | FloatInt | None = "auto", *, kind: Literal["geo"] = "geo", # Extracted from `**style_kwds` norm: Normalize | None = None, - alpha: float = 1, + alpha: FloatInt = 1, facecolor: _ColorOrColors | None = None, edgecolor: _ColorOrColors | None = None, - linewidth: float = ..., + linewidth: FloatInt = ..., label: str = "NaN", **style_kwds, ) -> Axes: ... @@ -248,22 +249,22 @@ class GeoplotAccessor(PlotAccessor): legend: bool = False, scheme: str | None = None, k: int = 5, - vmin: float | None = None, - vmax: float | None = None, - markersize: str | float | Iterable[float] | ArrayLike | None = None, - figsize: tuple[float, float] | None = None, + vmin: FloatInt | None = None, + vmax: FloatInt | None = None, + markersize: str | FloatInt | Iterable[FloatInt] | ArrayLike | None = None, + figsize: tuple[FloatInt, FloatInt] | None = None, legend_kwds: dict[str, Incomplete] | None = None, categories: Iterable[Hashable] | None = None, classification_kwds: dict[str, Incomplete] | None = None, missing_kwds: dict[str, Incomplete] | None = None, - aspect: Literal["auto", "equal"] | float | None = "auto", + aspect: Literal["auto", "equal"] | FloatInt | None = "auto", *, # Extracted from `**style_kwds` norm: Normalize | None = None, - alpha: float = 1, + alpha: FloatInt = 1, facecolor: _ColorOrColors | None = None, edgecolor: _ColorOrColors | None = None, - linewidth: float = ..., + linewidth: FloatInt = ..., label: str = "NaN", **style_kwds, ) -> Axes: ... diff --git a/stubs/geopandas/geopandas/sindex.pyi b/stubs/geopandas/geopandas/sindex.pyi index 1ef9bcb01ad9..24d98a7e586c 100644 --- a/stubs/geopandas/geopandas/sindex.pyi +++ b/stubs/geopandas/geopandas/sindex.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import Any, Final, Literal, overload @@ -21,7 +22,7 @@ class SpatialIndex: geometry: Geometry | ArrayLike, predicate: str | None = None, sort: bool = False, - distance: float | ArrayLike | None = None, + distance: FloatInt | ArrayLike | None = None, output_format: Literal["indices"] = "indices", ) -> NDArray[np.int64]: ... @overload @@ -30,7 +31,7 @@ class SpatialIndex: geometry: Geometry | ArrayLike, predicate: str | None = None, sort: bool = False, - distance: float | ArrayLike | None = None, + distance: FloatInt | ArrayLike | None = None, *, output_format: Literal["dense"], ) -> NDArray[np.bool_]: ... @@ -40,7 +41,7 @@ class SpatialIndex: geometry: Geometry | ArrayLike, predicate: str | None = None, sort: bool = False, - distance: float | ArrayLike | None = None, + distance: FloatInt | ArrayLike | None = None, *, output_format: Literal["sparse"], ) -> Any: ... # returns scipy coo_array but we don't depend on scipy @@ -50,7 +51,7 @@ class SpatialIndex: self, geometry, return_all: bool = True, - max_distance: float | None = None, + max_distance: FloatInt | None = None, return_distance: Literal[False] = False, exclusive: bool = False, ) -> _Array2D[np.int64]: ... @@ -59,7 +60,7 @@ class SpatialIndex: self, geometry, return_all: bool = True, - max_distance: float | None = None, + max_distance: FloatInt | None = None, *, return_distance: Literal[True], exclusive: bool = False, @@ -69,12 +70,12 @@ class SpatialIndex: self, geometry, return_all: bool = True, - max_distance: float | None = None, + max_distance: FloatInt | None = None, return_distance: bool = False, exclusive: bool = False, ) -> _Array2D[np.int64] | tuple[_Array2D[np.int64], _Array1D[np.float64]]: ... - def intersection(self, coordinates: Iterable[float]) -> _Array1D[np.int64]: ... + def intersection(self, coordinates: Iterable[FloatInt]) -> _Array1D[np.int64]: ... @property def size(self) -> int: ... @property diff --git a/stubs/geopandas/geopandas/tools/make_grid.pyi b/stubs/geopandas/geopandas/tools/make_grid.pyi index a1fb13c1d3d1..44dc58cf5e07 100644 --- a/stubs/geopandas/geopandas/tools/make_grid.pyi +++ b/stubs/geopandas/geopandas/tools/make_grid.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal from shapely import MultiPolygon, Polygon @@ -8,10 +9,10 @@ from ..geoseries import GeoSeries def make_grid( input_geometry: Polygon | MultiPolygon | GeoSeries | GeoDataFrame, /, - cell_size: float, + cell_size: FloatInt, grid_type: Literal["square", "hexagon"] = "square", feature_type: Literal["centers", "corners", "polygons"] = "polygons", - offset: tuple[float, float] | None = None, + offset: tuple[FloatInt, FloatInt] | None = None, intersect: bool = True, flat_topped: bool = False, ) -> GeoSeries: ... diff --git a/stubs/geopandas/geopandas/tools/sjoin.pyi b/stubs/geopandas/geopandas/tools/sjoin.pyi index a902f71d3e05..e04c29f2dd39 100644 --- a/stubs/geopandas/geopandas/tools/sjoin.pyi +++ b/stubs/geopandas/geopandas/tools/sjoin.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal from numpy.typing import ArrayLike @@ -11,14 +12,14 @@ def sjoin( predicate: str = "intersects", lsuffix: str = "left", rsuffix: str = "right", - distance: float | ArrayLike | None = None, + distance: FloatInt | ArrayLike | None = None, on_attribute: str | tuple[str, ...] | list[str] | None = None, ) -> GeoDataFrame: ... def sjoin_nearest( left_df: GeoDataFrame, right_df: GeoDataFrame, how: Literal["left", "right", "inner"] = "inner", - max_distance: float | None = None, + max_distance: FloatInt | None = None, lsuffix: str = "left", rsuffix: str = "right", distance_col: str | None = None, diff --git a/stubs/gevent/gevent/_config.pyi b/stubs/gevent/gevent/_config.pyi index 7015d9f4252f..9138c3d06536 100644 --- a/stubs/gevent/gevent/_config.pyi +++ b/stubs/gevent/gevent/_config.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Sequence from typing import Any, Generic, Protocol, TypeVar, overload, type_check_only from typing_extensions import Never @@ -53,7 +54,7 @@ class Config: # SettingType inserts a property into Config for every subclass of Setting resolver: _SettingDescriptor[type[_Resolver]] threadpool: _SettingDescriptor[type[Threadpool]] - threadpool_idle_task_timeout: _SettingDescriptor[float] + threadpool_idle_task_timeout: _SettingDescriptor[FloatInt] loop: _SettingDescriptor[type[_Loop]] format_context: _SettingDescriptor[Callable[[Any], str]] libev_backend: _SettingDescriptor[str | None] @@ -61,15 +62,15 @@ class Config: disable_watch_children: _SettingDescriptor[bool] track_greenlet_tree: _SettingDescriptor[bool] monitor_thread: _SettingDescriptor[bool] - max_blocking_time: _SettingDescriptor[float] - memory_monitor_period: _SettingDescriptor[float] + max_blocking_time: _SettingDescriptor[FloatInt] + memory_monitor_period: _SettingDescriptor[FloatInt] max_memory_usage: _SettingDescriptor[int | None] resolver_nameservers: _SettingDescriptor[Sequence[str] | str | None] - resolver_timeout: _SettingDescriptor[float | None] + resolver_timeout: _SettingDescriptor[FloatInt | None] # these get parsed by gevent.resolver.cares.channel so the Setting does not # perform any conversion, but we know at least what types can be valid ares_flags: _SettingDescriptor[str | int | None] - ares_timeout: _SettingDescriptor[str | float | None] + ares_timeout: _SettingDescriptor[str | FloatInt | None] ares_tries: _SettingDescriptor[str | int | None] ares_ndots: _SettingDescriptor[str | int | None] ares_udp_port: _SettingDescriptor[str | int | None] @@ -110,7 +111,7 @@ class Threadpool(ImportableSetting[type[ThreadPool]], Setting[type[ThreadPool]]) class ThreadpoolIdleTaskTimeout(FloatSettingMixin, Setting[float]): document: bool desc: str - default: float + default: FloatInt class Loop(ImportableSetting[type[_Loop]], Setting[type[_Loop]]): desc: str @@ -142,7 +143,7 @@ class MonitorThread(BoolSettingMixin, Setting[bool]): desc: str class MaxBlockingTime(FloatSettingMixin, Setting[float]): - default: float + default: FloatInt desc: str class PrintBlockingReports(BoolSettingMixin, Setting[bool]): diff --git a/stubs/gevent/gevent/_ffi/loop.pyi b/stubs/gevent/gevent/_ffi/loop.pyi index 38222a945d36..a40ccb5ca770 100644 --- a/stubs/gevent/gevent/_ffi/loop.pyi +++ b/stubs/gevent/gevent/_ffi/loop.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import FileDescriptor from collections.abc import Callable, Sequence @@ -67,7 +68,7 @@ class AbstractLoop: def activecnt(self) -> int: ... def io(self, fd: FileDescriptor, events: int, ref: bool = True, priority: int | None = None) -> _IoWatcher: ... def closing_fd(self, fd: FileDescriptor) -> bool: ... - def timer(self, after: float, repeat: float = 0.0, ref: bool = True, priority: int | None = None) -> _TimerWatcher: ... + def timer(self, after: FloatInt, repeat: FloatInt = 0.0, ref: bool = True, priority: int | None = None) -> _TimerWatcher: ... def signal(self, signum: int, ref: bool = True, priority: int | None = None) -> _Watcher: ... def idle(self, ref: bool = True, priority: int | None = None) -> _Watcher: ... def prepare(self, ref: bool = True, priority: int | None = None) -> _Watcher: ... @@ -78,10 +79,10 @@ class AbstractLoop: def install_sigchld(self) -> None: ... def async_(self, ref: bool = True, priority: int | None = None) -> _AsyncWatcher: ... - def stat(self, path: str, interval: float = 0.0, ref: bool = True, priority: bool | None = None) -> _StatWatcher: ... + def stat(self, path: str, interval: FloatInt = 0.0, ref: bool = True, priority: bool | None = None) -> _StatWatcher: ... def run_callback(self, func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> _Callback: ... def run_callback_threadsafe(self, func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> _Callback: ... - def callback(self, priority: float | None = None) -> _Callback: ... + def callback(self, priority: FloatInt | None = None) -> _Callback: ... def fileno(self) -> FileDescriptor | None: ... __all__ = ["AbstractLoop", "assign_standard_callbacks"] diff --git a/stubs/gevent/gevent/_ffi/watcher.pyi b/stubs/gevent/gevent/_ffi/watcher.pyi index 9c5c3b181cf9..a58df2170c12 100644 --- a/stubs/gevent/gevent/_ffi/watcher.pyi +++ b/stubs/gevent/gevent/_ffi/watcher.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptor, StrOrBytesPath from collections.abc import Callable from types import TracebackType @@ -46,7 +47,7 @@ class IoMixin: class TimerMixin: def __init__( - self, loop: _Loop, after: float = 0.0, repeat: float = 0.0, ref: bool = True, priority: int | None = None + self, loop: _Loop, after: FloatInt = 0.0, repeat: FloatInt = 0.0, ref: bool = True, priority: int | None = None ) -> None: ... @overload @@ -84,7 +85,7 @@ class ChildMixin: class StatMixin: def __init__( - self, _loop: _Loop, path: StrOrBytesPath, interval: float = 0.0, ref: bool = True, priority: float | None = None + self, _loop: _Loop, path: StrOrBytesPath, interval: FloatInt = 0.0, ref: bool = True, priority: FloatInt | None = None ) -> None: ... @property def path(self) -> StrOrBytesPath: ... diff --git a/stubs/gevent/gevent/_hub_primitives.pyi b/stubs/gevent/gevent/_hub_primitives.pyi index 8be21a4d546b..f404b004406c 100644 --- a/stubs/gevent/gevent/_hub_primitives.pyi +++ b/stubs/gevent/gevent/_hub_primitives.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptor from collections.abc import Callable, Collection, Iterable from types import TracebackType @@ -34,7 +35,7 @@ class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): @disjoint_base class _WaitIterator(Generic[_T]): - def __init__(self, objects: Collection[_T], hub: Hub, timeout: float, count: int | None) -> None: ... + def __init__(self, objects: Collection[_T], hub: Hub, timeout: FloatInt, count: int | None) -> None: ... def __enter__(self) -> Self: ... def __exit__(self, typ: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ... def __iter__(self) -> Self: ... @@ -42,33 +43,33 @@ class _WaitIterator(Generic[_T]): next = __next__ @overload -def iwait_on_objects(objects: None, timeout: float | None = None, count: int | None = None) -> list[bool]: ... +def iwait_on_objects(objects: None, timeout: FloatInt | None = None, count: int | None = None) -> list[bool]: ... @overload def iwait_on_objects( - objects: Collection[_WaitableT], timeout: float | None = None, count: int | None = None + objects: Collection[_WaitableT], timeout: FloatInt | None = None, count: int | None = None ) -> _WaitIterator[_WaitableT]: ... @overload -def wait_on_objects(objects: None = None, timeout: float | None = None, count: int | None = None) -> bool: ... +def wait_on_objects(objects: None = None, timeout: FloatInt | None = None, count: int | None = None) -> bool: ... @overload def wait_on_objects( - objects: Collection[_WaitableT], timeout: float | None = None, count: int | None = None + objects: Collection[_WaitableT], timeout: FloatInt | None = None, count: int | None = None ) -> list[_WaitableT]: ... def set_default_timeout_error(e: type[BaseException]) -> None: ... def wait_on_socket(socket: socket, watcher: _Watcher, timeout_exc: type[BaseException] | BaseException | None = None) -> None: ... def wait_on_watcher( watcher: _Watcher, - timeout: float | None = None, + timeout: FloatInt | None = None, timeout_exc: type[BaseException] | BaseException = ..., hub: Hub | None = None, ) -> None: ... def wait_read( - fileno: FileDescriptor, timeout: float | None = None, timeout_exc: type[BaseException] | BaseException = ... + fileno: FileDescriptor, timeout: FloatInt | None = None, timeout_exc: type[BaseException] | BaseException = ... ) -> None: ... def wait_write( - fileno: FileDescriptor, timeout: float | None = None, timeout_exc: type[BaseException] | BaseException = ... + fileno: FileDescriptor, timeout: FloatInt | None = None, timeout_exc: type[BaseException] | BaseException = ... ) -> None: ... def wait_readwrite( - fileno: FileDescriptor, timeout: float | None = None, timeout_exc: type[BaseException] | BaseException = ... + fileno: FileDescriptor, timeout: FloatInt | None = None, timeout_exc: type[BaseException] | BaseException = ... ) -> None: ... diff --git a/stubs/gevent/gevent/_monitor.pyi b/stubs/gevent/gevent/_monitor.pyi index 3647e0f33f0d..24edbd49a5b1 100644 --- a/stubs/gevent/gevent/_monitor.pyi +++ b/stubs/gevent/gevent/_monitor.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Sequence from typing import Any, TypeVar @@ -21,17 +22,17 @@ class MonitorWarning(RuntimeWarning): ... class _MonitorEntry: __slots__ = ("function", "period", "last_run_time") function: Callable[[Hub], object] - period: float - last_run_time: float - def __init__(self, function: Callable[[Hub], object], period: float) -> None: ... + period: FloatInt + last_run_time: FloatInt + def __init__(self, function: Callable[[Hub], object], period: FloatInt) -> None: ... def __eq__(self, other: object) -> bool: ... def __hash__(self) -> int: ... @implementer(IPeriodicMonitorThread) class PeriodicMonitoringThread: - inactive_sleep_time: float - min_sleep_time: float - min_memory_monitor_period: float + inactive_sleep_time: FloatInt + min_sleep_time: FloatInt + min_memory_monitor_period: FloatInt should_run: bool monitor_thread_ident: int pid: int @@ -39,7 +40,7 @@ class PeriodicMonitoringThread: @property def hub(self) -> Hub | None: ... def monitoring_functions(self) -> list[_MonitorEntry]: ... - def add_monitoring_function(self, function: Callable[[Hub], object], period: float) -> None: ... + def add_monitoring_function(self, function: Callable[[Hub], object], period: FloatInt) -> None: ... def calculate_sleep_time(self) -> float: ... def kill(self) -> None: ... def __call__(self) -> None: ... diff --git a/stubs/gevent/gevent/_types.pyi b/stubs/gevent/gevent/_types.pyi index f257a4d877df..3cd6e00ce16f 100644 --- a/stubs/gevent/gevent/_types.pyi +++ b/stubs/gevent/gevent/_types.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import FileDescriptor, StrOrBytesPath from collections.abc import Callable @@ -51,7 +52,7 @@ class _Loop(Protocol): # noqa: Y046 def destroy(self) -> None: ... def io(self, fd: FileDescriptor, events: int, ref: bool = True, priority: int | None = None) -> _IoWatcher: ... def closing_fd(self, fd: FileDescriptor) -> bool: ... - def timer(self, after: float, repeat: float = 0.0, ref: bool = True, priority: int | None = None) -> _TimerWatcher: ... + def timer(self, after: FloatInt, repeat: FloatInt = 0.0, ref: bool = True, priority: int | None = None) -> _TimerWatcher: ... def signal(self, signum: int, ref: bool = True, priority: int | None = None) -> _Watcher: ... def idle(self, ref: bool = True, priority: int | None = None) -> _Watcher: ... def prepare(self, ref: bool = True, priority: int | None = None) -> _Watcher: ... @@ -62,7 +63,7 @@ class _Loop(Protocol): # noqa: Y046 def install_sigchld(self) -> None: ... def async_(self, ref: bool = True, priority: int | None = None) -> _AsyncWatcher: ... - def stat(self, path: str, interval: float = 0.0, ref: bool = True, priority: bool | None = ...) -> _StatWatcher: ... + def stat(self, path: str, interval: FloatInt = 0.0, ref: bool = True, priority: bool | None = ...) -> _StatWatcher: ... def run_callback(self, func: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> _Callback: ... def run_callback_threadsafe(self, func: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> _Callback: ... def fileno(self) -> FileDescriptor | None: ... diff --git a/stubs/gevent/gevent/baseserver.pyi b/stubs/gevent/gevent/baseserver.pyi index 453f974eefec..952173a32886 100644 --- a/stubs/gevent/gevent/baseserver.pyi +++ b/stubs/gevent/gevent/baseserver.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Container from types import TracebackType from typing import Generic, Literal, ParamSpec, Protocol, TypeAlias, type_check_only @@ -18,13 +19,13 @@ class _SpawnFunc(Protocol): _Spawner: TypeAlias = Pool | _SpawnFunc | int | Literal["default"] | None class BaseServer(Generic[Unpack[_Ts]]): - min_delay: float - max_delay: float + min_delay: FloatInt + max_delay: FloatInt max_accept: int - stop_timeout: float + stop_timeout: FloatInt fatal_errors: Container[int] pool: Pool | None - delay: float + delay: FloatInt loop: _Loop family: int address: str | tuple[str, int] @@ -58,8 +59,8 @@ class BaseServer(Generic[Unpack[_Ts]]): def close(self) -> None: ... @property def closed(self) -> bool: ... - def stop(self, timeout: float | None = None) -> None: ... - def serve_forever(self, stop_timeout: float | None = None) -> None: ... + def stop(self, timeout: FloatInt | None = None) -> None: ... + def serve_forever(self, stop_timeout: FloatInt | None = None) -> None: ... def is_fatal_error(self, ex: BaseException) -> bool: ... __all__ = ["BaseServer"] diff --git a/stubs/gevent/gevent/event.pyi b/stubs/gevent/gevent/event.pyi index 4652810532d2..fc7672af33f9 100644 --- a/stubs/gevent/gevent/event.pyi +++ b/stubs/gevent/gevent/event.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from types import TracebackType from typing import Generic, Literal, Protocol, TypeAlias, TypeVar, overload, type_check_only @@ -30,7 +31,7 @@ class Event(AbstractLinkable): @overload def wait(self, timeout: None = None) -> Literal[True]: ... @overload - def wait(self, timeout: float) -> bool: ... + def wait(self, timeout: FloatInt) -> bool: ... class AsyncResult(AbstractLinkable, Generic[_T]): __slots__ = ("_value", "_exc_info", "_imap_task_index") @@ -57,11 +58,11 @@ class AsyncResult(AbstractLinkable, Generic[_T]): # effect, this is a little annoying, since it will introduce some additional None checks # that may not be necessary, but it's impossible to annotate this situation, so for now # we just deal with the possibly redundant None checks... - def get(self, block: bool = True, timeout: float | None = None) -> _T | None: ... + def get(self, block: bool = True, timeout: FloatInt | None = None) -> _T | None: ... def get_nowait(self) -> _T | None: ... - def wait(self, timeout: float | None = None) -> _T | None: ... + def wait(self, timeout: FloatInt | None = None) -> _T | None: ... def __call__(self, source: _ValueSource[_T]) -> None: ... - def result(self, timeout: float | None = None) -> _T | None: ... + def result(self, timeout: FloatInt | None = None) -> _T | None: ... set_result = set def done(self) -> bool: ... def cancel(self) -> Literal[False]: ... diff --git a/stubs/gevent/gevent/events.pyi b/stubs/gevent/gevent/events.pyi index ff6fc39f082a..89132b1204b5 100644 --- a/stubs/gevent/gevent/events.pyi +++ b/stubs/gevent/gevent/events.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Mapping, Sequence from types import ModuleType from typing import Any, Protocol, TypeAlias, TypeVar, type_check_only @@ -20,10 +21,10 @@ subscribers: list[Callable[[Any], object]] @type_check_only class _PeriodicMonitorThread(Protocol): - def add_monitoring_function(self, function: Callable[[Hub], object], period: float | None) -> object: ... + def add_monitoring_function(self, function: Callable[[Hub], object], period: FloatInt | None) -> object: ... class IPeriodicMonitorThread(Interface): - def add_monitoring_function(function: Callable[[Hub], object], period: float | None) -> object: ... + def add_monitoring_function(function: Callable[[Hub], object], period: FloatInt | None) -> object: ... class IPeriodicMonitorThreadStartedEvent(Interface): monitor: IPeriodicMonitorThread @@ -36,17 +37,17 @@ class PeriodicMonitorThreadStartedEvent: class IEventLoopBlocked(Interface): greenlet: greenlet_t - blocking_time: float + blocking_time: FloatInt info: Sequence[str] hub: Hub | None @implementer(IEventLoopBlocked) class EventLoopBlocked: greenlet: greenlet_t - blocking_time: float + blocking_time: FloatInt info: Sequence[str] hub: Hub | None - def __init__(self, greenlet: greenlet_t, blocking_time: float, info: Sequence[str], *, hub: Hub | None = None) -> None: ... + def __init__(self, greenlet: greenlet_t, blocking_time: FloatInt, info: Sequence[str], *, hub: Hub | None = None) -> None: ... class IMemoryUsageThresholdExceeded(Interface): mem_usage: int diff --git a/stubs/gevent/gevent/greenlet.pyi b/stubs/gevent/gevent/greenlet.pyi index e6551f06f9de..acc6aadca440 100644 --- a/stubs/gevent/gevent/greenlet.pyi +++ b/stubs/gevent/gevent/greenlet.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import weakref from collections.abc import Callable, Iterable, Sequence from types import FrameType, TracebackType @@ -48,11 +49,11 @@ class Greenlet(greenlet.greenlet, Generic[_P, _T]): def add_spawn_callback(callback: Callable[[Greenlet[..., Any]], object]) -> None: ... @staticmethod def remove_spawn_callback(callback: Callable[[Greenlet[..., Any]], object]) -> None: ... - def get(self, block: bool = True, timeout: float | None = None) -> _T: ... + def get(self, block: bool = True, timeout: FloatInt | None = None) -> _T: ... def has_links(self) -> bool: ... - def join(self, timeout: float | None = None) -> None: ... + def join(self, timeout: FloatInt | None = None) -> None: ... def kill( - self, exception: type[BaseException] | BaseException = ..., block: bool = True, timeout: float | None = None + self, exception: type[BaseException] | BaseException = ..., block: bool = True, timeout: FloatInt | None = None ) -> None: ... def link(self, callback: Callable[[Self], object]) -> None: ... def link_exception(self, callback: Callable[[Self], object]) -> None: ... @@ -72,13 +73,13 @@ class Greenlet(greenlet.greenlet, Generic[_P, _T]): @overload @classmethod - def spawn_later(cls, seconds: float, run: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Self: ... + def spawn_later(cls, seconds: FloatInt, run: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Self: ... @overload @classmethod - def spawn_later(cls, seconds: float) -> Greenlet[[], None]: ... + def spawn_later(cls, seconds: FloatInt) -> Greenlet[[], None]: ... def start(self) -> None: ... - def start_later(self, seconds: float) -> None: ... + def start_later(self, seconds: FloatInt) -> None: ... def successful(self) -> bool: ... def __bool__(self) -> bool: ... def __enter__(self) -> Self: ... @@ -94,13 +95,13 @@ class Greenlet(greenlet.greenlet, Generic[_P, _T]): spawning_stack: FrameType | None def joinall( - greenlets: Sequence[_G], timeout: float | None = None, raise_error: bool = False, count: int | None = None + greenlets: Sequence[_G], timeout: FloatInt | None = None, raise_error: bool = False, count: int | None = None ) -> list[_G]: ... def killall( greenlets: Iterable[greenlet.greenlet], exception: type[BaseException] | BaseException = ..., block: bool = True, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> None: ... __all__ = ["Greenlet", "joinall", "killall"] diff --git a/stubs/gevent/gevent/hub.pyi b/stubs/gevent/gevent/hub.pyi index 0daf83413755..6e2f58d61357 100644 --- a/stubs/gevent/gevent/hub.pyi +++ b/stubs/gevent/gevent/hub.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from types import TracebackType from typing import Any, Generic, ParamSpec, Protocol, TextIO, TypeVar, overload, type_check_only @@ -33,7 +34,7 @@ class _DefaultReturnProperty(Protocol[_T]): def __del__(self) -> None: ... def spawn_raw(function: Callable[..., object], *args: object, **kwargs: object) -> greenlet.greenlet: ... -def sleep(seconds: float = 0, ref: bool = True) -> None: ... +def sleep(seconds: FloatInt = 0, ref: bool = True) -> None: ... def idle(priority: int = 0) -> None: ... def kill(greenlet: greenlet.greenlet, exception: type[BaseException] | BaseException = ...) -> None: ... @@ -99,7 +100,7 @@ class Hub(WaitOperationsGreenlet): ) -> None: ... def run(self) -> None: ... def start_periodic_monitoring_thread(self) -> PeriodicMonitoringThread: ... - def join(self, timeout: float | None = None) -> bool: ... + def join(self, timeout: FloatInt | None = None) -> bool: ... def destroy(self, destroy_loop: bool | None = None) -> None: ... @property def resolver_class(self) -> type[AbstractResolver]: ... diff --git a/stubs/gevent/gevent/libev/corecext.pyi b/stubs/gevent/gevent/libev/corecext.pyi index fd2f8d80f4dd..1802248f3777 100644 --- a/stubs/gevent/gevent/libev/corecext.pyi +++ b/stubs/gevent/gevent/libev/corecext.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import FileDescriptor from collections.abc import Callable, Sequence @@ -63,7 +64,7 @@ if sys.platform != "win32": def pendingcnt(self) -> int: ... def io(self, fd: FileDescriptor, events: int, ref: bool = True, priority: int | None = None) -> watcher.io: ... def closing_fd(self, fd: FileDescriptor) -> bool: ... - def timer(self, after: float, repeat: float = 0.0, ref: bool = True, priority: int | None = None) -> watcher.timer: ... + def timer(self, after: FloatInt, repeat: FloatInt = 0.0, ref: bool = True, priority: int | None = None) -> watcher.timer: ... def signal(self, signum: int, ref: bool = True, priority: int | None = None) -> watcher.signal: ... def idle(self, ref: bool = True, priority: int | None = None) -> watcher.idle: ... def prepare(self, ref: bool = True, priority: int | None = None) -> watcher.prepare: ... @@ -73,7 +74,7 @@ if sys.platform != "win32": def child(self, pid: int, trace: int = 0, ref: bool = True) -> watcher.child: ... def install_sigchld(self) -> None: ... def reset_sigchld(self) -> None: ... - def stat(self, path: str, interval: float = 0.0, ref: bool = True, priority: bool | None = None) -> watcher.stat: ... + def stat(self, path: str, interval: FloatInt = 0.0, ref: bool = True, priority: bool | None = None) -> watcher.stat: ... # These technically don't allow the functions arguments to be passed in as kwargs # but there's no way to express that yet with ParamSpec, however, we would still like # to verify that the arguments match diff --git a/stubs/gevent/gevent/libev/corecffi.pyi b/stubs/gevent/gevent/libev/corecffi.pyi index 3f7821a82524..41e370582f31 100644 --- a/stubs/gevent/gevent/libev/corecffi.pyi +++ b/stubs/gevent/gevent/libev/corecffi.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import FileDescriptor from collections.abc import Sequence @@ -13,7 +14,7 @@ def embeddable_backends() -> list[str | int]: ... def time() -> float: ... class loop(AbstractLoop): - approx_timer_resolution: float + approx_timer_resolution: FloatInt error_handler: None @property def MAXPRI(self) -> int: ... @@ -22,7 +23,7 @@ class loop(AbstractLoop): def __init__(self, flags: Sequence[str] | str | int | None = None, default: bool | None = None) -> None: ... def io(self, fd: FileDescriptor, events: int, ref: bool = True, priority: int | None = None) -> watcher.io: ... def closing_fd(self, fd: FileDescriptor) -> bool: ... - def timer(self, after: float, repeat: float = 0.0, ref: bool = True, priority: int | None = None) -> watcher.timer: ... + def timer(self, after: FloatInt, repeat: FloatInt = 0.0, ref: bool = True, priority: int | None = None) -> watcher.timer: ... def signal(self, signum: int, ref: bool = True, priority: int | None = None) -> watcher.signal: ... def idle(self, ref: bool = True, priority: int | None = None) -> watcher.idle: ... def prepare(self, ref: bool = True, priority: int | None = None) -> watcher.prepare: ... @@ -33,7 +34,7 @@ class loop(AbstractLoop): def child(self, pid: int, trace: int = 0, ref: bool = True) -> watcher.child: ... def reset_sigchld(self) -> None: ... - def stat(self, path: str, interval: float = 0.0, ref: bool = True, priority: bool | None = None) -> watcher.stat: ... + def stat(self, path: str, interval: FloatInt = 0.0, ref: bool = True, priority: bool | None = None) -> watcher.stat: ... __all__ = [ "get_version", diff --git a/stubs/gevent/gevent/libuv/loop.pyi b/stubs/gevent/gevent/libuv/loop.pyi index 54bfdf5ba682..4dbc9c7ad968 100644 --- a/stubs/gevent/gevent/libuv/loop.pyi +++ b/stubs/gevent/gevent/libuv/loop.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import FileDescriptor from typing import NamedTuple @@ -13,7 +14,7 @@ def supported_backends() -> list[str]: ... class loop(AbstractLoop): CALLBACK_CHECK_COUNT: int SIGNAL_CHECK_INTERVAL_MS: int - approx_timer_resolution: float + approx_timer_resolution: FloatInt error_handler: None def __init__(self, flags: int | None = None, default: bool | None = None) -> None: ... @@ -31,7 +32,7 @@ class loop(AbstractLoop): # this returns a class private to gevent.libuv.watcher.io, which satisfies the protocol def io(self, fd: FileDescriptor, events: int, ref: bool = True, priority: int | None = None) -> _IoWatcher: ... def closing_fd(self, fd: FileDescriptor) -> bool: ... - def timer(self, after: float, repeat: float = 0.0, ref: bool = True, priority: int | None = None) -> watcher.timer: ... + def timer(self, after: FloatInt, repeat: FloatInt = 0.0, ref: bool = True, priority: int | None = None) -> watcher.timer: ... def signal(self, signum: int, ref: bool = True, priority: int | None = None) -> watcher.signal: ... def idle(self, ref: bool = True, priority: int | None = None) -> watcher.idle: ... def check(self, ref: bool = True, priority: int | None = None) -> watcher.check: ... diff --git a/stubs/gevent/gevent/libuv/watcher.pyi b/stubs/gevent/gevent/libuv/watcher.pyi index 84c9fe212baf..5e7ceb283dd0 100644 --- a/stubs/gevent/gevent/libuv/watcher.pyi +++ b/stubs/gevent/gevent/libuv/watcher.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from gevent._ffi import watcher as _base from gevent._types import _IoWatcher @@ -27,7 +28,7 @@ class async_(_base.AsyncMixin, watcher): ... class timer(_base.TimerMixin, watcher): ... class stat(_base.StatMixin, watcher): - MIN_STAT_INTERVAL: float + MIN_STAT_INTERVAL: FloatInt class signal(_base.SignalMixin, watcher): ... class idle(_base.IdleMixin, watcher): ... diff --git a/stubs/gevent/gevent/lock.pyi b/stubs/gevent/gevent/lock.pyi index 80cb2342f661..24f5f1c95bd1 100644 --- a/stubs/gevent/gevent/lock.pyi +++ b/stubs/gevent/gevent/lock.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from types import TracebackType from typing import Any, Literal @@ -11,11 +12,11 @@ class Semaphore(AbstractLinkable): __slots__ = ("counter", "_multithreaded") counter: int def __init__(self, value: int = 1, hub: Hub | None = None) -> None: ... - def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... + def acquire(self, blocking: bool = True, timeout: FloatInt | None = None) -> bool: ... def locked(self) -> bool: ... def ready(self) -> bool: ... def release(self) -> int: ... - def wait(self, timeout: float | None = None) -> int: ... + def wait(self, timeout: FloatInt | None = None) -> int: ... def __enter__(self) -> None: ... def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... @@ -29,15 +30,15 @@ class DummySemaphore: def release(self) -> None: ... def rawlink(self, callback: Callable[[Any], object]) -> None: ... def unlink(self, callback: Callable[[Any], object]) -> None: ... - def wait(self, timeout: float | None = None) -> Literal[1]: ... - def acquire(self, blocking: bool = True, timeout: float | None = None) -> Literal[True]: ... + def wait(self, timeout: FloatInt | None = None) -> Literal[1]: ... + def acquire(self, blocking: bool = True, timeout: FloatInt | None = None) -> Literal[True]: ... def __enter__(self) -> None: ... def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... class RLock: __slots__ = ("_block", "_owner", "_count", "__weakref__") def __init__(self, hub: Hub | None = None) -> None: ... - def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... + def acquire(self, blocking: bool = True, timeout: FloatInt | None = None) -> bool: ... def __enter__(self) -> bool: ... def release(self) -> None: ... def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... diff --git a/stubs/gevent/gevent/pool.pyi b/stubs/gevent/gevent/pool.pyi index 74345130b9ed..3f24368bbde3 100644 --- a/stubs/gevent/gevent/pool.pyi +++ b/stubs/gevent/gevent/pool.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Collection, Iterable, Iterator from typing import Any, ParamSpec, TypeVar, overload @@ -184,26 +185,26 @@ class Group(GroupMappingMixin): def add(self, greenlet: Greenlet[..., object]) -> None: ... def discard(self, greenlet: Greenlet[..., object]) -> None: ... def start(self, greenlet: Greenlet[..., object]) -> None: ... - def join(self, timeout: float | None = None, raise_error: bool = False) -> bool: ... + def join(self, timeout: FloatInt | None = None, raise_error: bool = False) -> bool: ... def kill( - self, exception: type[BaseException] | BaseException = ..., block: bool = True, timeout: float | None = None + self, exception: type[BaseException] | BaseException = ..., block: bool = True, timeout: FloatInt | None = None ) -> None: ... def killone( self, greenlet: Greenlet[..., object], exception: type[BaseException] | BaseException = ..., block: bool = True, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> None: ... def full(self) -> bool: ... - def wait_available(self, timeout: float | None = None) -> int | None: ... + def wait_available(self, timeout: FloatInt | None = None) -> int | None: ... class PoolFull(QueueFull): ... class Pool(Group): size: int | None def __init__(self, size: int | None = None, greenlet_class: type[Greenlet[..., object]] | None = None) -> None: ... - def wait_available(self, timeout: float | None = None) -> int: ... + def wait_available(self, timeout: FloatInt | None = None) -> int: ... def free_count(self) -> int: ... - def start(self, greenlet: Greenlet[..., object], blocking: bool = True, timeout: float | None = None) -> None: ... - def add(self, greenlet: Greenlet[..., object], blocking: bool = True, timeout: float | None = None) -> None: ... + def start(self, greenlet: Greenlet[..., object], blocking: bool = True, timeout: FloatInt | None = None) -> None: ... + def add(self, greenlet: Greenlet[..., object], blocking: bool = True, timeout: FloatInt | None = None) -> None: ... diff --git a/stubs/gevent/gevent/pywsgi.pyi b/stubs/gevent/gevent/pywsgi.pyi index cda7fd112a38..54164c4b9d49 100644 --- a/stubs/gevent/gevent/pywsgi.pyi +++ b/stubs/gevent/gevent/pywsgi.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import OptExcInfo, StrOrBytesPath, SupportsWrite from _typeshed.wsgi import WSGIApplication, WSGIEnvironment from collections.abc import Callable, Container, Iterable, Iterator @@ -73,8 +74,8 @@ class WSGIHandler: provided_date: str | None provided_content_length: str | None close_connection: bool - time_start: float - time_finish: float + time_start: FloatInt + time_finish: FloatInt headers_sent: bool response_use_chunked: bool connection_upgraded: bool diff --git a/stubs/gevent/gevent/queue.pyi b/stubs/gevent/gevent/queue.pyi index afe1ce226dc0..75bc7c292320 100644 --- a/stubs/gevent/gevent/queue.pyi +++ b/stubs/gevent/gevent/queue.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys import types from collections import deque @@ -42,11 +43,11 @@ class SimpleQueue(Generic[_T]): def copy(self) -> Self: ... def empty(self) -> bool: ... def full(self) -> bool: ... - def get(self, block: bool = True, timeout: float | None = None) -> _T: ... + def get(self, block: bool = True, timeout: FloatInt | None = None) -> _T: ... def get_nowait(self) -> _T: ... - def peek(self, block: bool = True, timeout: float | None = None) -> _T: ... + def peek(self, block: bool = True, timeout: FloatInt | None = None) -> _T: ... def peek_nowait(self) -> _T: ... - def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ... + def put(self, item: _T, block: bool = True, timeout: FloatInt | None = None) -> None: ... def put_nowait(self, item: _T) -> None: ... def qsize(self) -> int: ... def __bool__(self) -> bool: ... @@ -67,7 +68,7 @@ class Queue(SimpleQueue[_T]): @overload def __init__(self, maxsize: int | None = None, *, items: Iterable[_T], unfinished_tasks: int | None = None) -> None: ... - def join(self, timeout: float | None = None) -> bool: ... + def join(self, timeout: FloatInt | None = None) -> bool: ... def task_done(self) -> None: ... def shutdown(self, immediate: bool = False) -> None: ... @@ -106,9 +107,9 @@ class Channel(Generic[_T]): def qsize(self) -> Literal[0]: ... def empty(self) -> Literal[True]: ... def full(self) -> Literal[True]: ... - def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ... + def put(self, item: _T, block: bool = True, timeout: FloatInt | None = None) -> None: ... def put_nowait(self, item: _T) -> None: ... - def get(self, block: bool = True, timeout: float | None = None) -> _T: ... + def get(self, block: bool = True, timeout: FloatInt | None = None) -> _T: ... def get_nowait(self) -> _T: ... def __iter__(self) -> Self: ... def __next__(self) -> _T: ... diff --git a/stubs/gevent/gevent/resolver/ares.pyi b/stubs/gevent/gevent/resolver/ares.pyi index ca16b3cf1dc1..70720f77e200 100644 --- a/stubs/gevent/gevent/resolver/ares.pyi +++ b/stubs/gevent/gevent/resolver/ares.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from typing import TypedDict, type_check_only @@ -9,7 +10,7 @@ from gevent.resolver.cares import channel @type_check_only class _ChannelArgs(TypedDict): flags: str | int | None - timeout: str | float | None + timeout: str | FloatInt | None tries: str | int | None ndots: str | int | None udp_port: str | int | None @@ -29,7 +30,7 @@ class Resolver(AbstractResolver): use_environ: bool = True, *, flags: str | int | None = None, - timeout: str | float | None = None, + timeout: str | FloatInt | None = None, tries: str | int | None = None, ndots: str | int | None = None, udp_port: str | int | None = None, diff --git a/stubs/gevent/gevent/resolver/cares.pyi b/stubs/gevent/gevent/resolver/cares.pyi index 01dbe77d2e2c..56c2905cd7dc 100644 --- a/stubs/gevent/gevent/resolver/cares.pyi +++ b/stubs/gevent/gevent/resolver/cares.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Iterable, Sequence from typing import Any, Generic, TypeVar from typing_extensions import Self, disjoint_base @@ -26,7 +27,7 @@ class channel: self, loop: _Loop, flags: str | int | None = None, - timeout: str | float | None = None, + timeout: str | FloatInt | None = None, tries: str | int | None = None, ndots: str | int | None = None, udp_port: str | int | None = None, diff --git a/stubs/gevent/gevent/select.pyi b/stubs/gevent/gevent/select.pyi index b1313ceda1b7..4cd00658bdd8 100644 --- a/stubs/gevent/gevent/select.pyi +++ b/stubs/gevent/gevent/select.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import FileDescriptorLike from collections.abc import Iterable @@ -5,7 +6,7 @@ from select import error as error from typing import Any def select( - rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None + rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: FloatInt | None = None ) -> tuple[list[Any], list[Any], list[Any]]: ... if sys.platform != "win32": @@ -16,5 +17,5 @@ else: class poll: def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ... - def poll(self, timeout: float | None = None) -> list[tuple[int, int]]: ... + def poll(self, timeout: FloatInt | None = None) -> list[tuple[int, int]]: ... def unregister(self, fd: FileDescriptorLike) -> None: ... diff --git a/stubs/gevent/gevent/selectors.pyi b/stubs/gevent/gevent/selectors.pyi index 12614ef1e6ff..e93ff1da379c 100644 --- a/stubs/gevent/gevent/selectors.pyi +++ b/stubs/gevent/gevent/selectors.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptorLike from collections.abc import Mapping from selectors import BaseSelector, SelectorKey @@ -17,7 +18,7 @@ class GeventSelector(BaseSelector): def hub(self) -> Hub: ... def register(self, fileobj: FileDescriptorLike, events: int, data: Any = None) -> SelectorKey: ... def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, int]]: ... + def select(self, timeout: FloatInt | None = None) -> list[tuple[SelectorKey, int]]: ... def close(self) -> None: ... def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... diff --git a/stubs/gevent/gevent/timeout.pyi b/stubs/gevent/gevent/timeout.pyi index 413d605350ce..b27d30383d9a 100644 --- a/stubs/gevent/gevent/timeout.pyi +++ b/stubs/gevent/gevent/timeout.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from types import TracebackType from typing import Any, Literal, ParamSpec, Protocol, TypeVar, overload, type_check_only @@ -17,12 +18,12 @@ class _HasSeconds(Protocol): def seconds(self) -> float | int: ... class Timeout(BaseException): - seconds: float | None + seconds: FloatInt | None exception: type[BaseException] | BaseException | None timer: _TimerWatcher def __init__( self, - seconds: float | None = None, + seconds: FloatInt | None = None, exception: type[BaseException] | BaseException | None = None, ref: bool = True, priority: int = -1, @@ -32,7 +33,7 @@ class Timeout(BaseException): @overload @classmethod def start_new( - cls, timeout: float | None = None, exception: type[BaseException] | BaseException | None = None, ref: bool = True + cls, timeout: FloatInt | None = None, exception: type[BaseException] | BaseException | None = None, ref: bool = True ) -> Self: ... @overload @classmethod @@ -46,15 +47,15 @@ class Timeout(BaseException): def __exit__( self, typ: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None ) -> Literal[True] | None: ... - def __lt__(self, other: _HasSeconds | float) -> bool: ... + def __lt__(self, other: _HasSeconds | FloatInt) -> bool: ... # when timeout_value is provided we unfortunately get no type checking on *args, **kwargs, because # ParamSpec does not allow mixing in additional keyword arguments @overload def with_timeout( - seconds: float | None, function: Callable[..., _T1], *args: Any, timeout_value: _T2, **kwds: Any + seconds: FloatInt | None, function: Callable[..., _T1], *args: Any, timeout_value: _T2, **kwds: Any ) -> _T1 | _T2: ... @overload -def with_timeout(seconds: float | None, function: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T: ... +def with_timeout(seconds: FloatInt | None, function: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T: ... __all__ = ["Timeout", "with_timeout"] diff --git a/stubs/gevent/gevent/util.pyi b/stubs/gevent/gevent/util.pyi index d0fce9863178..c5011159cb2f 100644 --- a/stubs/gevent/gevent/util.pyi +++ b/stubs/gevent/gevent/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsWrite from collections.abc import Callable from types import TracebackType @@ -42,9 +43,9 @@ class GreenletTree: class assert_switches: hub: Hub | None tracer: object | None - max_blocking_time: float | None + max_blocking_time: FloatInt | None hub_only: bool - def __init__(self, max_blocking_time: float | None = None, hub_only: bool = False) -> None: ... + def __init__(self, max_blocking_time: FloatInt | None = None, hub_only: bool = False) -> None: ... def __enter__(self) -> Self: ... def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi index 4811b9c67c01..fd3663ad8427 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc from _typeshed import Incomplete, SupportsItems from typing_extensions import Self @@ -14,7 +15,7 @@ class GlobalCache(metaclass=abc.ABCMeta): @abc.abstractmethod def set(self, items, expires=None): ... @abc.abstractmethod - def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: float | None = None) -> dict[bytes, bool]: ... + def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None) -> dict[bytes, bool]: ... @abc.abstractmethod def delete(self, keys): ... @abc.abstractmethod @@ -31,7 +32,7 @@ class _InProcessGlobalCache(GlobalCache): def __init__(self) -> None: ... def get(self, keys): ... def set(self, items, expires=None) -> None: ... - def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: float | None = None) -> dict[bytes, bool]: ... + def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None) -> dict[bytes, bool]: ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... @@ -50,7 +51,7 @@ class RedisCache(GlobalCache): def pipes(self): ... def get(self, keys): ... def set(self, items, expires=None) -> None: ... - def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: float | None = None) -> dict[bytes, bool]: ... + def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None) -> dict[bytes, bool]: ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... @@ -74,7 +75,7 @@ class MemcacheCache(GlobalCache): def caskeys(self): ... def get(self, keys): ... def set(self, items, expires=None): ... - def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: float | None = None) -> dict[bytes, bool]: ... + def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None) -> dict[bytes, bool]: ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi index 277330ce17a8..411da6c5c089 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from _typeshed import Unused from collections.abc import Callable, Iterable, Sequence @@ -272,8 +273,8 @@ class Model(_NotEqualMixin, metaclass=MetaModel): max: int | None = None, parent: key_module.Key | None = None, retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -291,8 +292,8 @@ class Model(_NotEqualMixin, metaclass=MetaModel): max: int | None = None, parent: key_module.Key | None = None, retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -315,8 +316,8 @@ class Model(_NotEqualMixin, metaclass=MetaModel): read_policy: Literal["EVENTUAL"] | None = None, transaction: bytes | None = None, retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -340,8 +341,8 @@ class Model(_NotEqualMixin, metaclass=MetaModel): read_policy: Literal["EVENTUAL"] | None = None, transaction: bytes | None = None, retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -365,8 +366,8 @@ class Model(_NotEqualMixin, metaclass=MetaModel): read_policy: Literal["EVENTUAL"] | None = None, transaction: bytes | None = None, retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -390,8 +391,8 @@ class Model(_NotEqualMixin, metaclass=MetaModel): read_policy: Literal["EVENTUAL"] | None = None, transaction: bytes | None = None, retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -422,8 +423,8 @@ def get_multi_async( read_policy: Literal["EVENTUAL"] | None = None, transaction: bytes | None = None, retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -440,8 +441,8 @@ def get_multi( read_policy: Literal["EVENTUAL"] | None = None, transaction: bytes | None = None, retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -455,8 +456,8 @@ def get_multi( def put_multi_async( entities: list[Model], retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -470,8 +471,8 @@ def put_multi_async( def put_multi( entities: list[Model], retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -485,8 +486,8 @@ def put_multi( def delete_multi_async( keys: Sequence[key_module.Key], retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, @@ -500,8 +501,8 @@ def delete_multi_async( def delete_multi( keys: Sequence[key_module.Key], retries: int | None = None, - timeout: float | None = None, - deadline: float | None = None, + timeout: FloatInt | None = None, + deadline: FloatInt | None = None, use_cache: bool | None = None, use_global_cache: bool | None = None, global_cache_timeout: int | None = None, diff --git a/stubs/grpcio/grpc/__init__.pyi b/stubs/grpcio/grpc/__init__.pyi index 9e7160589f9c..5e6ede411d36 100644 --- a/stubs/grpcio/grpc/__init__.pyi +++ b/stubs/grpcio/grpc/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc import enum import threading @@ -58,15 +59,15 @@ class Future(abc.ABC, Generic[_TFutureValue]): @abc.abstractmethod def done(self) -> bool: ... @abc.abstractmethod - def exception(self, timeout: float | None = None) -> Exception | None: ... + def exception(self, timeout: FloatInt | None = None) -> Exception | None: ... @abc.abstractmethod - def result(self, timeout: float | None = None) -> _TFutureValue: ... + def result(self, timeout: FloatInt | None = None) -> _TFutureValue: ... @abc.abstractmethod def running(self) -> bool: ... # FIXME: unsure of the exact return type here. Is it a traceback.StackSummary? @abc.abstractmethod - def traceback(self, timeout: float | None = None): ... + def traceback(self, timeout: FloatInt | None = None): ... # Create Client: @@ -278,11 +279,11 @@ class Server(abc.ABC): # Grace period is in seconds. @abc.abstractmethod - def stop(self, grace: float | None) -> threading.Event: ... + def stop(self, grace: FloatInt | None) -> threading.Event: ... # Block current thread until the server stops. Returns a bool # indicates if the operation times out. Timeout is in seconds. - def wait_for_termination(self, timeout: float | None = None) -> bool: ... + def wait_for_termination(self, timeout: FloatInt | None = None) -> bool: ... # Authentication & Authorization Objects: @@ -361,7 +362,7 @@ class Call(RpcContext, metaclass=abc.ABCMeta): class ClientCallDetails(abc.ABC): method: str - timeout: float | None + timeout: FloatInt | None metadata: _Metadata | None credentials: CallCredentials | None @@ -520,7 +521,7 @@ class UnaryUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def __call__( self, request: _TRequest, - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _Metadata | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -530,7 +531,7 @@ class UnaryUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def future( self, request: _TRequest, - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _Metadata | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -540,7 +541,7 @@ class UnaryUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def with_call( self, request: _TRequest, - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _Metadata | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -554,7 +555,7 @@ class UnaryStreamMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def __call__( self, request: _TRequest, - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _Metadata | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -566,7 +567,7 @@ class StreamUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def __call__( self, request_iterator: Iterator[_TRequest], - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _Metadata | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -576,7 +577,7 @@ class StreamUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def future( self, request_iterator: Iterator[_TRequest], - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _Metadata | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -586,7 +587,7 @@ class StreamUnaryMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def with_call( self, request_iterator: Iterator[_TRequest], - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _Metadata | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -600,7 +601,7 @@ class StreamStreamMultiCallable(abc.ABC, Generic[_TRequest, _TResponse]): def __call__( self, request_iterator: Iterator[_TRequest], - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _Metadata | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, diff --git a/stubs/grpcio/grpc/aio/__init__.pyi b/stubs/grpcio/grpc/aio/__init__.pyi index 06819e6aa75a..bd1c8b3ec4df 100644 --- a/stubs/grpcio/grpc/aio/__init__.pyi +++ b/stubs/grpcio/grpc/aio/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc import asyncio from _typeshed import Incomplete, MaybeNone @@ -143,7 +144,7 @@ _Deserializer: TypeAlias = Callable[[bytes], _T] class Channel(abc.ABC): @abc.abstractmethod - async def close(self, grace: float | None = None) -> None: ... + async def close(self, grace: FloatInt | None = None) -> None: ... @abc.abstractmethod def get_state(self, try_to_connect: bool = False) -> ChannelConnectivity: ... @abc.abstractmethod @@ -206,11 +207,11 @@ class Server(metaclass=abc.ABCMeta): # Grace period is in seconds. @abc.abstractmethod - async def stop(self, grace: float | None) -> None: ... + async def stop(self, grace: FloatInt | None) -> None: ... # Returns a bool indicates if the operation times out. Timeout is in seconds. @abc.abstractmethod - async def wait_for_termination(self, timeout: float | None = None) -> bool: ... + async def wait_for_termination(self, timeout: FloatInt | None = None) -> bool: ... # Client-Side Context: @@ -320,14 +321,14 @@ class ClientCallDetails(abc.ABC): def __new__( _cls, method: str, - timeout: float | None, + timeout: FloatInt | None, metadata: Metadata | None, credentials: CallCredentials | None, wait_for_ready: bool | None, ) -> Self: ... method: str - timeout: float | None + timeout: FloatInt | None metadata: Metadata | None credentials: CallCredentials | None @@ -359,7 +360,7 @@ class InterceptedUnaryUnaryCall(_InterceptedCall[_TRequest, _TResponse], metacla self, interceptors: Sequence[UnaryUnaryClientInterceptor], request: _TRequest, - timeout: float | None, + timeout: FloatInt | None, metadata: Metadata, credentials: CallCredentials | None, wait_for_ready: bool | None, @@ -376,7 +377,7 @@ class InterceptedUnaryUnaryCall(_InterceptedCall[_TRequest, _TResponse], metacla self, interceptors: Sequence[UnaryUnaryClientInterceptor], method: bytes, - timeout: float | None, + timeout: FloatInt | None, metadata: Metadata | None, credentials: CallCredentials | None, wait_for_ready: bool | None, @@ -465,7 +466,7 @@ class UnaryUnaryMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABCM self, request: _TRequest, *, - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _MetadataType | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -478,7 +479,7 @@ class UnaryStreamMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABC self, request: _TRequest, *, - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _MetadataType | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -490,7 +491,7 @@ class StreamUnaryMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.ABC def __call__( self, request_iterator: AsyncIterator[_TRequest] | Iterator[_TRequest] | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _MetadataType | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, @@ -502,7 +503,7 @@ class StreamStreamMultiCallable(Generic[_TRequest, _TResponse], metaclass=abc.AB def __call__( self, request_iterator: AsyncIterator[_TRequest] | Iterator[_TRequest] | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, metadata: _MetadataType | None = None, credentials: CallCredentials | None = None, wait_for_ready: bool | None = None, diff --git a/stubs/gunicorn/gunicorn/arbiter.pyi b/stubs/gunicorn/gunicorn/arbiter.pyi index 422a711477c6..a83949e7834b 100644 --- a/stubs/gunicorn/gunicorn/arbiter.pyi +++ b/stubs/gunicorn/gunicorn/arbiter.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from queue import SimpleQueue from types import FrameType from typing import ClassVar @@ -62,7 +63,7 @@ class Arbiter: def maybe_promote_master(self) -> None: ... def wakeup(self) -> None: ... def halt(self, reason: str | None = None, exit_status: int = 0) -> None: ... - def wait_for_signals(self, timeout: float | None = 1.0) -> list[int]: ... + def wait_for_signals(self, timeout: FloatInt | None = 1.0) -> list[int]: ... def stop(self, graceful: bool = True) -> None: ... def reexec(self) -> None: ... def reload(self) -> None: ... diff --git a/stubs/gunicorn/gunicorn/ctl/client.pyi b/stubs/gunicorn/gunicorn/ctl/client.pyi index 7cc5912eed33..9eaf17d809c4 100644 --- a/stubs/gunicorn/gunicorn/ctl/client.pyi +++ b/stubs/gunicorn/gunicorn/ctl/client.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, Unused from typing_extensions import Self @@ -5,8 +6,8 @@ class ControlClientError(Exception): ... class ControlClient: socket_path: str - timeout: float - def __init__(self, socket_path: str, timeout: float = 30.0) -> None: ... + timeout: FloatInt + def __init__(self, socket_path: str, timeout: FloatInt = 30.0) -> None: ... def connect(self) -> None: ... def close(self) -> None: ... def send_command(self, command: str, args: list[str] | None = None) -> dict[Incomplete, Incomplete]: ... diff --git a/stubs/gunicorn/gunicorn/ctl/handlers.pyi b/stubs/gunicorn/gunicorn/ctl/handlers.pyi index 7814cef1cb3c..2bea29e3e954 100644 --- a/stubs/gunicorn/gunicorn/ctl/handlers.pyi +++ b/stubs/gunicorn/gunicorn/ctl/handlers.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Literal, TypedDict, type_check_only from typing_extensions import NotRequired @@ -9,7 +10,7 @@ class _Worker(TypedDict): pid: int age: int booted: bool - last_heartbeat: float + last_heartbeat: FloatInt aborted: NotRequired[bool] apps: NotRequired[list[str]] @@ -34,7 +35,7 @@ class _ShowDirtyReturnType(TypedDict): @type_check_only class _ShowStatsReturnType(TypedDict): - uptime: float | None + uptime: FloatInt | None pid: int workers_current: int workers_target: int diff --git a/stubs/gunicorn/gunicorn/dirty/client.pyi b/stubs/gunicorn/gunicorn/dirty/client.pyi index 3d77eb9a31df..a37a7e3e1d1f 100644 --- a/stubs/gunicorn/gunicorn/dirty/client.pyi +++ b/stubs/gunicorn/gunicorn/dirty/client.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from types import TracebackType from typing import Any, ClassVar @@ -5,9 +6,9 @@ from typing_extensions import Self class DirtyClient: socket_path: str - timeout: float + timeout: FloatInt - def __init__(self, socket_path: str, timeout: float = 30.0) -> None: ... + def __init__(self, socket_path: str, timeout: FloatInt = 30.0) -> None: ... def connect(self) -> None: ... # Arguments and result depend on app path and method name passed to action def execute(self, app_path: str, action: str, *args: Any, **kwargs: Any) -> Any: ... @@ -27,7 +28,7 @@ class DirtyClient: ) -> None: ... class DirtyStreamIterator: - DEFAULT_IDLE_TIMEOUT: ClassVar[float] + DEFAULT_IDLE_TIMEOUT: ClassVar[FloatInt] client: DirtyClient app_path: str action: str @@ -41,13 +42,13 @@ class DirtyStreamIterator: action: str, args: tuple[Incomplete, ...], kwargs: dict[str, Incomplete], - idle_timeout: float | None = None, + idle_timeout: FloatInt | None = None, ) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> Incomplete | None: ... class DirtyAsyncStreamIterator: - DEFAULT_IDLE_TIMEOUT: ClassVar[float] + DEFAULT_IDLE_TIMEOUT: ClassVar[FloatInt] client: DirtyClient app_path: str action: str @@ -61,14 +62,14 @@ class DirtyAsyncStreamIterator: action: str, args: tuple[Incomplete, ...], kwargs: dict[str, Incomplete], - idle_timeout: float | None = None, + idle_timeout: FloatInt | None = None, ) -> None: ... def __aiter__(self) -> Self: ... async def __anext__(self) -> Incomplete | None: ... def set_dirty_socket_path(path: str) -> None: ... def get_dirty_socket_path() -> str: ... -def get_dirty_client(timeout: float = 30.0) -> DirtyClient: ... -async def get_dirty_client_async(timeout: float = 30.0) -> DirtyClient: ... +def get_dirty_client(timeout: FloatInt = 30.0) -> DirtyClient: ... +async def get_dirty_client_async(timeout: FloatInt = 30.0) -> DirtyClient: ... def close_dirty_client() -> None: ... async def close_dirty_client_async() -> None: ... diff --git a/stubs/gunicorn/gunicorn/dirty/errors.pyi b/stubs/gunicorn/gunicorn/dirty/errors.pyi index 0bfd9ed341ab..1434d360931e 100644 --- a/stubs/gunicorn/gunicorn/dirty/errors.pyi +++ b/stubs/gunicorn/gunicorn/dirty/errors.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import TypedDict, type_check_only @@ -17,9 +18,9 @@ class DirtyError(Exception): def from_dict(cls, data: dict[str, Incomplete]) -> DirtyError: ... class DirtyTimeoutError(DirtyError): - timeout: float | None + timeout: FloatInt | None - def __init__(self, message: str = "Operation timed out", timeout: float | None = None) -> None: ... + def __init__(self, message: str = "Operation timed out", timeout: FloatInt | None = None) -> None: ... class DirtyConnectionError(DirtyError): socket_path: str | None diff --git a/stubs/gunicorn/gunicorn/dirty/stash.pyi b/stubs/gunicorn/gunicorn/dirty/stash.pyi index 113180170b71..b8756f7cb02e 100644 --- a/stubs/gunicorn/gunicorn/dirty/stash.pyi +++ b/stubs/gunicorn/gunicorn/dirty/stash.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterator from types import TracebackType @@ -20,9 +21,9 @@ class StashKeyNotFoundError(StashError): class StashClient: socket_path: str - timeout: float + timeout: FloatInt - def __init__(self, socket_path: str, timeout: float = 30.0) -> None: ... + def __init__(self, socket_path: str, timeout: FloatInt = 30.0) -> None: ... def put(self, table: str, key: str, value) -> None: ... def get(self, table: str, key: str, default=None): ... def delete(self, table: str, key: str) -> bool: ... diff --git a/stubs/gunicorn/gunicorn/dirty/tlv.pyi b/stubs/gunicorn/gunicorn/dirty/tlv.pyi index abc9f1432a34..82218458d2e4 100644 --- a/stubs/gunicorn/gunicorn/dirty/tlv.pyi +++ b/stubs/gunicorn/gunicorn/dirty/tlv.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -17,7 +18,7 @@ MAX_DICT_SIZE: Final = 1048576 class TLVEncoder: @staticmethod def encode( - value: bool | float | str | bytes | list[Incomplete] | tuple[Incomplete, ...] | dict[object, Incomplete] | None, + value: bool | FloatInt | str | bytes | list[Incomplete] | tuple[Incomplete, ...] | dict[object, Incomplete] | None, ) -> bytes: ... # dict key passed to `str()` function @staticmethod def decode(data: bytes, offset: int = 0) -> tuple[Incomplete, int]: ... diff --git a/stubs/gunicorn/gunicorn/http/parser.pyi b/stubs/gunicorn/gunicorn/http/parser.pyi index 5da5625d7d67..0e6c3ad06891 100644 --- a/stubs/gunicorn/gunicorn/http/parser.pyi +++ b/stubs/gunicorn/gunicorn/http/parser.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import socket from collections.abc import Callable, Iterable, Iterator from typing import ClassVar @@ -19,7 +20,7 @@ class Parser: def __init__(self, cfg: Config, source: socket.socket | Iterable[bytes], source_addr: _AddressType) -> None: ... def __iter__(self) -> Iterator[Request]: ... - def finish_body(self, deadline: float | None = None, max_bytes: int | None = None) -> None: ... + def finish_body(self, deadline: FloatInt | None = None, max_bytes: int | None = None) -> None: ... def __next__(self) -> Request: ... next: Callable[[Parser], Request] diff --git a/stubs/gunicorn/gunicorn/http2/async_connection.pyi b/stubs/gunicorn/gunicorn/http2/async_connection.pyi index 1cc1d687ea03..da99ad328bcb 100644 --- a/stubs/gunicorn/gunicorn/http2/async_connection.pyi +++ b/stubs/gunicorn/gunicorn/http2/async_connection.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from asyncio import StreamReader, StreamWriter from collections.abc import Iterable @@ -29,7 +30,7 @@ class AsyncHTTP2Connection: async def initiate_upgrade( self, settings_header: bytes | None, http1_req: Request, body: bytes | None = b"" ) -> HTTP2Request: ... - async def receive_data(self, timeout: float | None = None) -> list[HTTP2Request]: ... + async def receive_data(self, timeout: FloatInt | None = None) -> list[HTTP2Request]: ... async def send_informational(self, stream_id: int, status: int, headers: Iterable[tuple[str, Incomplete]]) -> None: ... async def send_response( self, stream_id: int, status: int, headers: Iterable[tuple[str, Incomplete]], body: bytes | None = None diff --git a/stubs/gunicorn/gunicorn/http2/negotiation.pyi b/stubs/gunicorn/gunicorn/http2/negotiation.pyi index f6e8bef46fdc..62f93ca621a7 100644 --- a/stubs/gunicorn/gunicorn/http2/negotiation.pyi +++ b/stubs/gunicorn/gunicorn/http2/negotiation.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import socket from typing import Final, Literal, Protocol, type_check_only @@ -20,7 +21,7 @@ def peer_trusted_for_h2c(cfg: Config, peer_addr: _AddressType) -> bool: ... def prior_knowledge_allowed(cfg: Config, peer_addr: _AddressType) -> bool: ... def mismatch_is_error(cfg: Config) -> bool: ... def upgrade_allowed(cfg: Config, peer_addr: _AddressType) -> bool: ... -def read_preface_blocking(sock: socket.socket, timeout: float | None = None) -> tuple[bool, bytes]: ... +def read_preface_blocking(sock: socket.socket, timeout: FloatInt | None = None) -> tuple[bool, bytes]: ... UPGRADE_101: Final[bytes] diff --git a/stubs/gunicorn/gunicorn/instrument/statsd.pyi b/stubs/gunicorn/gunicorn/instrument/statsd.pyi index d08e86de095d..04671da32d3a 100644 --- a/stubs/gunicorn/gunicorn/instrument/statsd.pyi +++ b/stubs/gunicorn/gunicorn/instrument/statsd.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging import socket from collections.abc import Mapping @@ -92,8 +93,8 @@ class Statsd(Logger): extra: Mapping[str, object] | None = None, ) -> None: ... def access(self, resp: Response, req: Request, environ: _EnvironType, request_time: timedelta) -> None: ... - def gauge(self, name: str, value: float) -> None: ... - def increment(self, name: str, value: int, sampling_rate: float = 1.0) -> None: ... - def decrement(self, name: str, value: int, sampling_rate: float = 1.0) -> None: ... - def timer(self, name: str, value: float) -> None: ... - def histogram(self, name: str, value: float) -> None: ... + def gauge(self, name: str, value: FloatInt) -> None: ... + def increment(self, name: str, value: int, sampling_rate: FloatInt = 1.0) -> None: ... + def decrement(self, name: str, value: int, sampling_rate: FloatInt = 1.0) -> None: ... + def timer(self, name: str, value: FloatInt) -> None: ... + def histogram(self, name: str, value: FloatInt) -> None: ... diff --git a/stubs/gunicorn/gunicorn/util.pyi b/stubs/gunicorn/gunicorn/util.pyi index f635cef2e69b..5f6a66f2bf10 100644 --- a/stubs/gunicorn/gunicorn/util.pyi +++ b/stubs/gunicorn/gunicorn/util.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import types from _typeshed import FileDescriptorLike, FileDescriptorOrPath, StrOrBytesPath from inspect import _IntrospectableCallable, _ParameterKind @@ -31,14 +32,14 @@ def parse_address(netloc: str, default_port: str = "8000") -> _AddressType: ... def close_on_exec(fd: FileDescriptorLike) -> None: ... def set_non_blocking(fd: FileDescriptorLike) -> None: ... def close(sock: socket) -> None: ... -def close_graceful(sock: socket, timeout: float = 2.0, max_drain: int = 65536) -> None: ... +def close_graceful(sock: socket, timeout: FloatInt = 2.0, max_drain: int = 65536) -> None: ... def write_chunk(sock: socket, data: bytes) -> None: ... def write(sock: socket, data: bytes, chunked: bool = False) -> None: ... def write_nonblock(sock: socket, data: bytes, chunked: bool = False) -> None: ... def write_error(sock: socket, status_int: int, reason: str, mesg: str) -> None: ... def import_app(module: str) -> _WSGIAppType: ... def getcwd() -> str: ... -def http_date(timestamp: float | None = None) -> str: ... +def http_date(timestamp: FloatInt | None = None) -> str: ... def is_hoppish(header: str) -> bool: ... def daemonize(enable_stdio_inheritance: bool = False) -> None: ... def seed() -> None: ... diff --git a/stubs/gunicorn/gunicorn/workers/gthread.pyi b/stubs/gunicorn/gunicorn/workers/gthread.pyi index 65e5058f9e2e..38b9a3e09fb9 100644 --- a/stubs/gunicorn/gunicorn/workers/gthread.pyi +++ b/stubs/gunicorn/gunicorn/workers/gthread.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import socket from _typeshed import Unused from collections import deque @@ -23,7 +24,7 @@ class TConn: sock: socket.socket client: _AddressType server: _AddressType - timeout: float | None + timeout: FloatInt | None parser: HTTP2ServerConnection | UWSGIParser | RequestParser | None initialized: bool is_http2: bool @@ -32,7 +33,7 @@ class TConn: def __init__(self, cfg: Config, sock: socket.socket, client: _AddressType, server: _AddressType) -> None: ... def init(self) -> None: ... def set_timeout(self) -> None: ... - def wait_for_data(self, timeout: float | None) -> bool: ... + def wait_for_data(self, timeout: FloatInt | None) -> bool: ... def close(self, graceful: bool = False) -> None: ... class PollableMethodQueue: @@ -71,7 +72,7 @@ class ThreadWorker(base.Worker): def murder_keepalived(self) -> None: ... def murder_pending(self) -> None: ... def is_parent_alive(self) -> bool: ... - def wait_for_and_dispatch_events(self, timeout: float | None) -> None: ... + def wait_for_and_dispatch_events(self, timeout: FloatInt | None) -> None: ... def run(self) -> None: ... def finish_request(self, conn: TConn, fs: Future[bool]) -> None: ... def handle(self, conn: TConn) -> bool: ... diff --git a/stubs/hdbcli/hdbcli/dbapi.pyi b/stubs/hdbcli/hdbcli/dbapi.pyi index 4acfa34cdcfd..7deaff4fd560 100644 --- a/stubs/hdbcli/hdbcli/dbapi.pyi +++ b/stubs/hdbcli/hdbcli/dbapi.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import decimal from _typeshed import Incomplete, ReadableBuffer from collections.abc import Callable, Sequence @@ -132,9 +133,9 @@ class ExecuteManyErrorEntry(Error): def Date(year: int, month: int, day: int) -> date: ... def Time(hour: int, minute: int, second: int, millisecond: int = 0) -> time: ... def Timestamp(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int = 0) -> datetime: ... -def DateFromTicks(ticks: float) -> date: ... -def TimeFromTicks(ticks: float) -> time: ... -def TimestampFromTicks(ticks: float) -> datetime: ... +def DateFromTicks(ticks: FloatInt) -> date: ... +def TimeFromTicks(ticks: FloatInt) -> time: ... +def TimestampFromTicks(ticks: FloatInt) -> datetime: ... def Binary(data: ReadableBuffer) -> memoryview: ... Decimal = decimal.Decimal diff --git a/stubs/httplib2/httplib2/__init__.pyi b/stubs/httplib2/httplib2/__init__.pyi index 7be7c15e3ea0..e8dbea66b4cb 100644 --- a/stubs/httplib2/httplib2/__init__.pyi +++ b/stubs/httplib2/httplib2/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import builtins import email.message import http.client @@ -34,7 +35,7 @@ __all__ = [ "UnimplementedHmacDigestAuthOptionError", ] -def has_timeout(timeout: float | None) -> bool: ... +def has_timeout(timeout: FloatInt | None) -> bool: ... debuglevel: Final[int] RETRIES: Final[int] @@ -158,7 +159,7 @@ class HTTPSConnectionWithTimeout(http.client.HTTPSConnection): port: int | None = None, key_file: StrOrBytesPath | None = None, cert_file: StrOrBytesPath | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, proxy_info=None, ca_certs: StrOrBytesPath | None = None, disable_ssl_certificate_validation: bool = False, @@ -189,13 +190,13 @@ class Http: follow_all_redirects: bool ignore_etag: bool force_exception_to_status_code: bool - timeout: float | None + timeout: FloatInt | None forward_authorization_headers: bool - limit_kwargs: dict[str, float] + limit_kwargs: dict[str, FloatInt] def __init__( self, cache: str | FileCache | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, proxy_info=..., ca_certs=None, disable_ssl_certificate_validation: bool = False, diff --git a/stubs/httplib2/httplib2/decode.pyi b/stubs/httplib2/httplib2/decode.pyi index 9c9e14ca1601..a8bafd61cf71 100644 --- a/stubs/httplib2/httplib2/decode.pyi +++ b/stubs/httplib2/httplib2/decode.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final, Protocol class DecodeRatioError(Exception): ... @@ -41,7 +42,7 @@ class LimitDecoder(DecoderProtocol): def __init__( self, decoder: DecoderProtocol, - ratio: float = 100, + ratio: FloatInt = 100, chunk_size: int = 65536, safe_limit: int = 10485760, hard_limit: int = ..., diff --git a/stubs/httpretty/httpretty/core.pyi b/stubs/httpretty/httpretty/core.pyi index d858deefecdb..dcb3632294fa 100644 --- a/stubs/httpretty/httpretty/core.pyi +++ b/stubs/httpretty/httpretty/core.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re from collections.abc import Callable, Iterable, Mapping from contextlib import AbstractContextManager @@ -22,7 +23,7 @@ _Headers: TypeAlias = Mapping[str, _HeaderValue] _Body: TypeAlias = str | bytes _ResponseBody: TypeAlias = _Body | Callable[[HTTPrettyRequest, str, _Headers], tuple[int, _Headers, _Body]] -def set_default_thread_timeout(timeout: float) -> None: ... +def set_default_thread_timeout(timeout: FloatInt) -> None: ... def get_default_thread_timeout() -> float: ... class HTTPrettyRequest(HttpBaseClass): @@ -31,7 +32,7 @@ class HTTPrettyRequest(HttpBaseClass): path: str querystring: dict[str, list[str]] parsed_body: Any # It can be any object after parsing raw (str) body - created_at: float + created_at: FloatInt def __init__( self, headers: str | bytes, body: _Body = "", sock: object | None = None, path_encoding: str = "iso-8859-1" ) -> None: ... diff --git a/stubs/inifile/inifile.pyi b/stubs/inifile/inifile.pyi index db23bc4e06ce..45e5700205a9 100644 --- a/stubs/inifile/inifile.pyi +++ b/stubs/inifile/inifile.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import StrPath, SupportsKeysAndGetItem from collections.abc import Container, Iterable, Iterator, Mapping, MutableMapping, Sequence from typing import Literal, TypeAlias, TypeVar, overload @@ -47,7 +48,7 @@ class Dialect: def kv_serialize(self, key: str, val: str | None) -> str | None: ... def escape(self, value: str, quote: str | None = ...) -> str: ... def unescape(self, value: str) -> str: ... - def to_string(self, value: bool | float | str) -> str: ... + def to_string(self, value: bool | FloatInt | str) -> str: ... def dict_from_iterable(self, iterable: Iterable[str]) -> MutableMapping[str, str]: ... def tokenize(self, iterable: Iterable[str]) -> Iterator[_Token]: ... def update_tokens( diff --git a/stubs/jsonnet/_jsonnet.pyi b/stubs/jsonnet/_jsonnet.pyi index cad86c28b9d1..ddf24fcbeefb 100644 --- a/stubs/jsonnet/_jsonnet.pyi +++ b/stubs/jsonnet/_jsonnet.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import Final @@ -9,7 +10,7 @@ def evaluate_file( jpathdir: str | list[str] | None = ..., max_stack: int = 500, gc_min_objects: int = 1000, - gc_growth_trigger: float = 2, + gc_growth_trigger: FloatInt = 2, ext_vars: dict[str, str] | None = ..., ext_codes: dict[str, str] | None = ..., tla_vars: dict[str, str] | None = ..., @@ -24,7 +25,7 @@ def evaluate_snippet( jpathdir: str | list[str] | None = ..., max_stack: int = 500, gc_min_objects: int = 1000, - gc_growth_trigger: float = 2, + gc_growth_trigger: FloatInt = 2, ext_vars: dict[str, str] | None = ..., ext_codes: dict[str, str] | None = ..., tla_vars: dict[str, str] | None = ..., diff --git a/stubs/kafka-python/kafka/admin/_partitions.pyi b/stubs/kafka-python/kafka/admin/_partitions.pyi index fde83e35b19f..fd38353fb149 100644 --- a/stubs/kafka-python/kafka/admin/_partitions.pyi +++ b/stubs/kafka-python/kafka/admin/_partitions.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Mapping, Sequence from typing_extensions import deprecated @@ -15,7 +16,7 @@ class PartitionAdminMixin: raise_errors: bool = True, ): ... def delete_records( - self, records_to_delete: Mapping[TopicPartition, int], timeout_ms: float | None = None, partition_leader_id=None + self, records_to_delete: Mapping[TopicPartition, int], timeout_ms: FloatInt | None = None, partition_leader_id=None ) -> dict[TopicPartition, Incomplete]: ... def elect_leaders(self, election_type, topic_partitions=None, timeout_ms=None, raise_errors: bool = True): ... def alter_partition_reassignments(self, reassignments, timeout_ms=None): ... diff --git a/stubs/kafka-python/kafka/admin/_topics.pyi b/stubs/kafka-python/kafka/admin/_topics.pyi index ccdb7cc6c93c..493a4e6415cd 100644 --- a/stubs/kafka-python/kafka/admin/_topics.pyi +++ b/stubs/kafka-python/kafka/admin/_topics.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import uuid from _typeshed import Incomplete from collections.abc import Mapping, Sequence @@ -10,13 +11,13 @@ class TopicAdminMixin: def create_topics( self, new_topics: dict[str, dict[Incomplete, Incomplete]] | Sequence[NewTopic], - timeout_ms: float | None = None, + timeout_ms: FloatInt | None = None, validate_only: bool = False, raise_errors: bool = True, wait_for_metadata: bool = False, ): ... - def wait_for_topics(self, topic_names, timeout_ms: float | None = 10000): ... - def delete_topics(self, topics: Sequence[str | uuid.UUID], timeout_ms: float | None = None, raise_errors: bool = True): ... + def wait_for_topics(self, topic_names, timeout_ms: FloatInt | None = 10000): ... + def delete_topics(self, topics: Sequence[str | uuid.UUID], timeout_ms: FloatInt | None = None, raise_errors: bool = True): ... @deprecated("Deprecated since v3.0.0. Use simple `dict` instead.") class NewTopic: diff --git a/stubs/kafka-python/kafka/admin/_transactions.pyi b/stubs/kafka-python/kafka/admin/_transactions.pyi index fb381a30b34f..342f1fe0ab7b 100644 --- a/stubs/kafka-python/kafka/admin/_transactions.pyi +++ b/stubs/kafka-python/kafka/admin/_transactions.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import Incomplete from typing import NamedTuple @@ -71,10 +72,10 @@ class TransactionsAdminMixin: broker_ids=None, producer_id_filters=None, state_filters=None, - duration_filter_ms: float | None = None, + duration_filter_ms: FloatInt | None = None, transactional_id_pattern: str | None = None, ): ... def describe_transactions(self, transactional_ids): ... def describe_producers(self, partitions, broker_id: int | None = None): ... def abort_transaction(self, spec): ... - def find_hanging_transactions(self, broker_ids=None, max_transaction_timeout_ms: float = 900000): ... + def find_hanging_transactions(self, broker_ids=None, max_transaction_timeout_ms: FloatInt = 900000): ... diff --git a/stubs/kafka-python/kafka/consumer/group.pyi b/stubs/kafka-python/kafka/consumer/group.pyi index e92809f99202..3099a78a6c5d 100644 --- a/stubs/kafka-python/kafka/consumer/group.pyi +++ b/stubs/kafka-python/kafka/consumer/group.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import selectors import ssl from _typeshed import Incomplete @@ -89,41 +90,41 @@ class KafkaConsumer(Iterator[ConsumerRecord]): kafka_client: Callable[..., object] = ..., ) -> None: ... def bootstrap_connected(self): ... - def bootstrap(self, timeout_ms: float | None = None, refresh: bool = False) -> None: ... + def bootstrap(self, timeout_ms: FloatInt | None = None, refresh: bool = False) -> None: ... def assign(self, partitions: Iterable[TopicPartition]) -> None: ... def assignment(self) -> set[TopicPartition]: ... def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def close(self, autocommit: bool = True, timeout_ms: float | None = None) -> None: ... + def close(self, autocommit: bool = True, timeout_ms: FloatInt | None = None) -> None: ... def commit_async( self, offsets: Mapping[TopicPartition, OffsetAndMetadata] | None = None, callback: _CommitCallback | None = None ) -> Future: ... def commit( - self, offsets: Mapping[TopicPartition, OffsetAndMetadata] | None = None, timeout_ms: float | None = None + self, offsets: Mapping[TopicPartition, OffsetAndMetadata] | None = None, timeout_ms: FloatInt | None = None ) -> None: ... def group_metadata(self): ... @overload def committed( - self, partition: TopicPartition, metadata: Literal[False] = False, timeout_ms: float | None = None + self, partition: TopicPartition, metadata: Literal[False] = False, timeout_ms: FloatInt | None = None ) -> int | None: ... @overload def committed( - self, partition: TopicPartition, metadata: Literal[True], timeout_ms: float | None = None + self, partition: TopicPartition, metadata: Literal[True], timeout_ms: FloatInt | None = None ) -> OffsetAndMetadata | None: ... @overload def committed( - self, partition: TopicPartition, metadata: bool, timeout_ms: float | None = None + self, partition: TopicPartition, metadata: bool, timeout_ms: FloatInt | None = None ) -> int | OffsetAndMetadata | None: ... def topics(self) -> set[str]: ... def partitions_for_topic(self, topic: str) -> set[int]: ... def poll( - self, timeout_ms: float = 0, max_records: int | None = None, update_offsets: bool = True + self, timeout_ms: FloatInt = 0, max_records: int | None = None, update_offsets: bool = True ) -> dict[TopicPartition, list[ConsumerRecord]]: ... - def position(self, partition: TopicPartition, timeout_ms: float | None = None) -> int | None: ... + def position(self, partition: TopicPartition, timeout_ms: FloatInt | None = None) -> int | None: ... def highwater(self, partition: TopicPartition) -> int | None: ... def pause(self, *partitions: TopicPartition) -> None: ... def paused(self) -> set[TopicPartition]: ... @@ -138,11 +139,11 @@ class KafkaConsumer(Iterator[ConsumerRecord]): def unsubscribe(self) -> None: ... def metrics(self, raw: bool = False) -> dict[str, dict[str, object]] | dict[object, object] | None: ... def offsets_for_times( - self, timestamps: Mapping[TopicPartition, int], timeout_ms: float | None = None + self, timestamps: Mapping[TopicPartition, int], timeout_ms: FloatInt | None = None ) -> dict[TopicPartition, OffsetAndTimestamp | None]: ... def beginning_offsets( - self, partitions: Iterable[TopicPartition], timeout_ms: float | None = None + self, partitions: Iterable[TopicPartition], timeout_ms: FloatInt | None = None ) -> dict[TopicPartition, int]: ... - def end_offsets(self, partitions: Iterable[TopicPartition], timeout_ms: float | None = None) -> dict[TopicPartition, int]: ... + def end_offsets(self, partitions: Iterable[TopicPartition], timeout_ms: FloatInt | None = None) -> dict[TopicPartition, int]: ... def __iter__(self) -> Self: ... def __next__(self) -> ConsumerRecord: ... diff --git a/stubs/kafka-python/kafka/coordinator/heartbeat.pyi b/stubs/kafka-python/kafka/coordinator/heartbeat.pyi index 87bb2db6ff5d..9a052c36a879 100644 --- a/stubs/kafka-python/kafka/coordinator/heartbeat.pyi +++ b/stubs/kafka-python/kafka/coordinator/heartbeat.pyi @@ -1,12 +1,13 @@ +from _typeshed import FloatInt from _typeshed import Incomplete class Heartbeat: DEFAULT_CONFIG: dict[str, Incomplete] config: dict[str, Incomplete] - last_send: float - last_receive: float - last_poll: float - last_reset: float + last_send: FloatInt + last_receive: FloatInt + last_poll: FloatInt + last_reset: FloatInt heartbeat_failed: bool | None def __init__(self, **configs) -> None: ... def poll(self) -> None: ... diff --git a/stubs/kafka-python/kafka/metrics/stats/percentiles.pyi b/stubs/kafka-python/kafka/metrics/stats/percentiles.pyi index 5f40f4193eb3..354850fa5656 100644 --- a/stubs/kafka-python/kafka/metrics/stats/percentiles.pyi +++ b/stubs/kafka-python/kafka/metrics/stats/percentiles.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from kafka.metrics.compound_stat import AbstractCompoundStat @@ -9,7 +10,7 @@ class BucketSizing: class Percentiles(AbstractSampledStat, AbstractCompoundStat): __slots__ = ("_initial_value", "_samples", "_current", "_percentiles", "_buckets", "_bin_scheme") - def __init__(self, size_in_bytes, bucketing, max_val, min_val: float = 0.0, percentiles=None) -> None: ... + def __init__(self, size_in_bytes, bucketing, max_val, min_val: FloatInt = 0.0, percentiles=None) -> None: ... def stats(self): ... def value(self, config, now, quantile): ... def combine(self, samples, config, now): ... diff --git a/stubs/kafka-python/kafka/metrics/stats/sensor.pyi b/stubs/kafka-python/kafka/metrics/stats/sensor.pyi index af3baa05db05..f627631c36a9 100644 --- a/stubs/kafka-python/kafka/metrics/stats/sensor.pyi +++ b/stubs/kafka-python/kafka/metrics/stats/sensor.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt class Sensor: __slots__ = ( "_lock", @@ -15,7 +16,7 @@ class Sensor: def name(self): ... @property def metrics(self): ... - def record(self, value: float = 1.0, time_ms=None) -> None: ... + def record(self, value: FloatInt = 1.0, time_ms=None) -> None: ... def add_compound(self, compound_stat, config=None) -> None: ... def add(self, metric_name, stat, config=None) -> None: ... def has_expired(self): ... diff --git a/stubs/kafka-python/kafka/metrics/stats/total.pyi b/stubs/kafka-python/kafka/metrics/stats/total.pyi index bd52102f6cfb..134bab9eabe2 100644 --- a/stubs/kafka-python/kafka/metrics/stats/total.pyi +++ b/stubs/kafka-python/kafka/metrics/stats/total.pyi @@ -1,7 +1,8 @@ +from _typeshed import FloatInt from kafka.metrics.measurable_stat import AbstractMeasurableStat class Total(AbstractMeasurableStat): __slots__ = ("_total",) - def __init__(self, value: float = 0.0) -> None: ... + def __init__(self, value: FloatInt = 0.0) -> None: ... def record(self, config, value, now) -> None: ... def measure(self, config, now): ... diff --git a/stubs/kafka-python/kafka/net/connection.pyi b/stubs/kafka-python/kafka/net/connection.pyi index 0112c13275ed..9704c98d23e1 100644 --- a/stubs/kafka-python/kafka/net/connection.pyi +++ b/stubs/kafka-python/kafka/net/connection.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections import deque from collections.abc import Generator @@ -39,13 +40,13 @@ class KafkaConnection: def pause_writing(self) -> None: ... def resume_writing(self) -> None: ... def close(self, error=None) -> None: ... - async def initialize(self, timeout_at: float | None = None) -> None: ... + async def initialize(self, timeout_at: FloatInt | None = None) -> None: ... @property def sasl_enabled(self) -> bool: ... class SaslReauthenticator: session_lifetime_ms: Incomplete - authenticated_at: float | None + authenticated_at: FloatInt | None def __init__(self, conn) -> None: ... @property def is_reauthenticating(self) -> bool: ... diff --git a/stubs/kafka-python/kafka/net/transport.pyi b/stubs/kafka-python/kafka/net/transport.pyi index acfb577e6fa4..e2ab6aed65f0 100644 --- a/stubs/kafka-python/kafka/net/transport.pyi +++ b/stubs/kafka-python/kafka/net/transport.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt import socket from _typeshed import Incomplete class KafkaTCPTransport: host: Incomplete | None - last_write: float - last_read: float + last_write: FloatInt + last_read: FloatInt def __init__(self, net, sock, host=None) -> None: ... @property def last_activity(self) -> float: ... diff --git a/stubs/kafka-python/kafka/producer/kafka.pyi b/stubs/kafka-python/kafka/producer/kafka.pyi index 1084cd1f926e..8a73bcc74407 100644 --- a/stubs/kafka-python/kafka/producer/kafka.pyi +++ b/stubs/kafka-python/kafka/producer/kafka.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import selectors import ssl from _typeshed import Incomplete @@ -30,7 +31,7 @@ class KafkaProducer: enable_idempotence: bool = True, transactional_id: str | None = None, transaction_timeout_ms: int = 60000, - delivery_timeout_ms: float = 120000, + delivery_timeout_ms: FloatInt = 120000, acks: int | Literal["all"] = -1, compression_type: Literal["gzip", "snappy", "lz4", "zstd"] | None = None, retries: int | float = ..., @@ -85,7 +86,7 @@ class KafkaProducer: def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> None: ... - def close(self, timeout: float | None = None, null_logger: bool = False) -> None: ... + def close(self, timeout: FloatInt | None = None, null_logger: bool = False) -> None: ... def partitions_for(self, topic: str) -> set[int]: ... @classmethod def max_usable_produce_magic(cls, api_version): ... @@ -105,5 +106,5 @@ class KafkaProducer: partition: int | None = None, timestamp_ms: int | None = None, ) -> FutureRecordMetadata: ... - def flush(self, timeout: float | None = None) -> None: ... + def flush(self, timeout: FloatInt | None = None) -> None: ... def metrics(self, raw: bool = False) -> dict[str, dict[str, object]] | dict[object, object] | None: ... diff --git a/stubs/kafka-python/kafka/producer/producer_batch.pyi b/stubs/kafka-python/kafka/producer/producer_batch.pyi index dc6d522e3028..1b33827c0b75 100644 --- a/stubs/kafka-python/kafka/producer/producer_batch.pyi +++ b/stubs/kafka-python/kafka/producer/producer_batch.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from enum import IntEnum @@ -10,15 +11,15 @@ class FinalState(IntEnum): class ProducerBatch: max_record_size: int - created: float + created: FloatInt drained: Incomplete | None attempts: int - last_attempt: float - last_append: float + last_attempt: FloatInt + last_append: FloatInt records: Incomplete topic_partition: Incomplete produce_future: FutureProduceResult - def __init__(self, tp, records, now: float | None = None) -> None: ... + def __init__(self, tp, records, now: FloatInt | None = None) -> None: ... @property def final_state(self): ... @property diff --git a/stubs/kafka-python/kafka/producer/record_accumulator.pyi b/stubs/kafka-python/kafka/producer/record_accumulator.pyi index 23b060c00a16..d3d451bfe738 100644 --- a/stubs/kafka-python/kafka/producer/record_accumulator.pyi +++ b/stubs/kafka-python/kafka/producer/record_accumulator.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete class AtomicInteger: @@ -15,16 +16,16 @@ class RecordAccumulator: def delivery_timeout_ms(self): ... @property def next_expiry_time_ms(self) -> float: ... - def append(self, tp, timestamp_ms, key, value, headers, now: float | None = None, abort_on_new_batch: bool = False): ... + def append(self, tp, timestamp_ms, key, value, headers, now: FloatInt | None = None, abort_on_new_batch: bool = False): ... def reset_next_batch_expiry_time(self) -> None: ... def maybe_update_next_batch_expiry_time(self, batch) -> None: ... def expired_batches(self, now=None) -> list[Incomplete]: ... - def split_and_reenqueue(self, batch, now: float | None = None) -> int: ... + def split_and_reenqueue(self, batch, now: FloatInt | None = None) -> int: ... def reenqueue(self, batch, now=None) -> None: ... - def ready(self, cluster, now: float | None = None): ... + def ready(self, cluster, now: FloatInt | None = None): ... def has_undrained(self) -> bool: ... - def drain_batches_for_one_node(self, cluster, node_id, max_size, now: float | None = None) -> list[Incomplete]: ... - def drain(self, cluster, nodes, max_size, now: float | None = None): ... + def drain_batches_for_one_node(self, cluster, node_id, max_size, now: FloatInt | None = None) -> list[Incomplete]: ... + def drain(self, cluster, nodes, max_size, now: FloatInt | None = None): ... def deallocate(self, batch) -> None: ... def flush_in_progress(self) -> bool: ... def begin_flush(self) -> None: ... diff --git a/stubs/kafka-python/kafka/protocol/admin/client_quotas.pyi b/stubs/kafka-python/kafka/protocol/admin/client_quotas.pyi index 1580153547ee..9ffee027b289 100644 --- a/stubs/kafka-python/kafka/protocol/admin/client_quotas.pyi +++ b/stubs/kafka-python/kafka/protocol/admin/client_quotas.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from kafka.protocol.api_message import ApiMessage @@ -17,10 +18,10 @@ class AlterClientQuotasRequest(ApiMessage): class OpData(DataContainer): key: str - value: float + value: FloatInt remove: bool def __init__( - self, *args, key: str = ..., value: float = ..., remove: bool = ..., version: int | None = None, **kwargs + self, *args, key: str = ..., value: FloatInt = ..., remove: bool = ..., version: int | None = None, **kwargs ) -> None: ... @property def version(self) -> int | None: ... @@ -161,8 +162,8 @@ class DescribeClientQuotasResponse(ApiMessage): class ValueData(DataContainer): key: str - value: float - def __init__(self, *args, key: str = ..., value: float = ..., version: int | None = None, **kwargs) -> None: ... + value: FloatInt + def __init__(self, *args, key: str = ..., value: FloatInt = ..., version: int | None = None, **kwargs) -> None: ... @property def version(self) -> int | None: ... def to_dict(self, meta: bool = False, json: bool = True) -> dict[Incomplete, Incomplete]: ... diff --git a/stubs/keyboard/keyboard/__init__.pyi b/stubs/keyboard/keyboard/__init__.pyi index a858acfa7658..1cae9268ee91 100644 --- a/stubs/keyboard/keyboard/__init__.pyi +++ b/stubs/keyboard/keyboard/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Generator, Iterable, Sequence from queue import Queue from threading import Event as _UninterruptibleEvent @@ -32,7 +33,7 @@ def release(hotkey: _ParseableHotkey) -> None: ... # is_pressed cannot check multi-step hotkeys, so not using _ParseableHotkey def is_pressed(hotkey: _Key | _ScanCodeList) -> bool: ... -def call_later(fn: Callable[..., None], args: _Ts = (), delay: float = 0.001) -> None: ... +def call_later(fn: Callable[..., None], args: _Ts = (), delay: FloatInt = 0.001) -> None: ... def hook(callback: _Callback, suppress: bool = False, on_remove: Callable[[], None] = ...) -> Callable[[], None]: ... def on_press(callback: _Callback, suppress: bool = False) -> Callable[[], None]: ... def on_release(callback: _Callback, suppress: bool = False) -> Callable[[], None]: ... @@ -58,7 +59,7 @@ def add_hotkey( callback: Callable[..., bool | None], args: _Ts = (), suppress: bool = False, - timeout: float = 1, + timeout: FloatInt = 1, trigger_on_release: bool = False, ) -> Callable[[], None]: ... @@ -84,7 +85,7 @@ unremap_hotkey = remove_hotkey def stash_state() -> list[int]: ... def restore_state(scan_codes: Iterable[int]) -> None: ... def restore_modifiers(scan_codes: Iterable[int]) -> None: ... -def write(text: str, delay: float = 0, restore_state_after: bool = True, exact: bool | None = None) -> None: ... +def write(text: str, delay: FloatInt = 0, restore_state_after: bool = True, exact: bool | None = None) -> None: ... def wait(hotkey: _ParseableHotkey | None = None, suppress: bool = False, trigger_on_release: bool = False) -> None: ... def get_hotkey_name(names: Iterable[str] | None = None) -> str: ... def read_event(suppress: bool = False) -> KeyboardEvent: ... @@ -96,16 +97,16 @@ def start_recording( ) -> tuple[Queue[KeyboardEvent], Callable[[], None]]: ... def stop_recording() -> list[KeyboardEvent]: ... def record(until: str = "escape", suppress: bool = False, trigger_on_release: bool = False) -> list[KeyboardEvent]: ... -def play(events: Iterable[KeyboardEvent], speed_factor: float = 1.0) -> None: ... +def play(events: Iterable[KeyboardEvent], speed_factor: FloatInt = 1.0) -> None: ... replay = play def add_word_listener( - word: str, callback: _Callback, triggers: Sequence[str] = ["space"], match_suffix: bool = False, timeout: float = 2 + word: str, callback: _Callback, triggers: Sequence[str] = ["space"], match_suffix: bool = False, timeout: FloatInt = 2 ) -> Callable[[], None]: ... def remove_word_listener(word_or_handler: str | _Callback) -> None: ... def add_abbreviation( - source_text: str, replacement_text: str, match_suffix: bool = False, timeout: float = 2 + source_text: str, replacement_text: str, match_suffix: bool = False, timeout: FloatInt = 2 ) -> Callable[[], None]: ... register_word_listener = add_word_listener diff --git a/stubs/keyboard/keyboard/_keyboard_event.pyi b/stubs/keyboard/keyboard/_keyboard_event.pyi index 94746c56abba..f6cef6e50f2b 100644 --- a/stubs/keyboard/keyboard/_keyboard_event.pyi +++ b/stubs/keyboard/keyboard/_keyboard_event.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal from ._canonical_names import canonical_names as canonical_names, normalize_name as normalize_name @@ -9,7 +10,7 @@ class KeyboardEvent: event_type: Literal["down", "up"] | None scan_code: int name: str | None - time: float | None + time: FloatInt | None device: str | None modifiers: tuple[str, ...] | None is_keypad: bool | None @@ -19,7 +20,7 @@ class KeyboardEvent: event_type: Literal["down", "up"] | None, scan_code: int, name: str | None = None, - time: float | None = None, + time: FloatInt | None = None, device: str | None = None, modifiers: tuple[str, ...] | None = None, is_keypad: bool | None = None, diff --git a/stubs/keyboard/keyboard/_mouse_event.pyi b/stubs/keyboard/keyboard/_mouse_event.pyi index e9e95b80e112..0fe0e702d195 100644 --- a/stubs/keyboard/keyboard/_mouse_event.pyi +++ b/stubs/keyboard/keyboard/_mouse_event.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from typing import Literal, NamedTuple, TypeAlias @@ -30,13 +31,13 @@ else: class ButtonEvent(NamedTuple): event_type: _MouseEventType button: _MouseButton - time: float + time: FloatInt class WheelEvent(NamedTuple): delta: int - time: float + time: FloatInt class MoveEvent(NamedTuple): x: int y: int - time: float + time: FloatInt diff --git a/stubs/keyboard/keyboard/mouse.pyi b/stubs/keyboard/keyboard/mouse.pyi index 6105f85d59a9..de848beb7e32 100644 --- a/stubs/keyboard/keyboard/mouse.pyi +++ b/stubs/keyboard/keyboard/mouse.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from collections.abc import Callable, Iterable from ctypes import c_long @@ -41,8 +42,8 @@ def click(button: _MouseButton = "left") -> None: ... def double_click(button: _MouseButton = "left") -> None: ... def right_click() -> None: ... def wheel(delta: int = 1) -> None: ... -def move(x: SupportsInt, y: SupportsInt, absolute: bool = True, duration: float = 0) -> None: ... -def drag(start_x: int, start_y: int, end_x: int, end_y: int, absolute: bool = True, duration: float = 0) -> None: ... +def move(x: SupportsInt, y: SupportsInt, absolute: bool = True, duration: FloatInt = 0) -> None: ... +def drag(start_x: int, start_y: int, end_x: int, end_y: int, absolute: bool = True, duration: FloatInt = 0) -> None: ... def on_button( callback: Callable[..., None], args: _Ts = (), @@ -73,7 +74,7 @@ def unhook_all() -> None: ... def record(button: _MouseButton = "right", target_types: tuple[_MouseEventType] = ("down",)) -> _MouseEvent: ... def play( events: Iterable[_MouseEvent], - speed_factor: float = 1.0, + speed_factor: FloatInt = 1.0, include_clicks: bool = True, include_moves: bool = True, include_wheel: bool = True, diff --git a/stubs/ldap3/ldap3/utils/conv.pyi b/stubs/ldap3/ldap3/utils/conv.pyi index a31439c08e46..9ca3e4488658 100644 --- a/stubs/ldap3/ldap3/utils/conv.pyi +++ b/stubs/ldap3/ldap3/utils/conv.pyi @@ -1,6 +1,7 @@ -def to_unicode(obj: float | bytes | str, encoding: str | None = None, from_server: bool = False) -> str: ... +from _typeshed import FloatInt +def to_unicode(obj: FloatInt | bytes | str, encoding: str | None = None, from_server: bool = False) -> str: ... def to_raw(obj, encoding: str = "utf-8"): ... -def escape_filter_chars(text: float | bytes | str, encoding: str | None = None) -> str: ... +def escape_filter_chars(text: FloatInt | bytes | str, encoding: str | None = None) -> str: ... def unescape_filter_chars(text, encoding=None): ... def escape_bytes(bytes_value: str | bytes) -> str: ... def prepare_for_stream(value): ... diff --git a/stubs/m3u8/m3u8/__init__.pyi b/stubs/m3u8/m3u8/__init__.pyi index 6fe32d5edeee..dffc1f188441 100644 --- a/stubs/m3u8/m3u8/__init__.pyi +++ b/stubs/m3u8/m3u8/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Mapping from typing import Any, TypeAlias @@ -64,7 +65,7 @@ _CustomTagsParser: TypeAlias = Callable[[str, int, dict[str, Any], dict[str, Any def loads(content: str, uri: str | None = None, custom_tags_parser: _CustomTagsParser | None = None) -> M3U8: ... def load( uri: str, - timeout: float | None = None, + timeout: FloatInt | None = None, headers: Mapping[str, Any] = {}, custom_tags_parser: _CustomTagsParser | None = None, http_client: _HTTPClientProtocol = ..., diff --git a/stubs/m3u8/m3u8/httpclient.pyi b/stubs/m3u8/m3u8/httpclient.pyi index 96569e96e167..572fcb29003f 100644 --- a/stubs/m3u8/m3u8/httpclient.pyi +++ b/stubs/m3u8/m3u8/httpclient.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt import urllib.request from typing import Any, Protocol, type_check_only @type_check_only class _HTTPClientProtocol(Protocol): # noqa: Y046 def download( - self, uri: str, timeout: float | None = None, headers: dict[str, Any] = {}, verify_ssl: bool = True + self, uri: str, timeout: FloatInt | None = None, headers: dict[str, Any] = {}, verify_ssl: bool = True ) -> tuple[str, str]: ... class DefaultHTTPClient: @@ -12,7 +13,7 @@ class DefaultHTTPClient: def __init__(self, proxies: dict[str, str] | None = None) -> None: ... def download( - self, uri: str, timeout: float | None = None, headers: dict[str, Any] = {}, verify_ssl: bool = True + self, uri: str, timeout: FloatInt | None = None, headers: dict[str, Any] = {}, verify_ssl: bool = True ) -> tuple[str, str]: ... class HTTPSHandler: diff --git a/stubs/m3u8/m3u8/model.pyi b/stubs/m3u8/m3u8/model.pyi index f532280b71b2..2231e18c57c3 100644 --- a/stubs/m3u8/m3u8/model.pyi +++ b/stubs/m3u8/m3u8/model.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime as dt from _typeshed import Incomplete, StrOrBytesPath, Unused from collections.abc import Callable, Iterable, Mapping @@ -54,7 +55,7 @@ class M3U8: is_variant: bool | None is_endlist: bool | None is_i_frames_only: bool | None - target_duration: float | None + target_duration: FloatInt | None media_sequence: int | None program_date_time: dt.datetime | None is_independent_segments: bool | None @@ -96,7 +97,7 @@ class M3U8: class Segment(BasePathMixin): media_sequence: int | None uri: str | None - duration: float | None + duration: FloatInt | None title: str bitrate: int | None byterange: str | None @@ -109,7 +110,7 @@ class Segment(BasePathMixin): cue_in: bool scte35: str | None oatcls_scte35: str | None - scte35_duration: float | None + scte35_duration: FloatInt | None scte35_elapsedtime: Incomplete | None asset_metadata: dict[str, Incomplete] | None key: Key | None @@ -124,7 +125,7 @@ class Segment(BasePathMixin): base_uri: str | None = None, program_date_time: dt.datetime | None = None, current_program_date_time: dt.datetime | None = None, - duration: float | None = None, + duration: FloatInt | None = None, title: str | None = None, bitrate: int | None = None, byterange: str | None = None, @@ -136,7 +137,7 @@ class Segment(BasePathMixin): key: Unused = None, scte35: str | None = None, oatcls_scte35: str | None = None, - scte35_duration: float | None = None, + scte35_duration: FloatInt | None = None, scte35_elapsedtime=None, asset_metadata: Mapping[str, str] | None = None, keyobject: Key | None = None, @@ -169,7 +170,7 @@ class SegmentList(list[Segment], GroupedBasePathMixin[Segment]): class PartialSegment(BasePathMixin): base_uri: str uri: str | None - duration: float | None + duration: FloatInt | None program_date_time: dt.datetime | None current_program_date_time: dt.datetime | None byterange: str | None @@ -182,7 +183,7 @@ class PartialSegment(BasePathMixin): self, base_uri: str, uri: str | None, - duration: float | None, + duration: FloatInt | None, program_date_time: dt.datetime | None = None, current_program_date_time: dt.datetime | None = None, byterange: str | None = None, @@ -252,7 +253,7 @@ class StreamInfo: audio: str | None video: str | None subtitles: str | None - frame_rate: float | None + frame_rate: FloatInt | None video_range: str | None hdcp_level: str | None pathway_id: str | None @@ -270,7 +271,7 @@ class StreamInfo: audio: str | None = None, video: str | None = None, subtitles: str | None = None, - frame_rate: float | None = None, + frame_rate: FloatInt | None = None, video_range: str | None = None, hdcp_level: str | None = None, pathway_id: str | None = None, @@ -325,9 +326,9 @@ class PlaylistList(TagList[_PlaylistAnyT], list[_PlaylistAnyT], GroupedBasePathM class SessionDataList(TagList[SessionData], list[SessionData]): ... class Start: - time_offset: float + time_offset: FloatInt precise: Literal["YES", "NO"] - def __init__(self, time_offset: float, precise: Literal["YES", "NO"] | None = None) -> None: ... + def __init__(self, time_offset: FloatInt, precise: Literal["YES", "NO"] | None = None) -> None: ... class RenditionReport(BasePathMixin): base_uri: str | None @@ -340,17 +341,17 @@ class RenditionReport(BasePathMixin): class RenditionReportList(list[RenditionReport], GroupedBasePathMixin[RenditionReport]): ... class ServerControl: - can_skip_until: float | None + can_skip_until: FloatInt | None can_block_reload: str | None - hold_back: float | None - part_hold_back: float | None + hold_back: FloatInt | None + part_hold_back: FloatInt | None can_skip_dateranges: str | None def __init__( self, - can_skip_until: float | None = None, + can_skip_until: FloatInt | None = None, can_block_reload: str | None = None, - hold_back: float | None = None, - part_hold_back: float | None = None, + hold_back: FloatInt | None = None, + part_hold_back: FloatInt | None = None, can_skip_dateranges: str | None = None, ) -> None: ... def __getitem__(self, item: str) -> str | float | None: ... @@ -363,8 +364,8 @@ class Skip: def dumps(self) -> str: ... class PartInformation: - part_target: float | None - def __init__(self, part_target: float | None = None) -> None: ... + part_target: FloatInt | None + def __init__(self, part_target: FloatInt | None = None) -> None: ... def dumps(self) -> str: ... class PreloadHint(BasePathMixin): @@ -399,8 +400,8 @@ class DateRange: start_date: str | None class_: str | None end_date: str | None - duration: float | None - planned_duration: float | None + duration: FloatInt | None + planned_duration: FloatInt | None scte35_cmd: str | None scte35_out: str | None scte35_in: str | None @@ -413,8 +414,8 @@ class DateRange: start_date: str | None = None, class_: str | None = None, # actually passing as `class` argument end_date: str | None = None, - duration: float | None = None, - planned_duration: float | None = None, + duration: FloatInt | None = None, + planned_duration: FloatInt | None = None, scte35_cmd: str | None = None, scte35_out: str | None = None, scte35_in: str | None = None, @@ -451,4 +452,4 @@ def find_key(keydata: Mapping[str, Any], keylist: Iterable[Key | None]) -> Key: def denormalize_attribute(attribute: str) -> str: ... def quoted(string: str | None) -> str: ... -def number_to_string(number: str | float | Decimal) -> str: ... +def number_to_string(number: str | FloatInt | Decimal) -> str: ... diff --git a/stubs/m3u8/m3u8/version_matching.pyi b/stubs/m3u8/m3u8/version_matching.pyi index 6f4265b2ebfc..2d706c7460e7 100644 --- a/stubs/m3u8/m3u8/version_matching.pyi +++ b/stubs/m3u8/m3u8/version_matching.pyi @@ -1,5 +1,6 @@ +from _typeshed import FloatInt from m3u8.version_matching_rules import VersionMatchingError def get_version(file_lines: list[str]) -> float | None: ... -def valid_in_all_rules(line_number: int, line: str, version: float) -> list[VersionMatchingError]: ... +def valid_in_all_rules(line_number: int, line: str, version: FloatInt) -> list[VersionMatchingError]: ... def validate(file_lines: list[str]) -> list[VersionMatchingError]: ... diff --git a/stubs/m3u8/m3u8/version_matching_rules.pyi b/stubs/m3u8/m3u8/version_matching_rules.pyi index 2fb0bde7212f..5804ec68650a 100644 --- a/stubs/m3u8/m3u8/version_matching_rules.pyi +++ b/stubs/m3u8/m3u8/version_matching_rules.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from dataclasses import dataclass @dataclass @@ -10,10 +11,10 @@ class VersionMatchingError(Exception): class VersionMatchRuleBase: description: str how_to_fix: str - version: float + version: FloatInt line_number: int line: str - def __init__(self, version: float, line_number: int, line: str) -> None: ... + def __init__(self, version: FloatInt, line_number: int, line: str) -> None: ... def validate(self) -> bool: ... def get_error(self) -> VersionMatchingError: ... diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 8ec149dd76a4..9f45e2804fa9 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Coroutine, Iterable, Mapping, Sequence from contextlib import AbstractContextManager @@ -363,11 +364,11 @@ class PropertyMock(Mock): def seal(mock: Any) -> None: ... class ThreadingMixin(Base): - DEFAULT_TIMEOUT: ClassVar[float | None] + DEFAULT_TIMEOUT: ClassVar[FloatInt | None] - def __init__(self, *args: Any, timeout: float | None = ..., **kwargs: Any) -> None: ... + def __init__(self, *args: Any, timeout: FloatInt | None = ..., **kwargs: Any) -> None: ... def reset_mock(self, *args: Any, **kwargs: Any) -> None: ... - def wait_until_called(self, *, timeout: float | None = ...) -> None: ... + def wait_until_called(self, *, timeout: FloatInt | None = ...) -> None: ... def wait_until_any_call_with(self, *args: Any, **kwargs: Any) -> None: ... class ThreadingMock(ThreadingMixin, MagicMixin, Mock): diff --git a/stubs/mysqlclient/MySQLdb/times.pyi b/stubs/mysqlclient/MySQLdb/times.pyi index 21a14cfc8551..1e7f9c8061da 100644 --- a/stubs/mysqlclient/MySQLdb/times.pyi +++ b/stubs/mysqlclient/MySQLdb/times.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Unused from datetime import date, datetime, time, timedelta @@ -10,9 +11,9 @@ Timestamp = datetime DateTimeDeltaType = timedelta DateTimeType = datetime -def DateFromTicks(ticks: float | None) -> date: ... -def TimeFromTicks(ticks: float | None) -> time: ... -def TimestampFromTicks(ticks: float | None) -> datetime: ... +def DateFromTicks(ticks: FloatInt | None) -> date: ... +def TimeFromTicks(ticks: FloatInt | None) -> time: ... +def TimestampFromTicks(ticks: FloatInt | None) -> datetime: ... format_TIME = str format_DATE = str diff --git a/stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi b/stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi index d83625ad5285..cecdceebb014 100644 --- a/stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi +++ b/stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable from typing import Any @@ -52,9 +53,9 @@ class Nanoleaf: def list_effects(self) -> list[str]: ... def write_effect(self, effect_dict: dict[str, Incomplete]) -> bool: ... def effect_exists(self, effect_name: str) -> bool: ... - def pulsate(self, rgb: tuple[int, int, int], speed: float = 1) -> bool: ... - def flow(self, rgb_list: list[tuple[int, int, int]], speed: float = 1) -> bool: ... - def spectrum(self, speed: float = 1) -> bool: ... + def pulsate(self, rgb: tuple[int, int, int], speed: FloatInt = 1) -> bool: ... + def flow(self, rgb_list: list[tuple[int, int, int]], speed: FloatInt = 1) -> bool: ... + def spectrum(self, speed: FloatInt = 1) -> bool: ... def enable_extcontrol(self) -> bool: ... def get_layout(self) -> dict[str, Incomplete]: ... def register_event(self, func: Callable[[dict[str, Incomplete]], Any], event_types: list[int]) -> None: ... diff --git a/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi b/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi index 6fc71c4130eb..31c61ccd5f1b 100644 --- a/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from networkx.classes.graph import Graph, _Node @@ -6,10 +7,10 @@ from networkx.utils.backends import _dispatchable __all__ = ["local_node_connectivity", "node_connectivity", "all_pairs_node_connectivity"] @_dispatchable -def local_node_connectivity(G: Graph[_Node], source: _Node, target: _Node, cutoff: float | None = None) -> float: ... +def local_node_connectivity(G: Graph[_Node], source: _Node, target: _Node, cutoff: FloatInt | None = None) -> float: ... @_dispatchable def node_connectivity(G: Graph[_Node], s: _Node | None = None, t: _Node | None = None) -> float: ... @_dispatchable def all_pairs_node_connectivity( - G: Graph[_Node], nbunch: Iterable[_Node] | None = None, cutoff: float | None = None + G: Graph[_Node], nbunch: Iterable[_Node] | None = None, cutoff: FloatInt | None = None ) -> dict[_Node, dict[_Node, float]]: ... diff --git a/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi b/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi index e0fe94385cd5..78b5f789d23d 100644 --- a/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections import defaultdict @@ -7,4 +8,4 @@ from networkx.utils.backends import _dispatchable __all__ = ["k_components"] @_dispatchable -def k_components(G: Graph[_Node], min_density: float = 0.95) -> defaultdict[Incomplete, list[Incomplete]]: ... +def k_components(G: Graph[_Node], min_density: FloatInt = 0.95) -> defaultdict[Incomplete, list[Incomplete]]: ... diff --git a/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi b/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi index 4518df47f2a1..67178473931f 100644 --- a/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -8,7 +9,7 @@ __all__ = ["randomized_partitioning", "one_exchange"] @_dispatchable def randomized_partitioning( - G: Graph[_Node], seed: int | RandomState | None = None, p: float = 0.5, weight: str | None = None + G: Graph[_Node], seed: int | RandomState | None = None, p: FloatInt = 0.5, weight: str | None = None ) -> tuple[float, tuple[set[Incomplete], set[Incomplete]]]: ... @_dispatchable def one_exchange( diff --git a/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi b/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi index 3c388b8d6677..f9f71a03a8a0 100644 --- a/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsLenAndGetItem from collections.abc import Callable, Iterable, Mapping from typing import Any, Literal, TypeVar @@ -53,7 +54,7 @@ def simulated_annealing_tsp( move: Callable[..., Incomplete] | Literal["1-1", "1-0"] = "1-1", max_iterations: int | None = 10, N_inner: int | None = 100, - alpha: float = 0.01, + alpha: FloatInt = 0.01, seed: int | RandomState | None = None, ) -> list[Incomplete]: ... @_dispatchable @@ -66,6 +67,6 @@ def threshold_accepting_tsp( move: Callable[..., Incomplete] | Literal["1-1", "1-0"] = "1-1", max_iterations: int | None = 10, N_inner: int | None = 100, - alpha: float = 0.1, + alpha: FloatInt = 0.1, seed: int | RandomState | None = None, ) -> list[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/generators.pyi b/stubs/networkx/networkx/algorithms/bipartite/generators.pyi index cf5b9686cfb9..2f15f3111d90 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/generators.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/generators.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterable @@ -40,11 +41,11 @@ def alternating_havel_hakimi_graph( @_dispatchable def preferential_attachment_graph( aseq: Iterable[Incomplete], - p: float, + p: FloatInt, create_using: Graph[_Node] | type[Graph[_Node]] | None = None, seed: int | RandomState | None = None, ): ... @_dispatchable -def random_graph(n: int, m: int, p: float, seed: int | RandomState | None = None, directed: bool | None = False): ... +def random_graph(n: int, m: int, p: FloatInt, seed: int | RandomState | None = None, directed: bool | None = False): ... @_dispatchable def gnmk_random_graph(n: int, m: int, k: int, seed: int | RandomState | None = None, directed: bool | None = False): ... diff --git a/stubs/networkx/networkx/algorithms/bipartite/link_analysis.pyi b/stubs/networkx/networkx/algorithms/bipartite/link_analysis.pyi index 75a125908432..b503abc9d9f0 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/link_analysis.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/link_analysis.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Mapping from networkx.classes.graph import Graph, _Node @@ -10,11 +11,11 @@ def birank( G: Graph[_Node], nodes: Iterable[_Node], *, - alpha: float | None = None, - beta: float | None = None, - top_personalization: Mapping[_Node, float] | None = None, - bottom_personalization: Mapping[_Node, float] | None = None, + alpha: FloatInt | None = None, + beta: FloatInt | None = None, + top_personalization: Mapping[_Node, FloatInt] | None = None, + bottom_personalization: Mapping[_Node, FloatInt] | None = None, max_iter: int = 100, - tol: float = 1.0e-6, + tol: FloatInt = 1.0e-6, weight: str | None = "weight", ) -> dict[_Node, float]: ... diff --git a/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi b/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi index cfee1601ec36..02b08474d882 100644 --- a/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -17,11 +18,11 @@ def approximate_current_flow_betweenness_centrality( weight: str | None = None, dtype: type = ..., solver: str = "full", - epsilon: float = 0.5, + epsilon: FloatInt = 0.5, kmax: int = 10000, seed: int | RandomState | None = None, *, - sample_weight: float = 1, + sample_weight: FloatInt = 1, ) -> dict[Incomplete, float]: ... @_dispatchable def current_flow_betweenness_centrality( diff --git a/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi b/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi index 4cc9ed0f4de0..5d694b1ced1a 100644 --- a/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable @@ -9,7 +10,7 @@ def dispersion( u: _Node | None = None, v: _Node | None = None, normalized: bool = True, - alpha: float = 1.0, - b: float = 0.0, - c: float = 0.0, + alpha: FloatInt = 1.0, + b: FloatInt = 0.0, + c: FloatInt = 0.0, ) -> dict[_Node, float] | dict[_Node, dict[_Node, float]]: ... diff --git a/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi b/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi index 75ee56abc272..c7a8631c066e 100644 --- a/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Mapping @@ -10,11 +11,11 @@ __all__ = ["eigenvector_centrality", "eigenvector_centrality_numpy"] def eigenvector_centrality( G: Graph[_Node], max_iter: int | None = 100, - tol: float | None = 1e-06, + tol: FloatInt | None = 1e-06, nstart: Mapping[Incomplete, Incomplete] | None = None, weight: str | None = None, ) -> dict[Incomplete, float]: ... @_dispatchable def eigenvector_centrality_numpy( - G: Graph[_Node], weight: str | None = None, max_iter: int | None = 50, tol: float | None = 0 + G: Graph[_Node], weight: str | None = None, max_iter: int | None = 50, tol: FloatInt | None = 0 ) -> dict[Incomplete, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/centrality/katz.pyi b/stubs/networkx/networkx/algorithms/centrality/katz.pyi index b8b8cda7b7e5..eb8813291ec5 100644 --- a/stubs/networkx/networkx/algorithms/centrality/katz.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/katz.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, Incomplete, SupportsItemAccess from collections.abc import Iterable, Mapping @@ -9,10 +10,10 @@ __all__ = ["katz_centrality", "katz_centrality_numpy"] @_dispatchable def katz_centrality( G: Graph[_Node], - alpha: float | None = 0.1, + alpha: FloatInt | None = 0.1, beta: ConvertibleToFloat | Iterable[Incomplete] | None = 1.0, max_iter: int | None = 1000, - tol: float | None = 1e-06, + tol: FloatInt | None = 1e-06, nstart: SupportsItemAccess[Incomplete, Incomplete] | None = None, normalized: bool | None = True, weight: str | None = None, @@ -20,8 +21,8 @@ def katz_centrality( @_dispatchable def katz_centrality_numpy( G: Graph[_Node], - alpha: float = 0.1, - beta: float | Mapping[Incomplete, Incomplete] | None = 1.0, + alpha: FloatInt = 0.1, + beta: FloatInt | Mapping[Incomplete, Incomplete] | None = 1.0, normalized: bool = True, weight: str | None = None, ) -> dict[Incomplete, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi b/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi index fa270ac3847c..276777112812 100644 --- a/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Collection @@ -13,5 +14,5 @@ def laplacian_centrality( nodelist: Collection[_Node] | None = None, weight: str | None = "weight", walk_type: str | None = None, - alpha: float = 0.95, + alpha: FloatInt = 0.95, ) -> dict[Incomplete, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/chordal.pyi b/stubs/networkx/networkx/algorithms/chordal.pyi index e7ad7d1d93d0..d83b260de774 100644 --- a/stubs/networkx/networkx/algorithms/chordal.pyi +++ b/stubs/networkx/networkx/algorithms/chordal.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import Incomplete from collections.abc import Generator @@ -20,7 +21,7 @@ class NetworkXTreewidthBoundExceeded(NetworkXException): ... @_dispatchable def is_chordal(G: Graph[_Node]) -> bool: ... @_dispatchable -def find_induced_nodes(G: Graph[_Node], s: _Node, t: _Node, treewidth_bound: float = sys.maxsize) -> set[_Node]: ... +def find_induced_nodes(G: Graph[_Node], s: _Node, t: _Node, treewidth_bound: FloatInt = sys.maxsize) -> set[_Node]: ... @_dispatchable def chordal_graph_cliques(G: Graph[_Node]) -> Generator[frozenset[_Node]]: ... @_dispatchable diff --git a/stubs/networkx/networkx/algorithms/community/leiden.pyi b/stubs/networkx/networkx/algorithms/community/leiden.pyi index 2cf5052c1229..8bcc8a0057f3 100644 --- a/stubs/networkx/networkx/algorithms/community/leiden.pyi +++ b/stubs/networkx/networkx/algorithms/community/leiden.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -10,11 +11,11 @@ __all__ = ["leiden_communities", "leiden_partitions"] def leiden_communities( G: Graph[_Node], weight: str | None = "weight", - resolution: float = 1, + resolution: FloatInt = 1, max_level: int | None = None, seed: int | RandomState | None = None, ) -> list[Incomplete]: ... @_dispatchable def leiden_partitions( - G: Graph[_Node], weight: str | None = "weight", resolution: float = 1, seed: int | RandomState | None = None + G: Graph[_Node], weight: str | None = "weight", resolution: FloatInt = 1, seed: int | RandomState | None = None ): ... diff --git a/stubs/networkx/networkx/algorithms/community/louvain.pyi b/stubs/networkx/networkx/algorithms/community/louvain.pyi index b4d07e965717..1190542f5860 100644 --- a/stubs/networkx/networkx/algorithms/community/louvain.pyi +++ b/stubs/networkx/networkx/algorithms/community/louvain.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Generator @@ -11,8 +12,8 @@ __all__ = ["louvain_communities", "louvain_partitions"] def louvain_communities( G: Graph[_Node], weight: str | None = "weight", - resolution: float | None = 1, - threshold: float | None = 1e-07, + resolution: FloatInt | None = 1, + threshold: FloatInt | None = 1e-07, max_level: int | None = None, seed: int | RandomState | None = None, ) -> list[set[Incomplete]]: ... @@ -20,7 +21,7 @@ def louvain_communities( def louvain_partitions( G: Graph[_Node], weight: str | None = "weight", - resolution: float | None = 1, - threshold: float | None = 1e-07, + resolution: FloatInt | None = 1, + threshold: FloatInt | None = 1e-07, seed: int | RandomState | None = None, ) -> Generator[list[set[Incomplete]]]: ... diff --git a/stubs/networkx/networkx/algorithms/community/lukes.pyi b/stubs/networkx/networkx/algorithms/community/lukes.pyi index da43a5a29eb8..63c5668af1d9 100644 --- a/stubs/networkx/networkx/algorithms/community/lukes.pyi +++ b/stubs/networkx/networkx/algorithms/community/lukes.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -7,7 +8,7 @@ from networkx.utils.backends import _dispatchable __all__ = ["lukes_partitioning"] D_EDGE_W: Final = "weight" -D_EDGE_VALUE: Final[float] +D_EDGE_VALUE: Final[FloatInt] D_NODE_W: Final = "weight" D_NODE_VALUE: Final = 1 PKEY: Final = "partitions" diff --git a/stubs/networkx/networkx/algorithms/community/modularity_max.pyi b/stubs/networkx/networkx/algorithms/community/modularity_max.pyi index 977fe8b70630..d168c44dc68e 100644 --- a/stubs/networkx/networkx/algorithms/community/modularity_max.pyi +++ b/stubs/networkx/networkx/algorithms/community/modularity_max.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -7,9 +8,9 @@ __all__ = ["greedy_modularity_communities", "naive_greedy_modularity_communities @_dispatchable def greedy_modularity_communities( - G: Graph[_Node], weight: str | None = None, resolution: float | None = 1, cutoff: int | None = 1, best_n: int | None = None + G: Graph[_Node], weight: str | None = None, resolution: FloatInt | None = 1, cutoff: int | None = 1, best_n: int | None = None ) -> list[set[Incomplete]] | list[frozenset[Incomplete]]: ... @_dispatchable def naive_greedy_modularity_communities( - G: Graph[_Node], resolution: float = 1, weight: str | None = None + G: Graph[_Node], resolution: FloatInt = 1, weight: str | None = None ) -> list[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/community/quality.pyi b/stubs/networkx/networkx/algorithms/community/quality.pyi index 98aa38954f00..ea006fe6ce99 100644 --- a/stubs/networkx/networkx/algorithms/community/quality.pyi +++ b/stubs/networkx/networkx/algorithms/community/quality.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterable @@ -21,7 +22,7 @@ def inter_community_edges(G: Graph[_Node], partition: Iterable[Incomplete]): ... def inter_community_non_edges(G: Graph[_Node], partition: Iterable[Incomplete]): ... @_dispatchable def modularity( - G: Graph[_Node], communities: Iterable[set[Incomplete]], weight: str | None = "weight", resolution: float = 1 + G: Graph[_Node], communities: Iterable[set[Incomplete]], weight: str | None = "weight", resolution: FloatInt = 1 ) -> float: ... @_dispatchable def partition_quality(G: Graph[_Node], partition: Iterable[Incomplete]) -> tuple[float, float]: ... diff --git a/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi b/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi index e38e1c82f756..4c085c1beec3 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Iterable from networkx.algorithms.flow import edmonds_karp @@ -23,7 +24,7 @@ def local_node_connectivity( flow_func: Callable[[DiGraph[_Node], _Node, _Node], DiGraph[_Node]] | None = None, auxiliary: DiGraph[_Node] | None = None, residual: DiGraph[_Node] | None = None, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> float: ... @_dispatchable def node_connectivity( @@ -50,7 +51,7 @@ def local_edge_connectivity( flow_func: Callable[[DiGraph[_Node], _Node, _Node], DiGraph[_Node]] | None = None, auxiliary: DiGraph[_Node] | None = None, residual: DiGraph[_Node] | None = None, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> float: ... @_dispatchable def edge_connectivity( @@ -58,5 +59,5 @@ def edge_connectivity( s: _Node | None = None, t: _Node | None = None, flow_func: Callable[[DiGraph[_Node], _Node, _Node], DiGraph[_Node]] | None = None, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> float: ... diff --git a/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi b/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi index b29620946b71..d000cf0a6520 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsGetItem from collections.abc import Collection, Generator, Iterable from typing import NamedTuple @@ -15,7 +16,7 @@ def is_locally_k_edge_connected(G: Graph[_Node], s: _Node, t: _Node, k: int) -> def k_edge_augmentation( G: Graph[_Node], k: int, - avail: set[tuple[int, int]] | set[tuple[int, int, float]] | SupportsGetItem[tuple[int, int], float] | None = None, + avail: set[tuple[int, int]] | set[tuple[int, int, FloatInt]] | SupportsGetItem[tuple[int, int], FloatInt] | None = None, weight: str | None = None, partial: bool = False, ) -> Generator[tuple[_Node, _Node]]: ... diff --git a/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi b/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi index 767af34353d8..fb673d002ce9 100644 --- a/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi +++ b/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.digraph import DiGraph @@ -14,5 +15,5 @@ def boykov_kolmogorov( capacity: str = "capacity", residual: Graph[_Node] | None = None, value_only: bool = False, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> DiGraph[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi b/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi index 9b866da0d367..004d255e5452 100644 --- a/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi +++ b/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.digraph import DiGraph @@ -14,5 +15,5 @@ def dinitz( capacity: str = "capacity", residual: Graph[_Node] | None = None, value_only: bool = False, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> DiGraph[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi b/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi index e43617b2dc61..8e82ef11d3ce 100644 --- a/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi +++ b/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.digraph import DiGraph @@ -14,5 +15,5 @@ def edmonds_karp( capacity: str = "capacity", residual: Graph[_Node] | None = None, value_only: bool = False, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> DiGraph[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi b/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi index d31bbb22ac4e..9b132f8d1c92 100644 --- a/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi +++ b/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.digraph import DiGraph @@ -13,6 +14,6 @@ def preflow_push( t: _Node, capacity: str = "capacity", residual: Graph[_Node] | None = None, - global_relabel_freq: float = 1, + global_relabel_freq: FloatInt = 1, value_only: bool = False, ) -> DiGraph[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi b/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi index 62ec86a862c3..56e740e67ac4 100644 --- a/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi +++ b/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.digraph import DiGraph @@ -15,5 +16,5 @@ def shortest_augmenting_path( residual: Graph[_Node] | None = None, value_only: bool = False, two_phase: bool = False, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> DiGraph[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi b/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi index 382cacbd7ec7..2feea9b18d56 100644 --- a/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi +++ b/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Iterable, Sequence from types import FunctionType @@ -17,7 +18,7 @@ __all__ = [ ] def copyfunc(f, name=None) -> FunctionType: ... -def allclose(x, y, rtol: float = 1.0000000000000001e-05, atol: float = 1e-08) -> bool: ... +def allclose(x, y, rtol: FloatInt = 1.0000000000000001e-05, atol: FloatInt = 1e-08) -> bool: ... @_dispatchable def categorical_node_match( attr: str | Iterable[Incomplete], default: Incomplete | Iterable[Incomplete] @@ -31,14 +32,14 @@ def categorical_multiedge_match( ) -> Callable[..., Incomplete]: ... @_dispatchable def numerical_node_match( - attr: str | Iterable[Incomplete], default: Incomplete | Iterable[Incomplete], rtol: float = 1e-05, atol: float = 1e-08 + attr: str | Iterable[Incomplete], default: Incomplete | Iterable[Incomplete], rtol: FloatInt = 1e-05, atol: FloatInt = 1e-08 ) -> Callable[..., Incomplete]: ... numerical_edge_match: Incomplete @_dispatchable def numerical_multiedge_match( - attr: str | Iterable[Incomplete], default: Incomplete | Iterable[Incomplete], rtol: float = 1e-05, atol: float = 1e-08 + attr: str | Iterable[Incomplete], default: Incomplete | Iterable[Incomplete], rtol: FloatInt = 1e-05, atol: FloatInt = 1e-08 ) -> Callable[..., Incomplete]: ... @_dispatchable def generic_node_match( diff --git a/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi b/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi index f5cbbc1516b2..b5c140a44ecc 100644 --- a/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi +++ b/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Generator from typing import NamedTuple @@ -30,13 +31,13 @@ class _StateParameters(NamedTuple): @_dispatchable def vf2pp_isomorphism( - G1: Graph[_Node], G2: Graph[_Node], node_label: str | None = None, default_label: float | None = None + G1: Graph[_Node], G2: Graph[_Node], node_label: str | None = None, default_label: FloatInt | None = None ) -> dict[Incomplete, Incomplete] | None: ... @_dispatchable def vf2pp_is_isomorphic( - G1: Graph[_Node], G2: Graph[_Node], node_label: str | None = None, default_label: float | None = None + G1: Graph[_Node], G2: Graph[_Node], node_label: str | None = None, default_label: FloatInt | None = None ) -> bool: ... @_dispatchable def vf2pp_all_isomorphisms( - G1: Graph[_Node], G2: Graph[_Node], node_label: str | None = None, default_label: float | None = None + G1: Graph[_Node], G2: Graph[_Node], node_label: str | None = None, default_label: FloatInt | None = None ) -> Generator[Incomplete, None, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi b/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi index f0def237e02f..6e168b4a9d64 100644 --- a/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi +++ b/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Mapping from networkx.classes.graph import Graph, _Node @@ -9,7 +10,7 @@ __all__ = ["hits"] def hits( G: Graph[_Node], max_iter: int | None = 100, - tol: float | None = 1e-08, - nstart: Mapping[_Node, float] | None = None, + tol: FloatInt | None = 1e-08, + nstart: Mapping[_Node, FloatInt] | None = None, normalized: bool = True, ) -> tuple[dict[_Node, float], dict[_Node, float]]: ... diff --git a/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi b/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi index 13fff963097e..677e2f175f58 100644 --- a/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi +++ b/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection, Mapping import numpy as np @@ -10,20 +11,20 @@ __all__ = ["pagerank", "google_matrix"] @_dispatchable def pagerank( G: Graph[_Node], - alpha: float | None = 0.85, - personalization: Mapping[_Node, float] | None = None, + alpha: FloatInt | None = 0.85, + personalization: Mapping[_Node, FloatInt] | None = None, max_iter: int | None = 100, - tol: float | None = 1e-06, - nstart: Mapping[_Node, float] | None = None, + tol: FloatInt | None = 1e-06, + nstart: Mapping[_Node, FloatInt] | None = None, weight: str | None = "weight", - dangling: Mapping[_Node, float] | None = None, + dangling: Mapping[_Node, FloatInt] | None = None, ) -> dict[_Node, float]: ... @_dispatchable def google_matrix( G: Graph[_Node], - alpha: float = 0.85, - personalization: Mapping[_Node, float] | None = None, + alpha: FloatInt = 0.85, + personalization: Mapping[_Node, FloatInt] | None = None, nodelist: Collection[_Node] | None = None, weight: str | None = "weight", - dangling: Mapping[_Node, float] | None = None, + dangling: Mapping[_Node, FloatInt] | None = None, ) -> Array2D[np.float64]: ... diff --git a/stubs/networkx/networkx/algorithms/link_prediction.pyi b/stubs/networkx/networkx/algorithms/link_prediction.pyi index 1a14f6609bb6..d9cb6a3ebaca 100644 --- a/stubs/networkx/networkx/algorithms/link_prediction.pyi +++ b/stubs/networkx/networkx/algorithms/link_prediction.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterable, Iterator @@ -37,5 +38,5 @@ def ra_index_soundarajan_hopcroft( ) -> Iterator[Incomplete]: ... @_dispatchable def within_inter_cluster( - G: Graph[_Node], ebunch: Iterable[Incomplete] | None = None, delta: float | None = 0.001, community: str | None = "community" + G: Graph[_Node], ebunch: Iterable[Incomplete] | None = None, delta: FloatInt | None = 0.001, community: str | None = "community" ) -> Iterator[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/node_classification.pyi b/stubs/networkx/networkx/algorithms/node_classification.pyi index d613a26ded63..16d87389e8cb 100644 --- a/stubs/networkx/networkx/algorithms/node_classification.pyi +++ b/stubs/networkx/networkx/algorithms/node_classification.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -9,5 +10,5 @@ __all__ = ["harmonic_function", "local_and_global_consistency"] def harmonic_function(G: Graph[_Node], max_iter: int = 30, label_name: str = "label") -> list[Incomplete]: ... @_dispatchable def local_and_global_consistency( - G: Graph[_Node], alpha: float = 0.99, max_iter: int = 30, label_name: str = "label" + G: Graph[_Node], alpha: FloatInt = 0.99, max_iter: int = 30, label_name: str = "label" ) -> list[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/planarity.pyi b/stubs/networkx/networkx/algorithms/planarity.pyi index bb52590f1614..32d2dea7ce0b 100644 --- a/stubs/networkx/networkx/algorithms/planarity.pyi +++ b/stubs/networkx/networkx/algorithms/planarity.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, Unused from collections.abc import Generator, Iterable, Mapping, MutableSet, Reversible from decimal import Decimal @@ -110,5 +111,5 @@ class PlanarEmbedding(DiGraph[_Node]): def add_edge(self, u_of_edge: _Node, v_of_edge: _Node, **attr: Unused) -> Never: ... def add_edges_from(self, ebunch_to_add: Iterable[_EdgePlus[_Node]], **attr: Unused) -> Never: ... def add_weighted_edges_from( - self, ebunch_to_add: Iterable[tuple[_Node, _Node, float | Decimal | None]], weight: str = "weight", **attr: Unused + self, ebunch_to_add: Iterable[tuple[_Node, _Node, FloatInt | Decimal | None]], weight: str = "weight", **attr: Unused ) -> Never: ... diff --git a/stubs/networkx/networkx/algorithms/richclub.pyi b/stubs/networkx/networkx/algorithms/richclub.pyi index 2f2b25d7b987..ef4d50d42aa3 100644 --- a/stubs/networkx/networkx/algorithms/richclub.pyi +++ b/stubs/networkx/networkx/algorithms/richclub.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -8,5 +9,5 @@ __all__ = ["rich_club_coefficient"] @_dispatchable def rich_club_coefficient( - G: Graph[_Node], normalized: bool = True, Q: float = 100, seed: int | RandomState | None = None + G: Graph[_Node], normalized: bool = True, Q: FloatInt = 100, seed: int | RandomState | None = None ) -> dict[Incomplete, Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi b/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi index 037db5b93ef9..cfa3d7cc3f27 100644 --- a/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi +++ b/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from networkx.algorithms.shortest_paths.weighted import _WeightFunc @@ -14,7 +15,7 @@ def astar_path( heuristic: Callable[[_Node, _Node], float] | None = None, weight: str | _WeightFunc[_Node] | None = "weight", *, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> list[_Node]: ... @_dispatchable def astar_path_length( @@ -24,5 +25,5 @@ def astar_path_length( heuristic: Callable[[_Node, _Node], float] | None = None, weight: str | _WeightFunc[_Node] | None = "weight", *, - cutoff: float | None = None, + cutoff: FloatInt | None = None, ) -> float: ... diff --git a/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi b/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi index bee3ecf7470c..ddc93f4f7c5f 100644 --- a/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi +++ b/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Collection, Generator from typing import Any, TypeAlias @@ -47,51 +48,51 @@ def dijkstra_path_length( ) -> float: ... @_dispatchable def single_source_dijkstra_path( - G: Graph[_Node], source: _Node, cutoff: float | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], source: _Node, cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" ) -> dict[_Node, list[_Node]]: ... @_dispatchable def single_source_dijkstra_path_length( - G: Graph[_Node], source: _Node, cutoff: float | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], source: _Node, cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" ) -> dict[_Node, float]: ... @_dispatchable def single_source_dijkstra( G: Graph[_Node], source: _Node, target: _Node | None = None, - cutoff: float | None = None, + cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight", ) -> tuple[dict[_Node, float], dict[_Node, list[_Node]]] | tuple[float, list[_Node]]: ... # TODO: overload on target @_dispatchable def multi_source_dijkstra_path( - G: Graph[_Node], sources: Collection[_Node], cutoff: float | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], sources: Collection[_Node], cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" ) -> dict[_Node, list[_Node]]: ... @_dispatchable def multi_source_dijkstra_path_length( - G: Graph[_Node], sources: Collection[_Node], cutoff: float | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], sources: Collection[_Node], cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" ) -> dict[_Node, float]: ... @_dispatchable def multi_source_dijkstra( G: Graph[_Node], sources: Collection[_Node], target: _Node | None = None, - cutoff: float | None = None, + cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight", ) -> tuple[dict[_Node, float], dict[_Node, list[_Node]]] | tuple[float, list[_Node]]: ... # TODO: overload on target @_dispatchable def dijkstra_predecessor_and_distance( - G: Graph[_Node], source: _Node, cutoff: float | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], source: _Node, cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" ) -> tuple[dict[_Node, list[_Node]], dict[_Node, float]]: ... @_dispatchable def all_pairs_dijkstra( - G: Graph[_Node], cutoff: float | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" ) -> Generator[tuple[_Node, tuple[dict[_Node, float], dict[_Node, list[_Node]]]]]: ... @_dispatchable def all_pairs_dijkstra_path_length( - G: Graph[_Node], cutoff: float | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" ) -> Generator[tuple[_Node, dict[_Node, float]]]: ... @_dispatchable def all_pairs_dijkstra_path( - G: Graph[_Node], cutoff: float | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" ) -> Generator[tuple[_Node, dict[_Node, list[_Node]]]]: ... @_dispatchable def bellman_ford_predecessor_and_distance( diff --git a/stubs/networkx/networkx/algorithms/similarity.pyi b/stubs/networkx/networkx/algorithms/similarity.pyi index b0ba3bbe8797..2352fdd01873 100644 --- a/stubs/networkx/networkx/algorithms/similarity.pyi +++ b/stubs/networkx/networkx/algorithms/similarity.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsItemAccess from collections.abc import Callable, Generator @@ -29,8 +30,8 @@ def graph_edit_distance( edge_del_cost: Callable[..., Incomplete] | None = None, edge_ins_cost: Callable[..., Incomplete] | None = None, roots: tuple[Incomplete, Incomplete] | None = None, - upper_bound: float | None = None, - timeout: float | None = None, + upper_bound: FloatInt | None = None, + timeout: FloatInt | None = None, ): ... @_dispatchable def optimal_edit_paths( @@ -44,7 +45,7 @@ def optimal_edit_paths( edge_subst_cost: Callable[..., Incomplete] | None = None, edge_del_cost: Callable[..., Incomplete] | None = None, edge_ins_cost: Callable[..., Incomplete] | None = None, - upper_bound: float | None = None, + upper_bound: FloatInt | None = None, ) -> tuple[list[tuple[Incomplete, Incomplete]], float]: ... @_dispatchable def optimize_graph_edit_distance( @@ -58,7 +59,7 @@ def optimize_graph_edit_distance( edge_subst_cost: Callable[..., Incomplete] | None = None, edge_del_cost: Callable[..., Incomplete] | None = None, edge_ins_cost: Callable[..., Incomplete] | None = None, - upper_bound: float | None = None, + upper_bound: FloatInt | None = None, ) -> Generator[Incomplete]: ... @_dispatchable def optimize_edit_paths( @@ -72,19 +73,19 @@ def optimize_edit_paths( edge_subst_cost: Callable[..., Incomplete] | None = None, edge_del_cost: Callable[..., Incomplete] | None = None, edge_ins_cost: Callable[..., Incomplete] | None = None, - upper_bound: float | None = None, + upper_bound: FloatInt | None = None, strictly_decreasing: bool = True, roots: tuple[Incomplete, Incomplete] | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> Generator[Incomplete, None, Incomplete]: ... @_dispatchable def simrank_similarity( G: Graph[_Node], source: _Node | None = None, target: _Node | None = None, - importance_factor: float = 0.9, + importance_factor: FloatInt = 0.9, max_iterations: int = 1000, - tolerance: float = 0.0001, + tolerance: FloatInt = 0.0001, ) -> float | dict[Incomplete, Incomplete]: ... @_dispatchable def panther_similarity( @@ -92,9 +93,9 @@ def panther_similarity( source: _Node, k: int = 5, path_length: int = 5, - c: float = 0.5, - delta: float = 0.1, - eps: float | None = None, + c: FloatInt = 0.5, + delta: FloatInt = 0.1, + eps: FloatInt | None = None, weight: str | None = "weight", seed: int | RandomState | None = None, ) -> dict[bytes, bytes]: ... @@ -106,9 +107,9 @@ def panther_vector_similarity( D: int = 10, k: int = 5, path_length: int = 5, - c: float = 0.5, - delta: float = 0.1, - eps: float | None = None, + c: FloatInt = 0.5, + delta: FloatInt = 0.1, + eps: FloatInt | None = None, weight: str | None = "weight", seed: int | RandomState | None = None, ) -> dict[Incomplete, float]: ... diff --git a/stubs/networkx/networkx/algorithms/sparsifiers.pyi b/stubs/networkx/networkx/algorithms/sparsifiers.pyi index e94ffe57f37a..381535f392c3 100644 --- a/stubs/networkx/networkx/algorithms/sparsifiers.pyi +++ b/stubs/networkx/networkx/algorithms/sparsifiers.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -8,5 +9,5 @@ __all__ = ["spanner"] @_dispatchable def spanner( - G: Graph[_Node], stretch: float, weight: str | None = None, seed: int | RandomState | None = None + G: Graph[_Node], stretch: FloatInt, weight: str | None = None, seed: int | RandomState | None = None ) -> Graph[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/time_dependent.pyi b/stubs/networkx/networkx/algorithms/time_dependent.pyi index abdd217acd5c..fcc203961adf 100644 --- a/stubs/networkx/networkx/algorithms/time_dependent.pyi +++ b/stubs/networkx/networkx/algorithms/time_dependent.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from datetime import timedelta from networkx.classes.graph import Graph, _Node @@ -7,5 +8,5 @@ __all__ = ["cd_index"] @_dispatchable def cd_index( - G: Graph[_Node], node: _Node, time_delta: float | timedelta, *, time: str = "time", weight: str | None = None + G: Graph[_Node], node: _Node, time_delta: FloatInt | timedelta, *, time: str = "time", weight: str | None = None ) -> float: ... diff --git a/stubs/networkx/networkx/algorithms/tree/branchings.pyi b/stubs/networkx/networkx/algorithms/tree/branchings.pyi index c9444c109a8d..391680b654d2 100644 --- a/stubs/networkx/networkx/algorithms/tree/branchings.pyi +++ b/stubs/networkx/networkx/algorithms/tree/branchings.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from dataclasses import dataclass from typing import Final @@ -21,22 +22,22 @@ __all__ = [ KINDS: Final[set[str]] STYLES: Final[dict[str, str]] -INF: Final[float] +INF: Final[FloatInt] def random_string(L=15, seed=None): ... @_dispatchable -def branching_weight(G: DiGraph[_Node], attr: str = "weight", default: float = 1) -> int | float: ... +def branching_weight(G: DiGraph[_Node], attr: str = "weight", default: FloatInt = 1) -> int | float: ... @_dispatchable def greedy_branching( - G: DiGraph[_Node], attr: str = "weight", default: float = 1, kind: str = "max", seed: int | RandomState | None = None + G: DiGraph[_Node], attr: str = "weight", default: FloatInt = 1, kind: str = "max", seed: int | RandomState | None = None ) -> Graph[Incomplete]: ... @_dispatchable def maximum_branching( - G: DiGraph[_Node], attr: str = "weight", default: float = 1, preserve_attrs: bool = False, partition: str | None = None + G: DiGraph[_Node], attr: str = "weight", default: FloatInt = 1, preserve_attrs: bool = False, partition: str | None = None ) -> DiGraph[Incomplete]: ... @_dispatchable def minimum_branching( - G: DiGraph[_Node], attr: str = "weight", default: float = 1, preserve_attrs: bool = False, partition: str | None = None + G: DiGraph[_Node], attr: str = "weight", default: FloatInt = 1, preserve_attrs: bool = False, partition: str | None = None ) -> DiGraph[Incomplete]: ... @_dispatchable def minimal_branching( @@ -44,17 +45,17 @@ def minimal_branching( ) -> DiGraph[Incomplete]: ... @_dispatchable def maximum_spanning_arborescence( - G: DiGraph[_Node], attr: str = "weight", default: float = 1, preserve_attrs: bool = False, partition: str | None = None + G: DiGraph[_Node], attr: str = "weight", default: FloatInt = 1, preserve_attrs: bool = False, partition: str | None = None ) -> DiGraph[Incomplete]: ... @_dispatchable def minimum_spanning_arborescence( - G: DiGraph[_Node], attr: str = "weight", default: float = 1, preserve_attrs: bool = False, partition: str | None = None + G: DiGraph[_Node], attr: str = "weight", default: FloatInt = 1, preserve_attrs: bool = False, partition: str | None = None ) -> DiGraph[Incomplete]: ... class ArborescenceIterator: @dataclass(order=True) class Partition: - mst_weight: float + mst_weight: FloatInt partition_dict: dict[Incomplete, Incomplete] def __copy__(self) -> ArborescenceIterator.Partition: ... diff --git a/stubs/networkx/networkx/algorithms/tree/mst.pyi b/stubs/networkx/networkx/algorithms/tree/mst.pyi index b8c4822a931a..84b4e4d507aa 100644 --- a/stubs/networkx/networkx/algorithms/tree/mst.pyi +++ b/stubs/networkx/networkx/algorithms/tree/mst.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Generator, Iterator from dataclasses import dataclass @@ -86,7 +87,7 @@ def random_spanning_tree( class SpanningTreeIterator: @dataclass(order=True) class Partition: - mst_weight: float + mst_weight: FloatInt partition_dict: dict[Incomplete, Incomplete] def __copy__(self) -> SpanningTreeIterator.Partition: ... diff --git a/stubs/networkx/networkx/algorithms/vitality.pyi b/stubs/networkx/networkx/algorithms/vitality.pyi index 3fd2cfe0e482..8726f975379c 100644 --- a/stubs/networkx/networkx/algorithms/vitality.pyi +++ b/stubs/networkx/networkx/algorithms/vitality.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -7,5 +8,5 @@ __all__ = ["closeness_vitality"] @_dispatchable def closeness_vitality( - G: Graph[_Node], node=None, weight: str | None = None, wiener_index: float | None = None + G: Graph[_Node], node=None, weight: str | None = None, wiener_index: FloatInt | None = None ) -> float | dict[Incomplete, Incomplete]: ... diff --git a/stubs/networkx/networkx/classes/graph.pyi b/stubs/networkx/networkx/classes/graph.pyi index a942816e731b..042b38ef96c1 100644 --- a/stubs/networkx/networkx/classes/graph.pyi +++ b/stubs/networkx/networkx/classes/graph.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Collection, Hashable, Iterable, Iterator, Mapping, MutableMapping from decimal import Decimal from functools import cached_property @@ -83,7 +84,7 @@ class Graph(Collection[_Node], Generic[_Node, _NodeData, _EdgeData]): def add_edges_from(self, ebunch_to_add: Iterable[_EdgePlus[_Node, _EdgeData]], **attr: Any) -> None: ... # attr: Edge data (or labels or objects) can be assigned using keyword arguments def add_weighted_edges_from( - self, ebunch_to_add: Iterable[tuple[_Node, _Node, float | Decimal | None]], weight: str = "weight", **attr: Any + self, ebunch_to_add: Iterable[tuple[_Node, _Node, FloatInt | Decimal | None]], weight: str = "weight", **attr: Any ) -> None: ... # attr: Edge attributes to add/update for all edges. def remove_edge(self, u: _Node, v: _Node) -> None: ... diff --git a/stubs/networkx/networkx/convert.pyi b/stubs/networkx/networkx/convert.pyi index b6bd41f09185..15bb7ab7e973 100644 --- a/stubs/networkx/networkx/convert.pyi +++ b/stubs/networkx/networkx/convert.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Collection, Iterable @@ -26,7 +27,7 @@ def from_dict_of_lists( d: dict[_Node, Iterable[_Node]], create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None ) -> Graph[_Node]: ... def to_dict_of_dicts( - G: Graph[_Node], nodelist: Collection[_Node] | None = None, edge_data: float | None = None + G: Graph[_Node], nodelist: Collection[_Node] | None = None, edge_data: FloatInt | None = None ) -> dict[Incomplete, Incomplete]: ... @_dispatchable def from_dict_of_dicts( diff --git a/stubs/networkx/networkx/convert_matrix.pyi b/stubs/networkx/networkx/convert_matrix.pyi index 98179313bcea..ae1f744c8708 100644 --- a/stubs/networkx/networkx/convert_matrix.pyi +++ b/stubs/networkx/networkx/convert_matrix.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Collection, Hashable, Iterable from typing import Literal, TypeAlias, TypeVar, overload @@ -34,9 +35,9 @@ def to_pandas_adjacency( nodelist: _Axes[_Node] | None = None, dtype: numpy.dtype[Incomplete] | None = None, order: numpy._OrderCF = None, - multigraph_weight: Callable[[list[float]], float] = ..., + multigraph_weight: Callable[[list[FloatInt]], float] = ..., weight: str = "weight", - nonedge: float = 0.0, + nonedge: FloatInt = 0.0, ) -> _DataFrame: ... @overload @@ -104,9 +105,9 @@ def to_numpy_array( nodelist: Collection[_Node] | None = None, dtype: numpy.dtype[Incomplete] | None = None, order: numpy._OrderCF = None, - multigraph_weight: Callable[[list[float]], float] = ..., + multigraph_weight: Callable[[list[FloatInt]], float] = ..., weight: str = "weight", - nonedge: float = 0.0, + nonedge: FloatInt = 0.0, ) -> numpy.ndarray[Incomplete, numpy.dtype[Incomplete]]: ... @overload diff --git a/stubs/networkx/networkx/drawing/layout.pyi b/stubs/networkx/networkx/drawing/layout.pyi index e84a432458be..668269116696 100644 --- a/stubs/networkx/networkx/drawing/layout.pyi +++ b/stubs/networkx/networkx/drawing/layout.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection, Mapping from typing import Any, Literal, TypeAlias @@ -26,7 +27,7 @@ __all__ = [ "arf_layout", ] -_FloatArrayLike1D: TypeAlias = ArrayLike1D[float, np.number[Any]] # Any because we don't care about the bit base +_FloatArrayLike1D: TypeAlias = ArrayLike1D[FloatInt, np.number[Any]] # Any because we don't care about the bit base def random_layout( G: Graph[_Node, _NodeData, _EdgeData], @@ -37,7 +38,7 @@ def random_layout( ) -> dict[_Node, Array1D[np.float32]]: ... def circular_layout( G: Graph[_Node, _NodeData, _EdgeData], - scale: float = 1, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, dim: int = 2, store_pos_as: str | None = None, @@ -45,8 +46,8 @@ def circular_layout( def shell_layout( G: Graph[_Node, _NodeData, _EdgeData], nlist: Collection[Collection[_Node]] | None = None, - rotate: float | None = None, - scale: float = 1, + rotate: FloatInt | None = None, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, dim: int = 2, store_pos_as: str | None = None, @@ -55,37 +56,37 @@ def bipartite_layout( G: Graph[_Node, _NodeData, _EdgeData], nodes: Collection[_Node] | None = None, align: Literal["vertical", "horizontal"] = "vertical", - scale: float = 1, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, - aspect_ratio: float = ..., + aspect_ratio: FloatInt = ..., store_pos_as: str | None = None, ) -> dict[_Node, Array1D[np.float64]]: ... def spring_layout( G: Graph[_Node, _NodeData, _EdgeData], - k: float | None = None, - pos: Mapping[_Node, Collection[float]] | None = None, + k: FloatInt | None = None, + pos: Mapping[_Node, Collection[FloatInt]] | None = None, fixed: Collection[_Node] | None = None, iterations: int = 50, - threshold: float = 0.0001, + threshold: FloatInt = 0.0001, weight: str | None = "weight", - scale: float | None = 1, + scale: FloatInt | None = 1, center: _FloatArrayLike1D | None = None, dim: int = 2, seed: Seed | None = None, store_pos_as: str | None = None, *, method: Literal["auto", "force", "energy"] = "auto", - gravity: float = 1.0, + gravity: FloatInt = 1.0, ) -> dict[_Node, Array1D[np.float64]]: ... fruchterman_reingold_layout = spring_layout def kamada_kawai_layout( G: Graph[_Node, _NodeData, _EdgeData], - dist: Mapping[_Node, Mapping[_Node, float]] | None = None, - pos: Mapping[_Node, Collection[float]] | None = None, + dist: Mapping[_Node, Mapping[_Node, FloatInt]] | None = None, + pos: Mapping[_Node, Collection[FloatInt]] | None = None, weight: str | None = "weight", - scale: float = 1, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, dim: int = 2, store_pos_as: str | None = None, @@ -93,24 +94,24 @@ def kamada_kawai_layout( def spectral_layout( G: Graph[_Node, _NodeData, _EdgeData], weight: str | None = "weight", - scale: float = 1, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, dim: int = 2, store_pos_as: str | None = None, ) -> dict[_Node, Array1D[np.float64]]: ... def planar_layout( G: Graph[_Node, _NodeData, _EdgeData], - scale: float = 1, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, dim: int = 2, store_pos_as: str | None = None, ) -> dict[_Node, Array1D[np.float64]]: ... def spiral_layout( G: Graph[_Node, _NodeData, _EdgeData], - scale: float = 1, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, dim: int = 2, - resolution: float = 0.35, + resolution: FloatInt = 0.35, equidistant: bool = False, store_pos_as: str | None = None, ) -> dict[_Node, Array1D[np.float64]]: ... @@ -118,17 +119,17 @@ def multipartite_layout( G: Graph[_Node, _NodeData, _EdgeData], subset_key: str | Mapping[Any, Collection[_Node]] = "subset", # layers can be "any" hashable align: Literal["vertical", "horizontal"] = "vertical", - scale: float = 1, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, store_pos_as: str | None = None, ) -> dict[_Node, Array1D[np.float64]]: ... def arf_layout( G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]] | None = None, - scaling: float = 1, - a: float = 1.1, - etol: float = 1e-06, - dt: float = 0.001, + pos: Mapping[_Node, Collection[FloatInt]] | None = None, + scaling: FloatInt = 1, + a: FloatInt = 1.1, + etol: FloatInt = 1e-06, + dt: FloatInt = 0.001, max_iter: int = 1000, *, seed: Seed | None = None, @@ -137,30 +138,30 @@ def arf_layout( @_dispatchable def forceatlas2_layout( G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]] | None = None, + pos: Mapping[_Node, Collection[FloatInt]] | None = None, *, max_iter: int = 100, - jitter_tolerance: float = 1.0, - scaling_ratio: float = 2.0, - gravity: float = 1.0, + jitter_tolerance: FloatInt = 1.0, + scaling_ratio: FloatInt = 2.0, + gravity: FloatInt = 1.0, distributed_action: bool = False, strong_gravity: bool = False, - node_mass: Mapping[_Node, float] | None = None, - node_size: Mapping[_Node, float] | None = None, + node_mass: Mapping[_Node, FloatInt] | None = None, + node_size: Mapping[_Node, FloatInt] | None = None, weight: str | None = None, linlog: bool = False, seed: Seed | None = None, dim: int = 2, store_pos_as: str | None = None, ) -> dict[_Node, Array1D[np.float32]]: ... -def rescale_layout(pos: NDArray[np.number[Any]], scale: float = 1) -> Array2D[np.float64]: ... # ignore the bit base -def rescale_layout_dict(pos: Mapping[_Node, Collection[float]], scale: float = 1) -> dict[_Node, Array1D[np.float64]]: ... +def rescale_layout(pos: NDArray[np.number[Any]], scale: FloatInt = 1) -> Array2D[np.float64]: ... # ignore the bit base +def rescale_layout_dict(pos: Mapping[_Node, Collection[FloatInt]], scale: FloatInt = 1) -> dict[_Node, Array1D[np.float64]]: ... def bfs_layout( G: Graph[_Node, _NodeData, _EdgeData], start: _Node, *, align: Literal["vertical", "horizontal"] = "vertical", - scale: float = 1, + scale: FloatInt = 1, center: _FloatArrayLike1D | None = None, store_pos_as: str | None = None, ) -> dict[_Node, Array1D[np.float64]]: ... diff --git a/stubs/networkx/networkx/drawing/nx_pylab.pyi b/stubs/networkx/networkx/drawing/nx_pylab.pyi index 5d0102713220..9822ac4c4a5c 100644 --- a/stubs/networkx/networkx/drawing/nx_pylab.pyi +++ b/stubs/networkx/networkx/drawing/nx_pylab.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsItems from collections.abc import Callable, Collection, Hashable, Iterable, Mapping, Sequence from typing import Any, Generic, Literal, TypeAlias, TypedDict, TypeVar, overload, type_check_only @@ -37,7 +38,7 @@ __all__ = [ _G = TypeVar("_G", bound=Graph[Any, Any, Any]) # types from matplotlib -_FontSize: TypeAlias = Literal["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"] | float +_FontSize: TypeAlias = Literal["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large"] | FloatInt _FontWeight: TypeAlias = ( Literal[ "ultralight", @@ -63,23 +64,23 @@ _VAlign: TypeAlias = Literal["baseline", "bottom", "center", "center_baseline", @type_check_only class _DrawNetworkxKwds(TypedDict, Generic[_Node], total=False): # draw nodes keywords; keep in sync with draw_networkx_nodes - node_color: ColorType | Collection[ColorType] | Collection[float] + node_color: ColorType | Collection[ColorType] | Collection[FloatInt] cmap: str | Colormap | None - vmin: float | None - vmax: float | None - linewidths: float | Collection[float] | None - edgecolors: Literal["face", "none"] | ColorType | Collection[ColorType] | Collection[float] | None - margins: float | tuple[float, float] | None + vmin: FloatInt | None + vmax: FloatInt | None + linewidths: FloatInt | Collection[FloatInt] | None + edgecolors: Literal["face", "none"] | ColorType | Collection[ColorType] | Collection[FloatInt] | None + margins: FloatInt | tuple[FloatInt, FloatInt] | None # draw edges keywords; keep in sync with draw_networkx_edges edgelist: Collection[_Node | Hashable] | None # (u, v, k) for multigraphs and (u, v) for simple graphs - width: float | Collection[float] + width: FloatInt | Collection[FloatInt] edge_color: ColorType | Collection[ColorType] style: str | Collection[str] arrowstyle: str | Collection[str] | None - arrowsize: float | list[int] | list[float] + arrowsize: FloatInt | list[int] | list[FloatInt] edge_cmap: Colormap | None - edge_vmin: float | None - edge_vmax: float | None + edge_vmin: FloatInt | None + edge_vmax: FloatInt | None connectionstyle: str | Iterable[str] min_source_margin: int | Collection[int] min_target_margin: int | Collection[int] @@ -95,9 +96,9 @@ class _DrawNetworkxKwds(TypedDict, Generic[_Node], total=False): clip_on: bool # common keywords nodelist: Sequence[_Node] | None - node_size: float | Collection[float] + node_size: FloatInt | Collection[FloatInt] node_shape: str - alpha: float | Collection[float] | None + alpha: FloatInt | Collection[FloatInt] | None label: str | None hide_ticks: bool @@ -106,14 +107,14 @@ def apply_matplotlib_colors( src_attr: str, dest_attr: str, map: str | Colormap, - vmin: float | None = None, - vmax: float | None = None, + vmin: FloatInt | None = None, + vmax: FloatInt | None = None, nodes: bool = True, ) -> None: ... class CurvedArrowTextBase: arrow: FancyArrowPatch - label_pos: float + label_pos: FloatInt labels_horizontal: bool ax: Axes x: Incomplete @@ -123,7 +124,7 @@ class CurvedArrowTextBase: self, arrow: FancyArrowPatch, *args, - label_pos: float = 0.5, + label_pos: FloatInt = 0.5, labels_horizontal: bool = False, ax: Axes | None = None, **kwargs, @@ -137,7 +138,7 @@ def display( pos: str | Callable[[_G], Mapping[_Node, Collection[float]]] = ..., node_visible: str | bool = ..., node_color: str = ..., - node_size: str | float = ..., + node_size: str | FloatInt = ..., node_label: str | bool = ..., node_shape: str = ..., node_alpha: str = ..., @@ -148,7 +149,7 @@ def display( edge_color: str | ColorType = ..., edge_label: str = ..., edge_style: str = ..., - edge_alpha: str | float = ..., + edge_alpha: str | FloatInt = ..., arrowstyle: str = ..., arrowsize: str | int = ..., edge_curvature: str = ..., @@ -158,7 +159,7 @@ def display( ) -> _G: ... def draw( G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]] | None = None, + pos: Mapping[_Node, Collection[FloatInt]] | None = None, ax: Axes | None = None, *, with_labels: bool = ..., # default depends on whether a label argument is passed @@ -166,7 +167,7 @@ def draw( ) -> None: ... def draw_networkx( G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]] | None = None, + pos: Mapping[_Node, Collection[FloatInt]] | None = None, arrows: bool | None = None, with_labels: bool = True, *, @@ -175,41 +176,41 @@ def draw_networkx( ) -> None: ... def draw_networkx_nodes( # keep in sync with _DrawNetworkxKwds above G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]], + pos: Mapping[_Node, Collection[FloatInt]], nodelist: Collection[_Node] | None = None, - node_size: float | Collection[float] = 300, - node_color: ColorType | Collection[ColorType] | Collection[float] = "#1f78b4", + node_size: FloatInt | Collection[FloatInt] = 300, + node_color: ColorType | Collection[ColorType] | Collection[FloatInt] = "#1f78b4", node_shape: str = "o", - alpha: float | Collection[float] | None = None, + alpha: FloatInt | Collection[FloatInt] | None = None, cmap: str | Colormap | None = None, - vmin: float | None = None, - vmax: float | None = None, + vmin: FloatInt | None = None, + vmax: FloatInt | None = None, ax: Axes | None = None, - linewidths: float | Collection[float] | None = None, - edgecolors: Literal["face", "none"] | ColorType | Collection[ColorType] | Collection[float] | None = None, + linewidths: FloatInt | Collection[FloatInt] | None = None, + edgecolors: Literal["face", "none"] | ColorType | Collection[ColorType] | Collection[FloatInt] | None = None, label: str | None = None, - margins: float | tuple[float, float] | None = None, + margins: FloatInt | tuple[FloatInt, FloatInt] | None = None, hide_ticks: bool = True, ) -> PathCollection: ... @overload # arrows=None -> LineCollection if G is undirected, list[FancyArrowPatch] if G is directed def draw_networkx_edges( # keep in sync with _DrawNetworkxKwds above G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]], + pos: Mapping[_Node, Collection[FloatInt]], edgelist: Collection[_Node | Hashable] | None = None, # (u, v, k) for multigraphs and (u, v) for simple graphs - width: float | Collection[float] = 1.0, + width: FloatInt | Collection[FloatInt] = 1.0, edge_color: ColorType | Collection[ColorType] = "k", style: str | Collection[str] = "solid", - alpha: float | Collection[float] | None = None, + alpha: FloatInt | Collection[FloatInt] | None = None, arrowstyle: str | Collection[str] | None = None, - arrowsize: float | list[int] | list[float] = 10, # documented as int, mpl accepts float + arrowsize: FloatInt | list[int] | list[FloatInt] = 10, # documented as int, mpl accepts float edge_cmap: Colormap | None = None, - edge_vmin: float | None = None, - edge_vmax: float | None = None, + edge_vmin: FloatInt | None = None, + edge_vmax: FloatInt | None = None, ax: Axes | None = None, arrows: None = None, label: str | None = None, # documented as str, mpl accepts any object as it calls str on it - node_size: float | Collection[float] = 300, + node_size: FloatInt | Collection[FloatInt] = 300, nodelist: Sequence[_Node] | None = None, node_shape: str = "o", connectionstyle: str | Iterable[str] = "arc3", @@ -220,21 +221,21 @@ def draw_networkx_edges( # keep in sync with _DrawNetworkxKwds above @overload # directed graph and arrows=None -> list[FancyArrowPatch] def draw_networkx_edges( G: DiGraph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]], + pos: Mapping[_Node, Collection[FloatInt]], edgelist: Collection[_Node | Hashable] | None = None, # (u, v, k) for multigraphs and (u, v) for simple graphs - width: float | Collection[float] = 1.0, + width: FloatInt | Collection[FloatInt] = 1.0, edge_color: ColorType | Collection[ColorType] = "k", style: str | Collection[str] = "solid", - alpha: float | Collection[float] | None = None, + alpha: FloatInt | Collection[FloatInt] | None = None, arrowstyle: str | Collection[str] | None = None, - arrowsize: float | list[int] | list[float] = 10, # documented as int, mpl accepts float + arrowsize: FloatInt | list[int] | list[FloatInt] = 10, # documented as int, mpl accepts float edge_cmap: Colormap | None = None, - edge_vmin: float | None = None, - edge_vmax: float | None = None, + edge_vmin: FloatInt | None = None, + edge_vmax: FloatInt | None = None, ax: Axes | None = None, arrows: None = None, label: str | None = None, # documented as str, mpl accepts any object as it calls str on it - node_size: float | Collection[float] = 300, + node_size: FloatInt | Collection[FloatInt] = 300, nodelist: Sequence[_Node] | None = None, node_shape: str = "o", connectionstyle: str | Iterable[str] = "arc3", @@ -245,22 +246,22 @@ def draw_networkx_edges( @overload # arrows=True -> list[FancyArrowPatch] def draw_networkx_edges( G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]], + pos: Mapping[_Node, Collection[FloatInt]], edgelist: Collection[_Node | Hashable] | None = None, # (u, v, k) for multigraphs and (u, v) for simple graphs - width: float | Collection[float] = 1.0, + width: FloatInt | Collection[FloatInt] = 1.0, edge_color: ColorType | Collection[ColorType] = "k", style: str | Collection[str] = "solid", - alpha: float | Collection[float] | None = None, + alpha: FloatInt | Collection[FloatInt] | None = None, arrowstyle: str | Collection[str] | None = None, - arrowsize: float | list[int] | list[float] = 10, # documented as int, mpl accepts float + arrowsize: FloatInt | list[int] | list[FloatInt] = 10, # documented as int, mpl accepts float edge_cmap: Colormap | None = None, - edge_vmin: float | None = None, - edge_vmax: float | None = None, + edge_vmin: FloatInt | None = None, + edge_vmax: FloatInt | None = None, ax: Axes | None = None, *, arrows: Literal[True], label: str | None = None, # documented as str, mpl accepts any object as it calls str on it - node_size: float | Collection[float] = 300, + node_size: FloatInt | Collection[FloatInt] = 300, nodelist: Sequence[_Node] | None = None, node_shape: str = "o", connectionstyle: str | Iterable[str] = "arc3", @@ -271,20 +272,20 @@ def draw_networkx_edges( @overload # arrows=False -> LineCollection def draw_networkx_edges( G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]], + pos: Mapping[_Node, Collection[FloatInt]], edgelist: Collection[_Node | Hashable] | None = None, # (u, v, k) for multigraphs and (u, v) for simple graphs - width: float | Collection[float] = 1.0, + width: FloatInt | Collection[FloatInt] = 1.0, edge_color: ColorType | Collection[ColorType] = "k", style: str | Collection[str] = "solid", - alpha: float | Collection[float] | None = None, + alpha: FloatInt | Collection[FloatInt] | None = None, *, edge_cmap: Colormap | None = None, - edge_vmin: float | None = None, - edge_vmax: float | None = None, + edge_vmin: FloatInt | None = None, + edge_vmax: FloatInt | None = None, ax: Axes | None = None, arrows: Literal[False], label: str | None = None, # documented as str, mpl accepts any object as it calls str on it - node_size: float | Collection[float] = 300, + node_size: FloatInt | Collection[FloatInt] = 300, nodelist: Sequence[_Node] | None = None, node_shape: str = "o", hide_ticks: bool = True, @@ -292,13 +293,13 @@ def draw_networkx_edges( def draw_networkx_labels( # keep in sync with _DrawNetworkxKwds above G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]], + pos: Mapping[_Node, Collection[FloatInt]], labels: Mapping[_Node, object] | None = None, # labels are explicitly converted to str font_size: _FontSize | Mapping[_Node, _FontSize] = 12, font_color: ColorType | Mapping[_Node, Colormap] = "k", font_family: str | Mapping[_Node, str] = "sans-serif", font_weight: _FontWeight | Mapping[_Node, _FontWeight] = "normal", - alpha: float | Mapping[_Node, float] | None = None, + alpha: FloatInt | Mapping[_Node, FloatInt] | None = None, bbox: dict[str, Any] | None = None, # Any comes from mpl horizontalalignment: _HAlign = "center", # doc is wrong, doesn't really accept array verticalalignment: _VAlign = "center", # doc is wrong, doesn't really accept array @@ -309,7 +310,7 @@ def draw_networkx_labels( # keep in sync with _DrawNetworkxKwds above def draw_networkx_edge_labels( # TODO: find a way to have a covariant list for params annotated with `something | list[Incomplete]` G: Graph[_Node, _NodeData, _EdgeData], - pos: Mapping[_Node, Collection[float]], + pos: Mapping[_Node, Collection[FloatInt]], edge_labels: ( SupportsItems[ Collection[_Node | Hashable], # (u, v, k) for multigraphs and (u, v) for simple graphs @@ -317,19 +318,19 @@ def draw_networkx_edge_labels( ] | None ) = None, - label_pos: float | list[Incomplete] = 0.5, + label_pos: FloatInt | list[Incomplete] = 0.5, font_size: _FontSize | list[Incomplete] = 10, font_color: ColorType | list[Incomplete] = "k", font_family: str = "sans-serif", font_weight: _FontWeight | list[Incomplete] = "normal", - alpha: float | list[Incomplete] | None = None, + alpha: FloatInt | list[Incomplete] | None = None, bbox: dict[str, Any] | None = None, # Any comes from mpl horizontalalignment: _HAlign | list[Incomplete] = "center", verticalalignment: _VAlign | list[Incomplete] = "center", ax: Axes | None = None, rotate: bool | list[bool] = True, clip_on: bool = True, - node_size: float | Collection[float] = 300, + node_size: FloatInt | Collection[FloatInt] = 300, nodelist: Sequence[_Node] | None = None, connectionstyle: str | Iterable[str] = "arc3", hide_ticks: bool = True, @@ -399,10 +400,10 @@ def draw_forceatlas2( **kwargs: Unpack[_DrawNetworkxKwds[_Node]], ) -> None: ... def apply_alpha( - colors: ColorType | Collection[ColorType] | Collection[float], - alpha: float | Collection[float], + colors: ColorType | Collection[ColorType] | Collection[FloatInt], + alpha: FloatInt | Collection[FloatInt], elem_list: Collection[object], # nx objects (nodes, edges, labels) but its content is not used! cmap: str | Colormap | None = None, - vmin: float | None = None, - vmax: float | None = None, + vmin: FloatInt | None = None, + vmax: FloatInt | None = None, ) -> Array2D[np.float64]: ... diff --git a/stubs/networkx/networkx/generators/community.pyi b/stubs/networkx/networkx/generators/community.pyi index 8a3102cc5154..33a1439489a0 100644 --- a/stubs/networkx/networkx/generators/community.pyi +++ b/stubs/networkx/networkx/generators/community.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Collection @@ -23,18 +24,18 @@ def caveman_graph(l: int, k: int) -> Graph[int]: ... @_dispatchable def connected_caveman_graph(l: int, k: int) -> Graph[int]: ... @_dispatchable -def relaxed_caveman_graph(l: int, k: int, p: float, seed=None) -> Graph[int]: ... +def relaxed_caveman_graph(l: int, k: int, p: FloatInt, seed=None) -> Graph[int]: ... @_dispatchable def random_partition_graph( - sizes: list[int], p_in: float, p_out: float, seed=None, directed: bool = False + sizes: list[int], p_in: FloatInt, p_out: FloatInt, seed=None, directed: bool = False ) -> DiGraph[Incomplete]: ... @_dispatchable def planted_partition_graph( - l: int, k: int, p_in: float, p_out: float, seed=None, directed: bool = False + l: int, k: int, p_in: FloatInt, p_out: FloatInt, seed=None, directed: bool = False ) -> DiGraph[Incomplete]: ... @_dispatchable def gaussian_random_partition_graph( - n: int, s: float, v: float, p_in: float, p_out: float, directed: bool = False, seed=None + n: int, s: FloatInt, v: FloatInt, p_in: FloatInt, p_out: FloatInt, directed: bool = False, seed=None ) -> DiGraph[Incomplete]: ... @_dispatchable def ring_of_cliques(num_cliques: int, clique_size: int) -> Graph[int]: ... @@ -43,7 +44,7 @@ def windmill_graph(n: int, k: int) -> Graph[int]: ... @_dispatchable def stochastic_block_model( sizes: list[int], - p: list[list[float]], + p: list[list[FloatInt]], nodelist: Collection[Incomplete] | None = None, seed=None, directed: bool = False, @@ -53,15 +54,15 @@ def stochastic_block_model( @_dispatchable def LFR_benchmark_graph( n: int, - tau1: float, - tau2: float, - mu: float, - average_degree: float | None = None, + tau1: FloatInt, + tau2: FloatInt, + mu: FloatInt, + average_degree: FloatInt | None = None, min_degree: int | None = None, max_degree: int | None = None, min_community: int | None = None, max_community: int | None = None, - tol: float = 1e-07, + tol: FloatInt = 1e-07, max_iters: int = 500, seed=None, ) -> Graph[int]: ... diff --git a/stubs/networkx/networkx/generators/directed.pyi b/stubs/networkx/networkx/generators/directed.pyi index 0d32d803d860..b2e6accdd34b 100644 --- a/stubs/networkx/networkx/generators/directed.pyi +++ b/stubs/networkx/networkx/generators/directed.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable @@ -14,17 +15,17 @@ def gn_graph( n: int, kernel: Callable[..., Incomplete] | None = None, create_using: DiGraph[Incomplete] | None = None, seed=None ): ... @_dispatchable -def gnr_graph(n: int, p: float, create_using: DiGraph[Incomplete] | type[DiGraph[Incomplete]] | None = None, seed=None): ... +def gnr_graph(n: int, p: FloatInt, create_using: DiGraph[Incomplete] | type[DiGraph[Incomplete]] | None = None, seed=None): ... @_dispatchable def gnc_graph(n: int, create_using: DiGraph[Incomplete] | type[DiGraph[Incomplete]] | None = None, seed=None): ... @_dispatchable def scale_free_graph( n: int, - alpha: float = 0.41, - beta: float = 0.54, - gamma: float = 0.05, - delta_in: float = 0.2, - delta_out: float = 0, + alpha: FloatInt = 0.41, + beta: FloatInt = 0.54, + gamma: FloatInt = 0.05, + delta_in: FloatInt = 0.2, + delta_out: FloatInt = 0, create_using=None, seed=None, initial_graph: MultiDiGraph[Incomplete] | None = None, @@ -34,4 +35,4 @@ def random_uniform_k_out_graph( n: int, k: int, self_loops: bool = True, with_replacement: bool = True, seed=None ) -> Graph[Incomplete]: ... @_dispatchable -def random_k_out_graph(n: int, k: int, alpha: float, self_loops: bool = True, seed=None) -> MultiDiGraph[Incomplete]: ... +def random_k_out_graph(n: int, k: int, alpha: FloatInt, self_loops: bool = True, seed=None) -> MultiDiGraph[Incomplete]: ... diff --git a/stubs/networkx/networkx/generators/duplication.pyi b/stubs/networkx/networkx/generators/duplication.pyi index 0212e9c3b060..25e5ccfa6fb9 100644 --- a/stubs/networkx/networkx/generators/duplication.pyi +++ b/stubs/networkx/networkx/generators/duplication.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.utils.backends import _dispatchable @@ -7,6 +8,6 @@ from ..classes.graph import Graph __all__ = ["partial_duplication_graph", "duplication_divergence_graph"] @_dispatchable -def partial_duplication_graph(N: int, n: int, p: float, q: float, seed=None): ... +def partial_duplication_graph(N: int, n: int, p: FloatInt, q: FloatInt, seed=None): ... @_dispatchable -def duplication_divergence_graph(n: int, p: float, seed=None) -> Graph[Incomplete]: ... +def duplication_divergence_graph(n: int, p: FloatInt, seed=None) -> Graph[Incomplete]: ... diff --git a/stubs/networkx/networkx/generators/ego.pyi b/stubs/networkx/networkx/generators/ego.pyi index 17a15862aa1a..703d7473aaef 100644 --- a/stubs/networkx/networkx/generators/ego.pyi +++ b/stubs/networkx/networkx/generators/ego.pyi @@ -1,7 +1,8 @@ +from _typeshed import FloatInt from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable __all__ = ["ego_graph"] @_dispatchable -def ego_graph(G: Graph[_Node], n, radius: float = 1, center: bool = True, undirected: bool = False, distance=None): ... +def ego_graph(G: Graph[_Node], n, radius: FloatInt = 1, center: bool = True, undirected: bool = False, distance=None): ... diff --git a/stubs/networkx/networkx/generators/expanders.pyi b/stubs/networkx/networkx/generators/expanders.pyi index 204521e652c1..7d840e6793b0 100644 --- a/stubs/networkx/networkx/generators/expanders.pyi +++ b/stubs/networkx/networkx/generators/expanders.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing_extensions import deprecated @@ -31,6 +32,6 @@ def maybe_regular_expander_graph(n: int, d: int, *, create_using=None, max_tries ) def maybe_regular_expander(n, d, *, create_using=None, max_tries: int = 100, seed=None): ... @_dispatchable -def is_regular_expander(G: Graph[_Node], *, epsilon: float = 0) -> bool: ... +def is_regular_expander(G: Graph[_Node], *, epsilon: FloatInt = 0) -> bool: ... @_dispatchable def random_regular_expander_graph(n: int, d: int, *, epsilon=0, create_using=None, max_tries=100, seed=None) -> Graph[int]: ... diff --git a/stubs/networkx/networkx/generators/geometric.pyi b/stubs/networkx/networkx/generators/geometric.pyi index 1d12fb9c17be..5e1c7fbefa27 100644 --- a/stubs/networkx/networkx/generators/geometric.pyi +++ b/stubs/networkx/networkx/generators/geometric.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Iterable @@ -16,30 +17,30 @@ __all__ = [ ] @_dispatchable -def geometric_edges(G: Graph[_Node], radius: float, p: float = 2) -> list[Incomplete]: ... +def geometric_edges(G: Graph[_Node], radius: FloatInt, p: FloatInt = 2) -> list[Incomplete]: ... @_dispatchable def random_geometric_graph( n: int | Iterable[Incomplete], - radius: float, + radius: FloatInt, dim: int = 2, pos: dict[Incomplete, Incomplete] | None = None, - p: float = 2, + p: FloatInt = 2, seed=None, ) -> Graph[Incomplete]: ... @_dispatchable def soft_random_geometric_graph( n: int | Iterable[Incomplete], - radius: float, + radius: FloatInt, dim: int = 2, pos: dict[Incomplete, Incomplete] | None = None, - p: float = 2, + p: FloatInt = 2, p_dist: Callable[..., Incomplete] | None = None, seed=None, ) -> Graph[Incomplete]: ... @_dispatchable def geographical_threshold_graph( n: int | Iterable[Incomplete], - theta: float, + theta: FloatInt, dim: int = 2, pos: dict[Incomplete, Incomplete] | None = None, weight: dict[Incomplete, Incomplete] | None = None, @@ -50,26 +51,26 @@ def geographical_threshold_graph( @_dispatchable def waxman_graph( n: int | Iterable[Incomplete], - beta: float = 0.4, - alpha: float = 0.1, - L: float | None = None, - domain: tuple[float, float, float, float] = (0, 0, 1, 1), + beta: FloatInt = 0.4, + alpha: FloatInt = 0.1, + L: FloatInt | None = None, + domain: tuple[FloatInt, FloatInt, FloatInt, FloatInt] = (0, 0, 1, 1), metric: Callable[..., Incomplete] | None = None, seed=None, ) -> Graph[Incomplete]: ... # docstring marks p as int, but it still works with floats. So I think it's better for consistency @_dispatchable -def navigable_small_world_graph(n: int, p: float = 1, q: int = 1, r: float = 2, dim: int = 2, seed=None): ... +def navigable_small_world_graph(n: int, p: FloatInt = 1, q: int = 1, r: FloatInt = 2, dim: int = 2, seed=None): ... @_dispatchable def thresholded_random_geometric_graph( n: int | Iterable[Incomplete], - radius: float, - theta: float, + radius: FloatInt, + theta: FloatInt, dim: int = 2, pos: dict[Incomplete, Incomplete] | None = None, weight: dict[Incomplete, Incomplete] | None = None, - p: float = 2, + p: FloatInt = 2, seed=None, ) -> Graph[Incomplete]: ... @_dispatchable diff --git a/stubs/networkx/networkx/generators/internet_as_graphs.pyi b/stubs/networkx/networkx/generators/internet_as_graphs.pyi index eb120b1fd7d5..a7551205b9a6 100644 --- a/stubs/networkx/networkx/generators/internet_as_graphs.pyi +++ b/stubs/networkx/networkx/generators/internet_as_graphs.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Mapping @@ -21,9 +22,9 @@ class AS_graph_generator: p_m_m: Incomplete p_cp_m: Incomplete p_cp_cp: Incomplete - t_m: float - t_cp: float - t_c: float + t_m: FloatInt + t_cp: FloatInt + t_c: FloatInt def __init__(self, n, seed) -> None: ... G: Incomplete def t_graph(self) -> Graph[Incomplete]: ... @@ -31,7 +32,7 @@ class AS_graph_generator: def choose_peer_pref_attach(self, node_list): ... def choose_node_pref_attach(self, node_list): ... def add_customer(self, i, j) -> None: ... - def add_node(self, i, kind: str, reg2prob: float, avg_deg: float, t_edge_prob: float): ... + def add_node(self, i, kind: str, reg2prob: FloatInt, avg_deg: FloatInt, t_edge_prob: FloatInt): ... def add_m_peering_link(self, m, to_kind: str) -> bool: ... def add_cp_peering_link(self, cp, to_kind: str) -> bool: ... regions: Incomplete diff --git a/stubs/networkx/networkx/generators/intersection.pyi b/stubs/networkx/networkx/generators/intersection.pyi index b631d2b1e31c..14aecc5e593f 100644 --- a/stubs/networkx/networkx/generators/intersection.pyi +++ b/stubs/networkx/networkx/generators/intersection.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt from networkx.utils.backends import _dispatchable __all__ = ["uniform_random_intersection_graph", "k_random_intersection_graph", "general_random_intersection_graph"] @_dispatchable -def uniform_random_intersection_graph(n: int, m: int, p: float, seed=None): ... +def uniform_random_intersection_graph(n: int, m: int, p: FloatInt, seed=None): ... @_dispatchable -def k_random_intersection_graph(n: int, m: int, k: float, seed=None): ... +def k_random_intersection_graph(n: int, m: int, k: FloatInt, seed=None): ... @_dispatchable -def general_random_intersection_graph(n: int, m: int, p: list[float], seed=None): ... +def general_random_intersection_graph(n: int, m: int, p: list[FloatInt], seed=None): ... diff --git a/stubs/networkx/networkx/generators/lattice.pyi b/stubs/networkx/networkx/generators/lattice.pyi index 1b365e7815b3..5edccb05c375 100644 --- a/stubs/networkx/networkx/generators/lattice.pyi +++ b/stubs/networkx/networkx/generators/lattice.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterable @@ -11,7 +12,7 @@ def grid_2d_graph( m, n, periodic: bool = False, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None ) -> Graph[Incomplete]: ... @_dispatchable -def grid_graph(dim: list[float] | tuple[float, ...] | Iterable[Incomplete], periodic: bool = False) -> Graph[Incomplete]: ... +def grid_graph(dim: list[FloatInt] | tuple[FloatInt, ...] | Iterable[Incomplete], periodic: bool = False) -> Graph[Incomplete]: ... @_dispatchable def hypercube_graph(n: int) -> Graph[Incomplete]: ... @_dispatchable diff --git a/stubs/networkx/networkx/generators/random_graphs.pyi b/stubs/networkx/networkx/generators/random_graphs.pyi index d9e1d6c05571..da952395a0a0 100644 --- a/stubs/networkx/networkx/generators/random_graphs.pyi +++ b/stubs/networkx/networkx/generators/random_graphs.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Iterable from typing_extensions import deprecated @@ -30,9 +31,9 @@ __all__ = [ ] @_dispatchable -def fast_gnp_random_graph(n: int, p: float, seed=None, directed: bool = False, *, create_using=None): ... +def fast_gnp_random_graph(n: int, p: FloatInt, seed=None, directed: bool = False, *, create_using=None): ... @_dispatchable -def gnp_random_graph(n: int, p: float, seed=None, directed: bool = False, *, create_using=None): ... +def gnp_random_graph(n: int, p: FloatInt, seed=None, directed: bool = False, *, create_using=None): ... binomial_graph = gnp_random_graph erdos_renyi_graph = gnp_random_graph @@ -42,11 +43,11 @@ def dense_gnm_random_graph(n: int, m: int, seed=None, *, create_using=None): ... @_dispatchable def gnm_random_graph(n: int, m: int, seed=None, directed: bool = False, *, create_using=None): ... @_dispatchable -def newman_watts_strogatz_graph(n: int, k: int, p: float, seed=None, *, create_using=None): ... +def newman_watts_strogatz_graph(n: int, k: int, p: FloatInt, seed=None, *, create_using=None): ... @_dispatchable -def watts_strogatz_graph(n: int, k: int, p: float, seed=None, *, create_using=None): ... +def watts_strogatz_graph(n: int, k: int, p: FloatInt, seed=None, *, create_using=None): ... @_dispatchable -def connected_watts_strogatz_graph(n: int, k: int, p: float, tries: int = 100, seed=None, *, create_using=None): ... +def connected_watts_strogatz_graph(n: int, k: int, p: FloatInt, tries: int = 100, seed=None, *, create_using=None): ... @_dispatchable def random_regular_graph(d: int, n: int, seed=None, *, create_using=None): ... @_dispatchable @@ -55,23 +56,23 @@ def barabasi_albert_graph( ) -> Graph[Incomplete]: ... @_dispatchable def dual_barabasi_albert_graph( - n: int, m1: int, m2: int, p: float, seed=None, initial_graph: Graph[Incomplete] | None = None, *, create_using=None + n: int, m1: int, m2: int, p: FloatInt, seed=None, initial_graph: Graph[Incomplete] | None = None, *, create_using=None ) -> Graph[Incomplete]: ... @_dispatchable -def extended_barabasi_albert_graph(n: int, m: int, p: float, q: float, seed=None, *, create_using=None) -> Graph[Incomplete]: ... +def extended_barabasi_albert_graph(n: int, m: int, p: FloatInt, q: FloatInt, seed=None, *, create_using=None) -> Graph[Incomplete]: ... @_dispatchable -def powerlaw_cluster_graph(n: int, m: int, p: float, seed=None, *, create_using=None): ... +def powerlaw_cluster_graph(n: int, m: int, p: FloatInt, seed=None, *, create_using=None): ... @_dispatchable -def random_lobster_graph(n: int, p1: float, p2: float, seed=None, *, create_using=None): ... +def random_lobster_graph(n: int, p1: FloatInt, p2: FloatInt, seed=None, *, create_using=None): ... @_dispatchable @deprecated("`random_lobster` is a deprecated alias for `random_lobster_graph`. Use `random_lobster_graph` instead.") def random_lobster(n, p1, p2, seed=None, *, create_using=None): ... @_dispatchable -def random_shell_graph(constructor: Iterable[tuple[int, int, float]], seed=None, *, create_using=None): ... +def random_shell_graph(constructor: Iterable[tuple[int, int, FloatInt]], seed=None, *, create_using=None): ... @_dispatchable -def random_powerlaw_tree(n: int, gamma: float = 3, seed=None, tries: int = 100, *, create_using=None): ... +def random_powerlaw_tree(n: int, gamma: FloatInt = 3, seed=None, tries: int = 100, *, create_using=None): ... @_dispatchable -def random_powerlaw_tree_sequence(n: int, gamma: float = 3, seed=None, tries: int = 100): ... +def random_powerlaw_tree_sequence(n: int, gamma: FloatInt = 3, seed=None, tries: int = 100): ... @_dispatchable def random_kernel_graph( n: int, diff --git a/stubs/networkx/networkx/generators/spectral_graph_forge.pyi b/stubs/networkx/networkx/generators/spectral_graph_forge.pyi index 2822fc3544a7..eb96ba759d27 100644 --- a/stubs/networkx/networkx/generators/spectral_graph_forge.pyi +++ b/stubs/networkx/networkx/generators/spectral_graph_forge.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from networkx.classes.graph import Graph, _Node @@ -6,4 +7,4 @@ from networkx.utils.backends import _dispatchable __all__ = ["spectral_graph_forge"] @_dispatchable -def spectral_graph_forge(G: Graph[_Node], alpha: float, transformation: str = "identity", seed=None) -> Graph[Incomplete]: ... +def spectral_graph_forge(G: Graph[_Node], alpha: FloatInt, transformation: str = "identity", seed=None) -> Graph[Incomplete]: ... diff --git a/stubs/networkx/networkx/generators/time_series.pyi b/stubs/networkx/networkx/generators/time_series.pyi index 24ae43a33e08..2c0a70ed86a4 100644 --- a/stubs/networkx/networkx/generators/time_series.pyi +++ b/stubs/networkx/networkx/generators/time_series.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from networkx.classes.graph import Graph @@ -6,4 +7,4 @@ from networkx.utils.backends import _dispatchable __all__ = ["visibility_graph"] @_dispatchable -def visibility_graph(series: Sequence[float]) -> Graph[int]: ... +def visibility_graph(series: Sequence[FloatInt]) -> Graph[int]: ... diff --git a/stubs/networkx/networkx/linalg/algebraicconnectivity.pyi b/stubs/networkx/networkx/linalg/algebraicconnectivity.pyi index 3ff0fd053a4d..a82c38a20bad 100644 --- a/stubs/networkx/networkx/linalg/algebraicconnectivity.pyi +++ b/stubs/networkx/networkx/linalg/algebraicconnectivity.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal import numpy as np @@ -12,7 +13,7 @@ def algebraic_connectivity( G: Graph[_Node], weight: str | None = "weight", normalized: bool = False, - tol: float = 1e-08, + tol: FloatInt = 1e-08, method: Literal["tracemin_pcg", "tracemin_lu", "lanczos", "lobpcg"] = "tracemin_pcg", seed: Seed | None = None, ) -> float: ... @@ -21,7 +22,7 @@ def fiedler_vector( G: Graph[_Node], weight: str | None = "weight", normalized: bool = False, - tol: float = 1e-08, + tol: FloatInt = 1e-08, method: Literal["tracemin_pcg", "tracemin_lu", "lanczos", "lobpcg"] = "tracemin_pcg", seed: Seed | None = None, ) -> Array1D[np.float64]: ... @@ -30,7 +31,7 @@ def spectral_ordering( G: Graph[_Node], weight: str | None = "weight", normalized: bool = False, - tol: float = 1e-08, + tol: FloatInt = 1e-08, method: Literal["tracemin_pcg", "tracemin_lu", "lanczos", "lobpcg"] = "tracemin_pcg", seed: Seed | None = None, ) -> list[_Node]: ... @@ -39,7 +40,7 @@ def spectral_bisection( G: Graph[_Node], weight: str | None = "weight", normalized: bool = False, - tol: float = 1e-08, + tol: FloatInt = 1e-08, method: Literal["tracemin_pcg", "tracemin_lu", "lanczos", "lobpcg"] = "tracemin_pcg", seed: Seed | None = None, ) -> tuple[set[_Node], set[_Node]]: ... diff --git a/stubs/networkx/networkx/linalg/bethehessianmatrix.pyi b/stubs/networkx/networkx/linalg/bethehessianmatrix.pyi index 6cc9100b9870..92b974954a85 100644 --- a/stubs/networkx/networkx/linalg/bethehessianmatrix.pyi +++ b/stubs/networkx/networkx/linalg/bethehessianmatrix.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection from networkx.classes.graph import Graph, _Node @@ -7,4 +8,4 @@ from scipy.sparse import csr_array # type: ignore[import-untyped] # pyright: i __all__ = ["bethe_hessian_matrix"] @_dispatchable -def bethe_hessian_matrix(G: Graph[_Node], r: float | None = None, nodelist: Collection[_Node] | None = None) -> csr_array: ... +def bethe_hessian_matrix(G: Graph[_Node], r: FloatInt | None = None, nodelist: Collection[_Node] | None = None) -> csr_array: ... diff --git a/stubs/networkx/networkx/linalg/laplacianmatrix.pyi b/stubs/networkx/networkx/linalg/laplacianmatrix.pyi index 089d31900cfb..c85b12469f82 100644 --- a/stubs/networkx/networkx/linalg/laplacianmatrix.pyi +++ b/stubs/networkx/networkx/linalg/laplacianmatrix.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection from typing import Literal @@ -27,7 +28,7 @@ def directed_laplacian_matrix( nodelist: Collection[_Node] | None = None, weight: str | None = "weight", walk_type: Literal["random", "lazy", "pagerank"] | None = None, - alpha: float = 0.95, + alpha: FloatInt = 0.95, ) -> Array2D[np.float64]: ... @_dispatchable def directed_combinatorial_laplacian_matrix( @@ -35,5 +36,5 @@ def directed_combinatorial_laplacian_matrix( nodelist: Collection[_Node] | None = None, weight: str | None = "weight", walk_type: Literal["random", "lazy", "pagerank"] | None = None, - alpha: float = 0.95, + alpha: FloatInt = 0.95, ) -> Array2D[np.float64]: ... diff --git a/stubs/networkx/networkx/linalg/spectrum.pyi b/stubs/networkx/networkx/linalg/spectrum.pyi index 05e4455eb7da..6ef6232f90ba 100644 --- a/stubs/networkx/networkx/linalg/spectrum.pyi +++ b/stubs/networkx/networkx/linalg/spectrum.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import numpy as np from networkx._typing import Array1D from networkx.classes.graph import Graph, _Node @@ -20,4 +21,4 @@ def adjacency_spectrum(G: Graph[_Node], weight: str | None = "weight") -> Array1 @_dispatchable def modularity_spectrum(G: Graph[_Node]) -> Array1D[np.complex128]: ... @_dispatchable -def bethe_hessian_spectrum(G: Graph[_Node], r: float | None = None) -> Array1D[np.float64]: ... +def bethe_hessian_spectrum(G: Graph[_Node], r: FloatInt | None = None) -> Array1D[np.float64]: ... diff --git a/stubs/networkx/networkx/utils/random_sequence.pyi b/stubs/networkx/networkx/utils/random_sequence.pyi index 1092bf7ab0c0..1b972020d57a 100644 --- a/stubs/networkx/networkx/utils/random_sequence.pyi +++ b/stubs/networkx/networkx/utils/random_sequence.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterable @@ -11,9 +12,9 @@ __all__ = [ "weighted_choice", ] -def powerlaw_sequence(n, exponent: float = 2.0, seed=None): ... +def powerlaw_sequence(n, exponent: FloatInt = 2.0, seed=None): ... def is_valid_tree_degree_sequence(degree_sequence: Iterable[Incomplete]) -> tuple[bool, str]: ... -def zipf_rv(alpha: float, xmin: int = 1, seed=None) -> int: ... +def zipf_rv(alpha: FloatInt, xmin: int = 1, seed=None) -> int: ... def cumulative_distribution(distribution): ... def discrete_sequence(n, distribution=None, cdistribution=None, seed=None): ... def random_weighted_sample(mapping, k, seed=None): ... diff --git a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi index 00b375898b98..35ebdb7ac647 100644 --- a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi +++ b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable @@ -39,8 +40,8 @@ class ServiceApplicationClient(Client): subject: str | None = None, issuer: str | None = None, audience: str | None = None, - expires_at: float | None = None, - issued_at: float | None = None, + expires_at: FloatInt | None = None, + issued_at: FloatInt | None = None, extra_claims: dict[str, Incomplete] | None = None, body: str = "", scope: str | set[object] | tuple[object] | list[object] | None = None, diff --git a/stubs/openpyxl/openpyxl/cell/__init__.pyi b/stubs/openpyxl/openpyxl/cell/__init__.pyi index 7bd4c41d9494..9b3e5386092a 100644 --- a/stubs/openpyxl/openpyxl/cell/__init__.pyi +++ b/stubs/openpyxl/openpyxl/cell/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from datetime import date, datetime, time, timedelta from decimal import Decimal from typing import Any, TypeAlias @@ -12,7 +13,7 @@ _TimeTypes: TypeAlias = datetime | date | time | timedelta _CellGetValue: TypeAlias = ( # noqa: Y047 # Used in other modules # if numpy is installed also numpy bool and number types bool - | float + | FloatInt | Decimal | str | CellRichText diff --git a/stubs/openpyxl/openpyxl/cell/cell.pyi b/stubs/openpyxl/openpyxl/cell/cell.pyi index b16d008d9f4e..2220ca35174e 100644 --- a/stubs/openpyxl/openpyxl/cell/cell.pyi +++ b/stubs/openpyxl/openpyxl/cell/cell.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ReadableBuffer from datetime import datetime from re import Pattern @@ -106,4 +107,4 @@ class MergedCell(StyleableObject): # The value of a MergedCell is always None. value: None -def WriteOnlyCell(ws: _WorkbookChild | ReadOnlyWorksheet, value: str | float | datetime | None = None) -> Cell: ... +def WriteOnlyCell(ws: _WorkbookChild | ReadOnlyWorksheet, value: str | FloatInt | datetime | None = None) -> Cell: ... diff --git a/stubs/openpyxl/openpyxl/chart/_3d.pyi b/stubs/openpyxl/openpyxl/chart/_3d.pyi index 6c12831498f8..728203b6731a 100644 --- a/stubs/openpyxl/openpyxl/chart/_3d.pyi +++ b/stubs/openpyxl/openpyxl/chart/_3d.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused from typing import ClassVar, Literal @@ -12,9 +13,9 @@ from ..xml._functions_overloads import _HasTagAndGet class View3D(Serialisable): tagname: ClassVar[str] - rotX: NestedMinMax[float, Literal[True]] + rotX: NestedMinMax[FloatInt, Literal[True]] x_rotation: Alias - hPercent: NestedMinMax[float, Literal[True]] + hPercent: NestedMinMax[FloatInt, Literal[True]] height_percent: Alias rotY: NestedInteger[Literal[True]] y_rotation: Alias diff --git a/stubs/openpyxl/openpyxl/chart/_chart.pyi b/stubs/openpyxl/openpyxl/chart/_chart.pyi index 61e472151af8..3206a68223f7 100644 --- a/stubs/openpyxl/openpyxl/chart/_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/_chart.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias @@ -29,8 +30,8 @@ class ChartBase(Serialisable): title: TitleDescriptor anchor: str width: int - height: float - style: MinMax[float, Literal[True]] + height: FloatInt + style: MinMax[FloatInt, Literal[True]] mime_type: str graphical_properties: Typed[GraphicalProperties, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/stubs/openpyxl/openpyxl/chart/axis.pyi b/stubs/openpyxl/openpyxl/chart/axis.pyi index b98f29d87c35..563ce3df52d1 100644 --- a/stubs/openpyxl/openpyxl/chart/axis.pyi +++ b/stubs/openpyxl/openpyxl/chart/axis.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload from typing_extensions import Self @@ -221,7 +222,7 @@ class TextAxis(_BaseAxis): # crossesAt = _BaseAxis.crossesAt auto: NestedBool[Literal[True]] lblAlgn: NestedNoneSet[_TextAxisLblAlgn] - lblOffset: NestedMinMax[float, Literal[False]] + lblOffset: NestedMinMax[FloatInt, Literal[False]] tickLblSkip: NestedInteger[Literal[True]] tickMarkSkip: NestedInteger[Literal[True]] noMultiLvlLbl: NestedBool[Literal[True]] diff --git a/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi b/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi index d9e1cd4dc4f8..7a120a5fc1cd 100644 --- a/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias @@ -19,7 +20,7 @@ class BubbleChart(ChartBase): dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias bubble3D: NestedBool[Literal[True]] - bubbleScale: NestedMinMax[float, Literal[True]] + bubbleScale: NestedMinMax[FloatInt, Literal[True]] showNegBubbles: NestedBool[Literal[True]] sizeRepresents: NestedNoneSet[_BubbleChartSizeRepresents] extLst: Typed[ExtensionList, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/chart/chartspace.pyi b/stubs/openpyxl/openpyxl/chart/chartspace.pyi index 5e21bb8397a7..88d06f72b104 100644 --- a/stubs/openpyxl/openpyxl/chart/chartspace.pyi +++ b/stubs/openpyxl/openpyxl/chart/chartspace.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload @@ -91,7 +92,7 @@ class ChartSpace(Serialisable): date1904: NestedBool[Literal[True]] lang: NestedString[Literal[True]] roundedCorners: NestedBool[Literal[True]] - style: NestedMinMax[float, Literal[True]] + style: NestedMinMax[FloatInt, Literal[True]] clrMapOvr: Typed[ColorMapping, Literal[True]] pivotSource: Typed[PivotSource, Literal[True]] protection: Typed[Protection, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/chart/descriptors.pyi b/stubs/openpyxl/openpyxl/chart/descriptors.pyi index fa6f41d0238c..ec684e3f8335 100644 --- a/stubs/openpyxl/openpyxl/chart/descriptors.pyi +++ b/stubs/openpyxl/openpyxl/chart/descriptors.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal from openpyxl.chart.data_source import NumFmt @@ -7,13 +8,13 @@ from openpyxl.descriptors.serialisable import Serialisable class NestedGapAmount(NestedMinMax[float, bool]): allow_none: bool - min: float - max: float + min: FloatInt + max: FloatInt class NestedOverlap(NestedMinMax[float, bool]): allow_none: bool - min: float - max: float + min: FloatInt + max: FloatInt class NumberFormatDescriptor(Typed[NumFmt, Literal[True]]): expected_type: type[NumFmt] diff --git a/stubs/openpyxl/openpyxl/chart/layout.pyi b/stubs/openpyxl/openpyxl/chart/layout.pyi index dde22b10a1d7..4131e189be71 100644 --- a/stubs/openpyxl/openpyxl/chart/layout.pyi +++ b/stubs/openpyxl/openpyxl/chart/layout.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, Unused from typing import ClassVar, Literal, TypeAlias @@ -18,11 +19,11 @@ class ManualLayout(Serialisable): yMode: NestedNoneSet[_ManualLayoutMode] wMode: NestedSet[_ManualLayoutMode] hMode: NestedSet[_ManualLayoutMode] - x: NestedMinMax[float, Literal[True]] - y: NestedMinMax[float, Literal[True]] - w: NestedMinMax[float, Literal[True]] + x: NestedMinMax[FloatInt, Literal[True]] + y: NestedMinMax[FloatInt, Literal[True]] + w: NestedMinMax[FloatInt, Literal[True]] width: Alias - h: NestedMinMax[float, Literal[True]] + h: NestedMinMax[FloatInt, Literal[True]] height: Alias extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/stubs/openpyxl/openpyxl/chart/marker.pyi b/stubs/openpyxl/openpyxl/chart/marker.pyi index bd526ee90985..953685ed1292 100644 --- a/stubs/openpyxl/openpyxl/chart/marker.pyi +++ b/stubs/openpyxl/openpyxl/chart/marker.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused from typing import ClassVar, Literal, TypeAlias @@ -17,7 +18,7 @@ _MarkerSymbol: TypeAlias = Literal[ class Marker(Serialisable): tagname: ClassVar[str] symbol: NestedNoneSet[_MarkerSymbol] - size: NestedMinMax[float, Literal[True]] + size: NestedMinMax[FloatInt, Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias extLst: Typed[ExtensionList, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/chart/pie_chart.pyi b/stubs/openpyxl/openpyxl/chart/pie_chart.pyi index c43e6f1dafe6..488987cca7b5 100644 --- a/stubs/openpyxl/openpyxl/chart/pie_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/pie_chart.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias @@ -33,7 +34,7 @@ class PieChart(_PieChartBase): # varyColors = _PieChartBase.varyColors # ser = _PieChartBase.ser # dLbls = _PieChartBase.dLbls - firstSliceAng: NestedMinMax[float, Literal[False]] + firstSliceAng: NestedMinMax[FloatInt, Literal[False]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( @@ -55,8 +56,8 @@ class DoughnutChart(_PieChartBase): # varyColors = _PieChartBase.varyColors # ser = _PieChartBase.ser # dLbls = _PieChartBase.dLbls - firstSliceAng: NestedMinMax[float, Literal[False]] - holeSize: NestedMinMax[float, Literal[True]] + firstSliceAng: NestedMinMax[FloatInt, Literal[False]] + holeSize: NestedMinMax[FloatInt, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( @@ -85,7 +86,7 @@ class ProjectedPieChart(_PieChartBase): splitType: NestedNoneSet[_ProjectedPieChartSplitType] splitPos: NestedFloat[Literal[True]] custSplit: Typed[CustomSplit, Literal[True]] - secondPieSize: NestedMinMax[float, Literal[True]] + secondPieSize: NestedMinMax[FloatInt, Literal[True]] serLines: Typed[ChartLines, Literal[True]] join_lines: Alias extLst: Typed[ExtensionList, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index 5636a3b25226..7081215aba01 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, ReadableBuffer, Unused from collections.abc import Iterable, Sized from datetime import datetime @@ -113,10 +114,10 @@ class Convertible(Typed[_T, _N]): # float @overload def __set__( - self: Convertible[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None + self: Convertible[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None ) -> None: ... @overload - def __set__(self: Convertible[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... + def __set__(self: Convertible[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... # Anything else @overload def __set__(self: Convertible[_T, Literal[True]], instance: Serialisable | Strict, value: _T | int | Any | None) -> None: ... @@ -124,28 +125,28 @@ class Convertible(Typed[_T, _N]): class Max(Convertible[_M, _N]): expected_type: type[_M] allow_none: _N - max: float + max: FloatInt @overload def __init__( - self: Max[int, Literal[True]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], max: float + self: Max[int, Literal[True]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], max: FloatInt ) -> None: ... @overload def __init__( - self: Max[int, Literal[False]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, max: float + self: Max[int, Literal[False]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, max: FloatInt ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: Max[float, Literal[True]], *, expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], max: float + self: Max[FloatInt, Literal[True]], *, expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[True], max: FloatInt ) -> None: ... @overload def __init__( - self: Max[float, Literal[False]], + self: Max[FloatInt, Literal[False]], *, - expected_type: _ExpectedTypeParam[float] = ..., + expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[False] = False, - max: float, + max: FloatInt, ) -> None: ... @overload # type: ignore[override] # Different restrictions @@ -153,35 +154,35 @@ class Max(Convertible[_M, _N]): @overload def __set__(self: Max[int, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToInt) -> None: ... @overload - def __set__(self: Max[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None) -> None: ... + def __set__(self: Max[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None) -> None: ... @overload - def __set__(self: Max[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... + def __set__(self: Max[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... class Min(Convertible[_M, _N]): expected_type: type[_M] allow_none: _N - min: float + min: FloatInt @overload def __init__( - self: Min[int, Literal[True]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], min: float + self: Min[int, Literal[True]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], min: FloatInt ) -> None: ... @overload def __init__( - self: Min[int, Literal[False]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, min: float + self: Min[int, Literal[False]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, min: FloatInt ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: Min[float, Literal[True]], *, expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], min: float + self: Min[FloatInt, Literal[True]], *, expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[True], min: FloatInt ) -> None: ... @overload def __init__( - self: Min[float, Literal[False]], + self: Min[FloatInt, Literal[False]], *, - expected_type: _ExpectedTypeParam[float] = ..., + expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[False] = False, - min: float, + min: FloatInt, ) -> None: ... @overload # type: ignore[override] # Different restrictions @@ -189,9 +190,9 @@ class Min(Convertible[_M, _N]): @overload def __set__(self: Min[int, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToInt) -> None: ... @overload - def __set__(self: Min[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None) -> None: ... + def __set__(self: Min[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None) -> None: ... @overload - def __set__(self: Min[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... + def __set__(self: Min[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... class MinMax(Min[_M, _N], Max[_M, _N]): expected_type: type[_M] @@ -203,8 +204,8 @@ class MinMax(Min[_M, _N], Max[_M, _N]): *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], - min: float, - max: float, + min: FloatInt, + max: FloatInt, ) -> None: ... @overload def __init__( @@ -212,27 +213,27 @@ class MinMax(Min[_M, _N], Max[_M, _N]): *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, - min: float, - max: float, + min: FloatInt, + max: FloatInt, ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: MinMax[float, Literal[True]], + self: MinMax[FloatInt, Literal[True]], *, - expected_type: _ExpectedTypeParam[float] = ..., + expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[True], - min: float, - max: float, + min: FloatInt, + max: FloatInt, ) -> None: ... @overload def __init__( - self: MinMax[float, Literal[False]], + self: MinMax[FloatInt, Literal[False]], *, - expected_type: _ExpectedTypeParam[float] = ..., + expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[False] = False, - min: float, - max: float, + min: FloatInt, + max: FloatInt, ) -> None: ... class Set(Descriptor[_T]): diff --git a/stubs/openpyxl/openpyxl/descriptors/excel.pyi b/stubs/openpyxl/openpyxl/descriptors/excel.pyi index eabbdcfafe6f..445afca4e335 100644 --- a/stubs/openpyxl/openpyxl/descriptors/excel.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/excel.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import ClassVar, Literal @@ -13,15 +14,15 @@ class UniversalMeasure(MatchPattern[str, Incomplete]): class TextPoint(MinMax[_M, _N]): expected_type: type[_M] - min: float - max: float + min: FloatInt + max: FloatInt Coordinate = Integer class Percentage(MinMax[float, Incomplete]): pattern: str - min: float - max: float + min: FloatInt + max: FloatInt def __set__(self, instance: Serialisable | Strict, value) -> None: ... class Extension(Serialisable): diff --git a/stubs/openpyxl/openpyxl/descriptors/nested.pyi b/stubs/openpyxl/openpyxl/descriptors/nested.pyi index 4a785b94720f..0ff84c27c430 100644 --- a/stubs/openpyxl/openpyxl/descriptors/nested.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/nested.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused from collections.abc import Iterable from typing import Any, ClassVar, Literal, TypeAlias, overload @@ -97,13 +98,13 @@ class NestedValue(Nested[_T], Convertible[_T, _N]): # type: ignore[misc] # float @overload def __set__( - self: NestedValue[float, Literal[True]], + self: NestedValue[FloatInt, Literal[True]], instance: Serialisable | Strict, value: _HasTagAndGet[ConvertibleToFloat | None] | ConvertibleToFloat | None, ) -> None: ... @overload def __set__( - self: NestedValue[float, Literal[False]], + self: NestedValue[FloatInt, Literal[False]], instance: Serialisable | Strict, value: _HasTagAndGet[ConvertibleToFloat] | ConvertibleToFloat, ) -> None: ... @@ -207,8 +208,8 @@ class NestedMinMax(Nested[_M], MinMax[_M, _N]): # type: ignore[misc] # pyrefly *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], - min: float, - max: float, + min: FloatInt, + max: FloatInt, ) -> None: ... @overload def __init__( @@ -216,27 +217,27 @@ class NestedMinMax(Nested[_M], MinMax[_M, _N]): # type: ignore[misc] # pyrefly *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, - min: float, - max: float, + min: FloatInt, + max: FloatInt, ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: NestedMinMax[float, Literal[True]], + self: NestedMinMax[FloatInt, Literal[True]], *, - expected_type: _ExpectedTypeParam[float] = ..., + expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[True], - min: float, - max: float, + min: FloatInt, + max: FloatInt, ) -> None: ... @overload def __init__( - self: NestedMinMax[float, Literal[False]], + self: NestedMinMax[FloatInt, Literal[False]], *, - expected_type: _ExpectedTypeParam[float] = ..., + expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[False] = False, - min: float, - max: float, + min: FloatInt, + max: FloatInt, ) -> None: ... @overload @@ -258,13 +259,13 @@ class NestedMinMax(Nested[_M], MinMax[_M, _N]): # type: ignore[misc] # pyrefly ) -> None: ... @overload def __set__( - self: NestedMinMax[float, Literal[True]], + self: NestedMinMax[FloatInt, Literal[True]], instance: Serialisable | Strict, value: _HasTagAndGet[ConvertibleToFloat | None] | ConvertibleToFloat | None, ) -> None: ... @overload def __set__( - self: NestedMinMax[float, Literal[False]], + self: NestedMinMax[FloatInt, Literal[False]], instance: Serialisable | Strict, value: _HasTagAndGet[ConvertibleToFloat] | ConvertibleToFloat, ) -> None: ... diff --git a/stubs/openpyxl/openpyxl/drawing/colors.pyi b/stubs/openpyxl/openpyxl/drawing/colors.pyi index 872589fbb8dc..58cfc017c81d 100644 --- a/stubs/openpyxl/openpyxl/drawing/colors.pyi +++ b/stubs/openpyxl/openpyxl/drawing/colors.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete from typing import ClassVar, Final, Literal, TypeAlias, overload @@ -332,15 +333,15 @@ class SystemColor(Serialisable): class HSLColor(Serialisable): tagname: ClassVar[str] hue: Integer[Literal[False]] - sat: MinMax[float, Literal[False]] - lum: MinMax[float, Literal[False]] + sat: MinMax[FloatInt, Literal[False]] + lum: MinMax[FloatInt, Literal[False]] def __init__(self, hue: ConvertibleToInt, sat: ConvertibleToFloat, lum: ConvertibleToFloat) -> None: ... class RGBPercent(Serialisable): tagname: ClassVar[str] - r: MinMax[float, Literal[False]] - g: MinMax[float, Literal[False]] - b: MinMax[float, Literal[False]] + r: MinMax[FloatInt, Literal[False]] + g: MinMax[FloatInt, Literal[False]] + b: MinMax[FloatInt, Literal[False]] def __init__(self, r: ConvertibleToFloat, g: ConvertibleToFloat, b: ConvertibleToFloat) -> None: ... _RGBPercent: TypeAlias = RGBPercent diff --git a/stubs/openpyxl/openpyxl/drawing/fill.pyi b/stubs/openpyxl/openpyxl/drawing/fill.pyi index 6ee8f5964c6d..5963d0d98062 100644 --- a/stubs/openpyxl/openpyxl/drawing/fill.pyi +++ b/stubs/openpyxl/openpyxl/drawing/fill.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete from typing import ClassVar, Literal, TypeAlias @@ -128,7 +129,7 @@ class StretchInfoProperties(Serialisable): class GradientStop(Serialisable): tagname: ClassVar[str] namespace: ClassVar[str] - pos: MinMax[float, Literal[True]] + pos: MinMax[FloatInt, Literal[True]] scrgbClr: Typed[_RGBPercent, Literal[True]] RGBPercent: Alias srgbClr: NestedValue[_RGBPercent, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/drawing/geometry.pyi b/stubs/openpyxl/openpyxl/drawing/geometry.pyi index a15293e0c663..4881295149ec 100644 --- a/stubs/openpyxl/openpyxl/drawing/geometry.pyi +++ b/stubs/openpyxl/openpyxl/drawing/geometry.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload @@ -504,7 +505,7 @@ class AdjPoint2D(Serialisable): def __init__(self, x=None, y=None) -> None: ... class ConnectionSite(Serialisable): - ang: MinMax[float, Literal[False]] + ang: MinMax[FloatInt, Literal[False]] pos: Typed[AdjPoint2D, Literal[False]] def __init__(self, ang: ConvertibleToFloat, pos: AdjPoint2D) -> None: ... diff --git a/stubs/openpyxl/openpyxl/drawing/line.pyi b/stubs/openpyxl/openpyxl/drawing/line.pyi index 209d8165ea15..d34283e8df59 100644 --- a/stubs/openpyxl/openpyxl/drawing/line.pyi +++ b/stubs/openpyxl/openpyxl/drawing/line.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias @@ -48,7 +49,7 @@ class DashStopList(Serialisable): class LineProperties(Serialisable): tagname: ClassVar[str] namespace: ClassVar[str] - w: MinMax[float, Literal[True]] + w: MinMax[FloatInt, Literal[True]] width: Alias cap: NoneSet[_LinePropertiesCap] cmpd: NoneSet[_LinePropertiesCmpd] diff --git a/stubs/openpyxl/openpyxl/drawing/text.pyi b/stubs/openpyxl/openpyxl/drawing/text.pyi index 3ead43febde6..f5815932bc59 100644 --- a/stubs/openpyxl/openpyxl/drawing/text.pyi +++ b/stubs/openpyxl/openpyxl/drawing/text.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias @@ -168,7 +169,7 @@ class Font(Serialisable): namespace: ClassVar[str] typeface: String[Literal[False]] panose: Incomplete - pitchFamily: MinMax[float, Literal[True]] + pitchFamily: MinMax[FloatInt, Literal[True]] charset: Integer[Literal[True]] def __init__( self, typeface: str, panose=None, pitchFamily: ConvertibleToFloat | None = None, charset: ConvertibleToInt | None = None @@ -180,7 +181,7 @@ class CharacterProperties(Serialisable): kumimoji: Bool[Literal[True]] lang: String[Literal[True]] altLang: String[Literal[True]] - sz: MinMax[float, Literal[True]] + sz: MinMax[FloatInt, Literal[True]] b: Bool[Literal[True]] i: Bool[Literal[True]] u: NoneSet[_CharacterPropertiesU] diff --git a/stubs/openpyxl/openpyxl/styles/alignment.pyi b/stubs/openpyxl/openpyxl/styles/alignment.pyi index 40f69c4e46cd..f7079fc8c542 100644 --- a/stubs/openpyxl/openpyxl/styles/alignment.pyi +++ b/stubs/openpyxl/openpyxl/styles/alignment.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat from collections.abc import Iterator from typing import ClassVar, Final, Literal, TypeAlias @@ -23,10 +24,10 @@ class Alignment(Serialisable): wrap_text: Alias shrinkToFit: Bool[Literal[True]] shrink_to_fit: Alias - indent: MinMax[float, Literal[False]] - relativeIndent: MinMax[float, Literal[False]] + indent: MinMax[FloatInt, Literal[False]] + relativeIndent: MinMax[FloatInt, Literal[False]] justifyLastLine: Bool[Literal[True]] - readingOrder: Min[float, Literal[False]] + readingOrder: Min[FloatInt, Literal[False]] def __init__( self, horizontal=None, diff --git a/stubs/openpyxl/openpyxl/styles/colors.pyi b/stubs/openpyxl/openpyxl/styles/colors.pyi index be92324686c0..822e90b67228 100644 --- a/stubs/openpyxl/openpyxl/styles/colors.pyi +++ b/stubs/openpyxl/openpyxl/styles/colors.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from collections.abc import Iterator from re import Pattern @@ -35,7 +36,7 @@ class Color(Serialisable): indexed: Integer[Literal[False]] auto: Bool[Literal[False]] theme: Integer[Literal[False]] - tint: MinMax[float, Literal[False]] + tint: MinMax[FloatInt, Literal[False]] type: String[Literal[False]] def __init__( self, diff --git a/stubs/openpyxl/openpyxl/styles/fills.pyi b/stubs/openpyxl/openpyxl/styles/fills.pyi index 498f9d1a7c15..05a020279bef 100644 --- a/stubs/openpyxl/openpyxl/styles/fills.pyi +++ b/stubs/openpyxl/openpyxl/styles/fills.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, Incomplete, Unused from collections.abc import Iterable, Iterator, Sequence as ABCSequence from typing import ClassVar, Final, Literal, TypeAlias @@ -83,7 +84,7 @@ DEFAULT_GRAY_FILL: Final[PatternFill] class Stop(Serialisable): tagname: ClassVar[str] - position: MinMax[float, Literal[False]] + position: MinMax[FloatInt, Literal[False]] color: Incomplete def __init__(self, color, position: ConvertibleToFloat) -> None: ... diff --git a/stubs/openpyxl/openpyxl/styles/fonts.pyi b/stubs/openpyxl/openpyxl/styles/fonts.pyi index 48aeeb27d9b3..1f3515b6ece6 100644 --- a/stubs/openpyxl/openpyxl/styles/fonts.pyi +++ b/stubs/openpyxl/openpyxl/styles/fonts.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt from typing import ClassVar, Final, Literal, TypeAlias from typing_extensions import Self @@ -28,7 +29,7 @@ class Font(Serialisable): UNDERLINE_SINGLE_ACCOUNTING: Final = "singleAccounting" name: NestedString[Literal[True]] charset: NestedInteger[Literal[True]] - family: NestedMinMax[float, Literal[True]] + family: NestedMinMax[FloatInt, Literal[True]] sz: NestedFloat[Literal[True]] size: Alias b: NestedBool[Literal[False]] diff --git a/stubs/openpyxl/openpyxl/utils/units.pyi b/stubs/openpyxl/openpyxl/utils/units.pyi index 6a799ed06424..371ee672dbec 100644 --- a/stubs/openpyxl/openpyxl/utils/units.pyi +++ b/stubs/openpyxl/openpyxl/utils/units.pyi @@ -1,11 +1,12 @@ +from _typeshed import FloatInt from typing import Final -DEFAULT_ROW_HEIGHT: Final[float] +DEFAULT_ROW_HEIGHT: Final[FloatInt] BASE_COL_WIDTH: Final = 8 DEFAULT_COLUMN_WIDTH: Final = 13 -DEFAULT_LEFT_MARGIN: Final[float] -DEFAULT_TOP_MARGIN: Final[float] -DEFAULT_HEADER: Final[float] +DEFAULT_LEFT_MARGIN: Final[FloatInt] +DEFAULT_TOP_MARGIN: Final[FloatInt] +DEFAULT_HEADER: Final[FloatInt] def inch_to_dxa(value): ... def dxa_to_inch(value): ... diff --git a/stubs/openpyxl/openpyxl/worksheet/filters.pyi b/stubs/openpyxl/openpyxl/worksheet/filters.pyi index 932b53b604d7..06833df12258 100644 --- a/stubs/openpyxl/openpyxl/worksheet/filters.pyi +++ b/stubs/openpyxl/openpyxl/worksheet/filters.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from datetime import datetime from typing import ClassVar, Final, Literal, TypeAlias, overload @@ -228,10 +229,10 @@ class Top10(Serialisable): class DateGroupItem(Serialisable): tagname: ClassVar[str] year: Integer[Literal[False]] - month: MinMax[float, Literal[True]] - day: MinMax[float, Literal[True]] - hour: MinMax[float, Literal[True]] - minute: MinMax[float, Literal[True]] + month: MinMax[FloatInt, Literal[True]] + day: MinMax[FloatInt, Literal[True]] + hour: MinMax[FloatInt, Literal[True]] + minute: MinMax[FloatInt, Literal[True]] second: Integer[Literal[True]] dateTimeGrouping: Set[_DateGroupItemDateTimeGrouping] diff --git a/stubs/opentracing/opentracing/mocktracer/span.pyi b/stubs/opentracing/opentracing/mocktracer/span.pyi index 229af11b8e16..f171e3bf800c 100644 --- a/stubs/opentracing/opentracing/mocktracer/span.pyi +++ b/stubs/opentracing/opentracing/mocktracer/span.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any from typing_extensions import Self @@ -11,7 +12,7 @@ class MockSpan(Span): start_time: Any parent_id: int | None tags: dict[str, Any] - finish_time: float + finish_time: FloatInt finished: bool logs: list[LogData] def __init__( @@ -21,18 +22,18 @@ class MockSpan(Span): context: SpanContext | None = None, parent_id: int | None = None, tags: dict[str, Any] | None = None, - start_time: float | None = None, + start_time: FloatInt | None = None, ) -> None: ... @property def tracer(self) -> MockTracer: ... @property def context(self) -> SpanContext: ... def set_operation_name(self, operation_name: str) -> Self: ... - def set_tag(self, key: str, value: str | bool | float) -> Self: ... - def log_kv(self, key_values: dict[str, Any], timestamp: float | None = None) -> Self: ... + def set_tag(self, key: str, value: str | bool | FloatInt) -> Self: ... + def log_kv(self, key_values: dict[str, Any], timestamp: FloatInt | None = None) -> Self: ... def set_baggage_item(self, key: str, value: str) -> Self: ... class LogData: key_values: dict[str, Any] - timestamp: float | None - def __init__(self, key_values: dict[str, Any], timestamp: float | None = None) -> None: ... + timestamp: FloatInt | None + def __init__(self, key_values: dict[str, Any], timestamp: FloatInt | None = None) -> None: ... diff --git a/stubs/opentracing/opentracing/mocktracer/tracer.pyi b/stubs/opentracing/opentracing/mocktracer/tracer.pyi index 46d12c48fb90..a4e1ea8456dd 100644 --- a/stubs/opentracing/opentracing/mocktracer/tracer.pyi +++ b/stubs/opentracing/opentracing/mocktracer/tracer.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any from ..scope_manager import ScopeManager @@ -20,7 +21,7 @@ class MockTracer(Tracer): child_of: Span | SpanContext | None = None, references: list[Reference] | None = None, tags: dict[Any, Any] | None = None, - start_time: float | None = None, + start_time: FloatInt | None = None, ignore_active_span: bool = False, ) -> MockSpan: ... def extract(self, format: str, carrier: dict[Any, Any]) -> SpanContext: ... diff --git a/stubs/opentracing/opentracing/span.pyi b/stubs/opentracing/opentracing/span.pyi index dd9bff361ef7..9e6ae20e9704 100644 --- a/stubs/opentracing/opentracing/span.pyi +++ b/stubs/opentracing/opentracing/span.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from types import TracebackType from typing import Any from typing_extensions import Self @@ -16,9 +17,9 @@ class Span: @property def tracer(self) -> Tracer: ... def set_operation_name(self, operation_name: str) -> Self: ... - def finish(self, finish_time: float | None = None) -> None: ... - def set_tag(self, key: str, value: str | bool | float) -> Self: ... - def log_kv(self, key_values: dict[str, Any], timestamp: float | None = None) -> Self: ... + def finish(self, finish_time: FloatInt | None = None) -> None: ... + def set_tag(self, key: str, value: str | bool | FloatInt) -> Self: ... + def log_kv(self, key_values: dict[str, Any], timestamp: FloatInt | None = None) -> Self: ... def set_baggage_item(self, key: str, value: str) -> Self: ... def get_baggage_item(self, key: str) -> str | None: ... def __enter__(self) -> Self: ... diff --git a/stubs/opentracing/opentracing/tracer.pyi b/stubs/opentracing/opentracing/tracer.pyi index 275b9d7f682d..be146e629524 100644 --- a/stubs/opentracing/opentracing/tracer.pyi +++ b/stubs/opentracing/opentracing/tracer.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any, NamedTuple from .scope import Scope @@ -16,7 +17,7 @@ class Tracer: child_of: Span | SpanContext | None = None, references: list[Reference] | None = None, tags: dict[Any, Any] | None = None, - start_time: float | None = None, + start_time: FloatInt | None = None, ignore_active_span: bool = False, finish_on_close: bool = True, ) -> Scope: ... @@ -26,7 +27,7 @@ class Tracer: child_of: Span | SpanContext | None = None, references: list[Reference] | None = None, tags: dict[Any, Any] | None = None, - start_time: float | None = None, + start_time: FloatInt | None = None, ignore_active_span: bool = False, ) -> Span: ... def inject(self, span_context: SpanContext, format: str, carrier: dict[Any, Any]) -> None: ... @@ -43,5 +44,5 @@ class Reference(NamedTuple): def child_of(referenced_context: SpanContext | None = None) -> Reference: ... def follows_from(referenced_context: SpanContext | None = None) -> Reference: ... def start_child_span( - parent_span: Span, operation_name: str, tags: dict[Any, Any] | None = None, start_time: float | None = None + parent_span: Span, operation_name: str, tags: dict[Any, Any] | None = None, start_time: FloatInt | None = None ) -> Span: ... diff --git a/stubs/paramiko/paramiko/buffered_pipe.pyi b/stubs/paramiko/paramiko/buffered_pipe.pyi index 558df9d30549..326be3987e72 100644 --- a/stubs/paramiko/paramiko/buffered_pipe.pyi +++ b/stubs/paramiko/paramiko/buffered_pipe.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from threading import Event from typing import AnyStr, Generic @@ -8,7 +9,7 @@ class BufferedPipe(Generic[AnyStr]): def set_event(self, event: Event) -> None: ... def feed(self, data: AnyStr) -> None: ... def read_ready(self) -> bool: ... - def read(self, nbytes: int, timeout: float | None = None) -> AnyStr: ... + def read(self, nbytes: int, timeout: FloatInt | None = None) -> AnyStr: ... def empty(self) -> AnyStr: ... def close(self) -> None: ... def __len__(self) -> int: ... diff --git a/stubs/paramiko/paramiko/channel.pyi b/stubs/paramiko/paramiko/channel.pyi index 0d8482db0556..0bdf5f7035b7 100644 --- a/stubs/paramiko/paramiko/channel.pyi +++ b/stubs/paramiko/paramiko/channel.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsItems from collections.abc import Callable from logging import Logger @@ -23,7 +24,7 @@ class Channel(ClosingContextManager): eof_sent: int in_buffer: BufferedPipe[Any] in_stderr_buffer: BufferedPipe[Any] - timeout: float | None + timeout: FloatInt | None closed: bool ultra_debug: bool lock: Lock @@ -69,7 +70,7 @@ class Channel(ClosingContextManager): def get_name(self) -> str: ... def get_id(self) -> int: ... def set_combine_stderr(self, combine: bool) -> bool: ... - def settimeout(self, timeout: float | None) -> None: ... + def settimeout(self, timeout: FloatInt | None) -> None: ... def gettimeout(self) -> float | None: ... def setblocking(self, blocking: bool | Literal[0, 1]) -> None: ... def getpeername(self) -> str: ... diff --git a/stubs/paramiko/paramiko/client.pyi b/stubs/paramiko/paramiko/client.pyi index b020f823fa83..283ec7d360a4 100644 --- a/stubs/paramiko/paramiko/client.pyi +++ b/stubs/paramiko/paramiko/client.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptorOrPath from collections.abc import Iterable, Mapping from typing import Protocol, type_check_only @@ -39,14 +40,14 @@ class SSHClient(ClosingContextManager): password: str | None = None, pkey: PKey | None = None, key_filename: str | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, allow_agent: bool = True, look_for_keys: bool = True, compress: bool = False, sock: _SocketLike | None = None, - banner_timeout: float | None = None, - auth_timeout: float | None = None, - channel_timeout: float | None = None, + banner_timeout: FloatInt | None = None, + auth_timeout: FloatInt | None = None, + channel_timeout: FloatInt | None = None, passphrase: str | None = None, disabled_algorithms: Mapping[str, Iterable[str]] | None = None, transport_factory: _TransportFactory | None = None, @@ -57,7 +58,7 @@ class SSHClient(ClosingContextManager): self, command: str, bufsize: int = -1, - timeout: float | None = None, + timeout: FloatInt | None = None, get_pty: bool = False, environment: Mapping[str, str] | None = None, ) -> tuple[ChannelStdinFile, ChannelFile, ChannelStderrFile]: ... diff --git a/stubs/paramiko/paramiko/common.pyi b/stubs/paramiko/paramiko/common.pyi index abe1a14e7fee..285cec219451 100644 --- a/stubs/paramiko/paramiko/common.pyi +++ b/stubs/paramiko/paramiko/common.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging from typing import Final @@ -123,7 +124,7 @@ WARNING = logging.WARNING ERROR = logging.ERROR CRITICAL = logging.CRITICAL -io_sleep: float +io_sleep: FloatInt DEFAULT_WINDOW_SIZE: Final[int] DEFAULT_MAX_PACKET_SIZE: Final[int] diff --git a/stubs/paramiko/paramiko/packet.pyi b/stubs/paramiko/paramiko/packet.pyi index 1dce422c6b2b..d93b254ffb7c 100644 --- a/stubs/paramiko/paramiko/packet.pyi +++ b/stubs/paramiko/paramiko/packet.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer from collections.abc import Callable from hashlib import _Hash @@ -57,13 +58,13 @@ class Packetizer: def get_mac_size_in(self) -> int: ... def get_mac_size_out(self) -> int: ... def need_rekey(self) -> bool: ... - def set_keepalive(self, interval: float, callback: Callable[[], object]) -> None: ... + def set_keepalive(self, interval: FloatInt, callback: Callable[[], object]) -> None: ... def read_timer(self) -> None: ... - def start_handshake(self, timeout: float) -> None: ... + def start_handshake(self, timeout: FloatInt) -> None: ... def handshake_timed_out(self) -> bool: ... def complete_handshake(self) -> None: ... def read_all(self, n: int, check_rekey: bool = False) -> bytes: ... def write_all(self, out: ReadableBuffer) -> None: ... - def readline(self, timeout: float) -> str: ... + def readline(self, timeout: FloatInt) -> str: ... def send_message(self, data: Message) -> None: ... def read_message(self) -> tuple[int, Message]: ... diff --git a/stubs/paramiko/paramiko/proxy.pyi b/stubs/paramiko/paramiko/proxy.pyi index c22af8eb32d8..b3eae8947db3 100644 --- a/stubs/paramiko/paramiko/proxy.pyi +++ b/stubs/paramiko/paramiko/proxy.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ReadableBuffer from subprocess import Popen from typing import Any @@ -9,11 +10,11 @@ subprocess_import_error: ImportError | None class ProxyCommand(ClosingContextManager): cmd: list[str] process: Popen[Any] - timeout: float | None + timeout: FloatInt | None def __init__(self, command_line: str) -> None: ... def send(self, content: ReadableBuffer) -> int: ... def recv(self, size: int) -> bytes: ... def close(self) -> None: ... @property def closed(self) -> bool: ... - def settimeout(self, timeout: float) -> None: ... + def settimeout(self, timeout: FloatInt) -> None: ... diff --git a/stubs/paramiko/paramiko/sftp_client.pyi b/stubs/paramiko/paramiko/sftp_client.pyi index f7876c243b9a..0a0ede9ac5f0 100644 --- a/stubs/paramiko/paramiko/sftp_client.pyi +++ b/stubs/paramiko/paramiko/sftp_client.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import StrOrBytesPath from collections.abc import Callable, Iterator from logging import Logger @@ -41,7 +42,7 @@ class SFTPClient(BaseSFTP, ClosingContextManager): def symlink(self, source: bytes | str, dest: bytes | str) -> None: ... def chmod(self, path: bytes | str, mode: int) -> None: ... def chown(self, path: bytes | str, uid: int, gid: int) -> None: ... - def utime(self, path: bytes | str, times: tuple[float, float] | None) -> None: ... + def utime(self, path: bytes | str, times: tuple[FloatInt, FloatInt] | None) -> None: ... def truncate(self, path: bytes | str, size: int) -> None: ... def readlink(self, path: bytes | str) -> str | None: ... def normalize(self, path: bytes | str) -> str: ... diff --git a/stubs/paramiko/paramiko/sftp_file.pyi b/stubs/paramiko/paramiko/sftp_file.pyi index 56a740e06afe..fb72bbdd4e32 100644 --- a/stubs/paramiko/paramiko/sftp_file.pyi +++ b/stubs/paramiko/paramiko/sftp_file.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterator, Sequence from typing import Any @@ -15,7 +16,7 @@ class SFTPFile(BufferedFile[Any]): def __init__(self, sftp: SFTPClient, handle: _LikeBytes, mode: str = "r", bufsize: int = -1) -> None: ... def __del__(self) -> None: ... def close(self) -> None: ... - def settimeout(self, timeout: float) -> None: ... + def settimeout(self, timeout: FloatInt) -> None: ... def gettimeout(self) -> float: ... def setblocking(self, blocking: bool) -> None: ... def seekable(self) -> bool: ... @@ -23,7 +24,7 @@ class SFTPFile(BufferedFile[Any]): def stat(self) -> SFTPAttributes: ... def chmod(self, mode: int) -> None: ... def chown(self, uid: int, gid: int) -> None: ... - def utime(self, times: tuple[float, float] | None) -> None: ... + def utime(self, times: tuple[FloatInt, FloatInt] | None) -> None: ... def truncate(self, size: int) -> None: ... def check(self, hash_algorithm: str, offset: int = 0, length: int = 0, block_size: int = 0) -> bytes: ... def set_pipelined(self, pipelined: bool = True) -> None: ... diff --git a/stubs/paramiko/paramiko/transport.pyi b/stubs/paramiko/paramiko/transport.pyi index 0e623d36b172..5b46f586194f 100644 --- a/stubs/paramiko/paramiko/transport.pyi +++ b/stubs/paramiko/paramiko/transport.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptorOrPath from collections.abc import Callable, Iterable, Mapping, Sequence from logging import Logger @@ -55,16 +56,16 @@ class Transport(Thread, ClosingContextManager): saved_exception: Exception | None clear_to_send: Event clear_to_send_lock: Lock - clear_to_send_timeout: float + clear_to_send_timeout: FloatInt log_name: str logger: Logger auth_handler: AuthHandler | None global_response: Message | None completion_event: Event | None - banner_timeout: float - handshake_timeout: float - auth_timeout: float - channel_timeout: float + banner_timeout: FloatInt + handshake_timeout: FloatInt + auth_timeout: FloatInt + channel_timeout: FloatInt disabled_algorithms: Mapping[str, Iterable[str]] | None server_sig_algs: bool @@ -99,7 +100,7 @@ class Transport(Thread, ClosingContextManager): def preferred_compression(self) -> Sequence[str]: ... def atfork(self) -> None: ... def get_security_options(self) -> SecurityOptions: ... - def start_client(self, event: Event | None = None, timeout: float | None = None) -> None: ... + def start_client(self, event: Event | None = None, timeout: FloatInt | None = None) -> None: ... def start_server(self, event: Event | None = None, server: ServerInterface | None = None) -> None: ... def add_server_key(self, key: PKey) -> None: ... def get_server_key(self) -> PKey | None: ... @@ -109,7 +110,7 @@ class Transport(Thread, ClosingContextManager): def get_remote_server_key(self) -> PKey: ... def is_active(self) -> bool: ... def open_session( - self, window_size: int | None = None, max_packet_size: int | None = None, timeout: float | None = None + self, window_size: int | None = None, max_packet_size: int | None = None, timeout: FloatInt | None = None ) -> Channel: ... def open_x11_channel(self, src_addr: _Addr | None = None) -> Channel: ... def open_forward_agent_channel(self) -> Channel: ... @@ -121,7 +122,7 @@ class Transport(Thread, ClosingContextManager): src_addr: _Addr | None = None, window_size: int | None = None, max_packet_size: int | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> Channel: ... def request_port_forward( self, address: str, port: int, handler: Callable[[Channel, _Addr, _Addr], object] | None = None @@ -130,9 +131,9 @@ class Transport(Thread, ClosingContextManager): def open_sftp_client(self) -> SFTPClient: ... def send_ignore(self, byte_count: int | None = None) -> None: ... def renegotiate_keys(self) -> None: ... - def set_keepalive(self, interval: float) -> None: ... + def set_keepalive(self, interval: FloatInt) -> None: ... def global_request(self, kind: str, data: Iterable[Any] | None = None, wait: bool = True) -> Message | None: ... - def accept(self, timeout: float | None = None) -> Channel | None: ... + def accept(self, timeout: FloatInt | None = None) -> Channel | None: ... def connect( self, hostkey: PKey | None = None, username: str = "", password: str | None = None, pkey: PKey | None = None ) -> None: ... diff --git a/stubs/parsimonious/parsimonious/expressions.pyi b/stubs/parsimonious/parsimonious/expressions.pyi index 514768f57b5a..f17da85038ab 100644 --- a/stubs/parsimonious/parsimonious/expressions.pyi +++ b/stubs/parsimonious/parsimonious/expressions.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import collections.abc from collections.abc import Callable, Mapping from re import Pattern @@ -74,8 +75,8 @@ def Not(term: Expression) -> Lookahead: ... class Quantifier(Compound): __slots__ = ["min", "max"] min: int - max: float - def __init__(self, member: Expression, *, min: int = 0, max: float = ..., name: str = "", **kwargs: Any) -> None: ... + max: FloatInt + def __init__(self, member: Expression, *, min: int = 0, max: FloatInt = ..., name: str = "", **kwargs: Any) -> None: ... def ZeroOrMore(member: Expression, name: str = "") -> Quantifier: ... def OneOrMore(member: Expression, name: str = "", min: int = 1) -> Quantifier: ... diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi index 817ad6e5df1d..b8cd08e556c8 100644 --- a/stubs/peewee/peewee.pyi +++ b/stubs/peewee/peewee.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re import threading from _typeshed import Incomplete, SupportsKeysAndGetItem @@ -794,7 +795,7 @@ class ViewMetadata(NamedTuple): class QueryEvent(NamedTuple): sql: str params: Incomplete - duration: float + duration: FloatInt exception: BaseException | None class _ConnectionState: diff --git a/stubs/pexpect/pexpect/_async.pyi b/stubs/pexpect/pexpect/_async.pyi index 18daf19911dd..3ef7f209566b 100644 --- a/stubs/pexpect/pexpect/_async.pyi +++ b/stubs/pexpect/pexpect/_async.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt import asyncio from typing import AnyStr, Generic from .expect import Expecter -async def expect_async(expecter: Expecter[AnyStr], timeout: float | None = None) -> int: ... -async def repl_run_command_async(repl, cmdlines, timeout: float | None = -1): ... +async def expect_async(expecter: Expecter[AnyStr], timeout: FloatInt | None = None) -> int: ... +async def repl_run_command_async(repl, cmdlines, timeout: FloatInt | None = -1): ... class PatternWaiter(asyncio.Protocol, Generic[AnyStr]): transport: asyncio.ReadTransport | None diff --git a/stubs/pexpect/pexpect/expect.pyi b/stubs/pexpect/pexpect/expect.pyi index ec9c29b52f17..ebbf7b2dbe5f 100644 --- a/stubs/pexpect/pexpect/expect.pyi +++ b/stubs/pexpect/pexpect/expect.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re from collections.abc import Iterable from typing import AnyStr, Generic @@ -35,4 +36,4 @@ class Expecter(Generic[AnyStr]): def eof(self, err: object = None) -> int: ... def timeout(self, err: object = None) -> int: ... def errored(self) -> None: ... - def expect_loop(self, timeout: float | None = -1) -> int: ... + def expect_loop(self, timeout: FloatInt | None = -1) -> int: ... diff --git a/stubs/pexpect/pexpect/fdpexpect.pyi b/stubs/pexpect/pexpect/fdpexpect.pyi index 31a6a0a71ac3..93abd6201b34 100644 --- a/stubs/pexpect/pexpect/fdpexpect.pyi +++ b/stubs/pexpect/pexpect/fdpexpect.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptorLike from collections.abc import Iterable from typing import AnyStr @@ -18,7 +19,7 @@ class fdspawn(SpawnBase[AnyStr]): self, fd: FileDescriptorLike, args: None = None, - timeout: float | None = 30, + timeout: FloatInt | None = 30, maxread: int = 2000, searchwindowsize: int | None = None, logfile: _Logfile | None = None, @@ -33,4 +34,4 @@ class fdspawn(SpawnBase[AnyStr]): def sendline(self, s: str | bytes) -> int: ... def write(self, s) -> None: ... def writelines(self, sequence: Iterable[str | bytes]) -> None: ... - def read_nonblocking(self, size: int = 1, timeout: float | None = -1) -> AnyStr: ... + def read_nonblocking(self, size: int = 1, timeout: FloatInt | None = -1) -> AnyStr: ... diff --git a/stubs/pexpect/pexpect/popen_spawn.pyi b/stubs/pexpect/pexpect/popen_spawn.pyi index 601595a9d00c..5ea4696f758e 100644 --- a/stubs/pexpect/pexpect/popen_spawn.pyi +++ b/stubs/pexpect/pexpect/popen_spawn.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import subprocess from _typeshed import StrOrBytesPath from collections.abc import Callable @@ -11,7 +12,7 @@ class PopenSpawn(SpawnBase[AnyStr]): def __init__( self, cmd, - timeout: float | None = 30, + timeout: FloatInt | None = 30, maxread: int = 2000, searchwindowsize: int | None = None, logfile: _Logfile | None = None, diff --git a/stubs/pexpect/pexpect/pty_spawn.pyi b/stubs/pexpect/pexpect/pty_spawn.pyi index 879915556e35..1502fd24e646 100644 --- a/stubs/pexpect/pexpect/pty_spawn.pyi +++ b/stubs/pexpect/pexpect/pty_spawn.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptorOrPath from collections.abc import Callable, Mapping from typing import AnyStr @@ -24,7 +25,7 @@ class spawn(SpawnBase[AnyStr]): self, command: str, args: list[str] = [], - timeout: float | None = 30, + timeout: FloatInt | None = 30, maxread: int = 2000, searchwindowsize: int | None = None, logfile: _Logfile | None = None, @@ -42,10 +43,10 @@ class spawn(SpawnBase[AnyStr]): closed: bool def close(self, force: bool = True) -> None: ... def isatty(self) -> bool: ... - def waitnoecho(self, timeout: float | None = -1) -> None: ... + def waitnoecho(self, timeout: FloatInt | None = -1) -> None: ... def getecho(self) -> bool: ... def setecho(self, state: bool) -> None: ... - def read_nonblocking(self, size: int = 1, timeout: float | None = -1) -> AnyStr: ... + def read_nonblocking(self, size: int = 1, timeout: FloatInt | None = -1) -> AnyStr: ... def write(self, s: str | bytes) -> None: ... def writelines(self, sequence: list[str | bytes]) -> None: ... def send(self, s: str | bytes) -> int: ... @@ -80,7 +81,7 @@ class spawn(SpawnBase[AnyStr]): def spawnu( command: str, args: list[str] = [], - timeout: float | None = 30, + timeout: FloatInt | None = 30, maxread: int = 2000, searchwindowsize: int | None = None, logfile: _Logfile | None = None, diff --git a/stubs/pexpect/pexpect/pxssh.pyi b/stubs/pexpect/pexpect/pxssh.pyi index 2904e0ab628b..1a35266fb8ab 100644 --- a/stubs/pexpect/pexpect/pxssh.pyi +++ b/stubs/pexpect/pexpect/pxssh.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptorOrPath from collections.abc import Mapping from typing import AnyStr, Literal @@ -23,7 +24,7 @@ class pxssh(spawn[AnyStr]): options: dict[str, str] def __init__( self, - timeout: float | None = 30, + timeout: FloatInt | None = 30, maxread: int = 2000, searchwindowsize: int | None = None, logfile: _Logfile | None = None, @@ -39,7 +40,7 @@ class pxssh(spawn[AnyStr]): ) -> None: ... def levenshtein_distance(self, a, b): ... def try_read_prompt(self, timeout_multiplier): ... - def sync_original_prompt(self, sync_multiplier: float = 1.0): ... + def sync_original_prompt(self, sync_multiplier: FloatInt = 1.0): ... def login( self, server, @@ -47,7 +48,7 @@ class pxssh(spawn[AnyStr]): password: str = "", terminal_type: str = "ansi", original_prompt: str = "[#$]", - login_timeout: float | None = 10, + login_timeout: FloatInt | None = 10, port: int | None = None, auto_prompt_reset: bool = True, ssh_key: FileDescriptorOrPath | Literal[True] | None = None, @@ -62,5 +63,5 @@ class pxssh(spawn[AnyStr]): cmd: str = "ssh", ): ... def logout(self) -> None: ... - def prompt(self, timeout: float | None = -1): ... + def prompt(self, timeout: FloatInt | None = -1): ... def set_unique_prompt(self): ... diff --git a/stubs/pexpect/pexpect/replwrap.pyi b/stubs/pexpect/pexpect/replwrap.pyi index 1ef0a541ff8c..1b1c8ade32d9 100644 --- a/stubs/pexpect/pexpect/replwrap.pyi +++ b/stubs/pexpect/pexpect/replwrap.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import Incomplete @@ -20,7 +21,7 @@ class REPLWrapper: extra_init_cmd=None, ) -> None: ... def set_prompt(self, orig_prompt, prompt_change) -> None: ... - def run_command(self, command, timeout: float | None = -1, async_: bool = False): ... + def run_command(self, command, timeout: FloatInt | None = -1, async_: bool = False): ... def python(command: str = sys.executable): ... def bash(command: str = "bash"): ... diff --git a/stubs/pexpect/pexpect/run.pyi b/stubs/pexpect/pexpect/run.pyi index b3b0a0b546ad..09978570bd35 100644 --- a/stubs/pexpect/pexpect/run.pyi +++ b/stubs/pexpect/pexpect/run.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import FileDescriptorOrPath from collections.abc import Mapping from typing import AnyStr @@ -6,7 +7,7 @@ from .spawnbase import _InputRePattern, _Logfile def run( command: str, - timeout: float | None = 30, + timeout: FloatInt | None = 30, withexitstatus: bool = False, events: list[tuple[_InputRePattern, AnyStr]] | dict[_InputRePattern, AnyStr] | None = None, extra_args: None = None, @@ -17,7 +18,7 @@ def run( ) -> AnyStr | tuple[AnyStr, int]: ... def runu( command: str, - timeout: float | None = 30, + timeout: FloatInt | None = 30, withexitstatus: bool = False, events: list[tuple[_InputRePattern, AnyStr]] | dict[_InputRePattern, AnyStr] | None = None, extra_args: None = None, diff --git a/stubs/pexpect/pexpect/socket_pexpect.pyi b/stubs/pexpect/pexpect/socket_pexpect.pyi index f3c8d42d0b56..ab894a575496 100644 --- a/stubs/pexpect/pexpect/socket_pexpect.pyi +++ b/stubs/pexpect/pexpect/socket_pexpect.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from socket import socket as Socket from typing import AnyStr @@ -18,7 +19,7 @@ class SocketSpawn(SpawnBase[AnyStr]): self, socket: Socket, args: None = None, - timeout: float | None = 30, + timeout: FloatInt | None = 30, maxread: int = 2000, searchwindowsize: int | None = None, logfile: _Logfile | None = None, @@ -32,4 +33,4 @@ class SocketSpawn(SpawnBase[AnyStr]): def sendline(self, s: str | bytes) -> int: ... def write(self, s: str | bytes) -> None: ... def writelines(self, sequence: Iterable[str | bytes]) -> None: ... - def read_nonblocking(self, size: int = 1, timeout: float | None = -1) -> AnyStr: ... + def read_nonblocking(self, size: int = 1, timeout: FloatInt | None = -1) -> AnyStr: ... diff --git a/stubs/pexpect/pexpect/spawnbase.pyi b/stubs/pexpect/pexpect/spawnbase.pyi index d839fddd57f9..5ad178ad9e5e 100644 --- a/stubs/pexpect/pexpect/spawnbase.pyi +++ b/stubs/pexpect/pexpect/spawnbase.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from asyncio import ReadTransport from collections.abc import Awaitable, Callable, Iterable from re import Match, Pattern @@ -46,17 +47,17 @@ class SpawnBase(Generic[AnyStr]): signalstatus: int | None status: int | None child_fd: int - timeout: float | None + timeout: FloatInt | None delimiter: type[EOF] logfile: _Logfile | None logfile_read: _Logfile | None logfile_send: _Logfile | None maxread: int searchwindowsize: int | None - delaybeforesend: float | None - delayafterclose: float - delayafterterminate: float - delayafterread: float | None + delaybeforesend: FloatInt | None + delayafterclose: FloatInt + delayafterterminate: FloatInt + delayafterread: FloatInt | None softspace: bool name: str closed: bool @@ -70,7 +71,7 @@ class SpawnBase(Generic[AnyStr]): async_pw_transport: tuple[PatternWaiter[AnyStr], ReadTransport] | None def __init__( self, - timeout: float | None = 30, + timeout: FloatInt | None = 30, maxread: int = 2000, searchwindowsize: int | None = None, logfile: _Logfile | None = None, @@ -83,14 +84,14 @@ class SpawnBase(Generic[AnyStr]): @buffer.setter def buffer(self, value: AnyStr) -> None: ... - def read_nonblocking(self, size: int = 1, timeout: float | None = None) -> AnyStr: ... + def read_nonblocking(self, size: int = 1, timeout: FloatInt | None = None) -> AnyStr: ... def compile_pattern_list(self, patterns: _InputRePattern | list[_InputRePattern]) -> list[_CompiledRePattern[AnyStr]]: ... @overload def expect( self, pattern: _InputRePattern | list[_InputRePattern], - timeout: float | None = -1, + timeout: FloatInt | None = -1, searchwindowsize: int | None = -1, async_: Literal[False] = False, ) -> int: ... @@ -98,7 +99,7 @@ class SpawnBase(Generic[AnyStr]): def expect( self, pattern: _InputRePattern | list[_InputRePattern], - timeout: float | None = -1, + timeout: FloatInt | None = -1, searchwindowsize: int | None = -1, *, async_: Literal[True], @@ -108,7 +109,7 @@ class SpawnBase(Generic[AnyStr]): def expect_list( self, pattern_list: list[_CompiledRePattern[AnyStr]], - timeout: float | None = -1, + timeout: FloatInt | None = -1, searchwindowsize: int | None = -1, async_: Literal[False] = False, ) -> int: ... @@ -116,7 +117,7 @@ class SpawnBase(Generic[AnyStr]): def expect_list( self, pattern_list: list[_CompiledRePattern[AnyStr]], - timeout: float | None = -1, + timeout: FloatInt | None = -1, searchwindowsize: int | None = -1, *, async_: Literal[True], @@ -126,7 +127,7 @@ class SpawnBase(Generic[AnyStr]): def expect_exact( self, pattern_list: _InputStringPattern | Iterable[_InputStringPattern], - timeout: float | None = -1, + timeout: FloatInt | None = -1, searchwindowsize: int | None = -1, async_: Literal[False] = False, ) -> int: ... @@ -134,13 +135,13 @@ class SpawnBase(Generic[AnyStr]): def expect_exact( self, pattern_list: _InputStringPattern | Iterable[_InputStringPattern], - timeout: float | None = -1, + timeout: FloatInt | None = -1, searchwindowsize: int | None = -1, *, async_: Literal[True], ) -> Awaitable[int]: ... - def expect_loop(self, searcher: _Searcher[AnyStr], timeout: float | None = -1, searchwindowsize: int | None = -1) -> int: ... + def expect_loop(self, searcher: _Searcher[AnyStr], timeout: FloatInt | None = -1, searchwindowsize: int | None = -1) -> int: ... def read(self, size: int = -1) -> AnyStr: ... def readline(self, size: int = -1) -> AnyStr: ... def __iter__(self): ... diff --git a/stubs/pexpect/pexpect/utils.pyi b/stubs/pexpect/pexpect/utils.pyi index 29fd1ae2b2cd..f27582c6b75a 100644 --- a/stubs/pexpect/pexpect/utils.pyi +++ b/stubs/pexpect/pexpect/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Mapping InterruptedError: type @@ -6,5 +7,5 @@ string_types: tuple[type, ...] def is_executable_file(path): ... def which(filename, env: Mapping[str, str] | None = None): ... def split_command_line(command_line): ... -def select_ignore_interrupts(iwtd, owtd, ewtd, timeout: float | None = None): ... -def poll_ignore_interrupts(fds, timeout: float | None = None): ... +def select_ignore_interrupts(iwtd, owtd, ewtd, timeout: FloatInt | None = None): ... +def poll_ignore_interrupts(fds, timeout: FloatInt | None = None): ... diff --git a/stubs/pika/pika/adapters/asyncio_connection.pyi b/stubs/pika/pika/adapters/asyncio_connection.pyi index b4f5b7d3b656..01f640fd0783 100644 --- a/stubs/pika/pika/adapters/asyncio_connection.pyi +++ b/stubs/pika/pika/adapters/asyncio_connection.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import asyncio from _typeshed import Incomplete from collections.abc import Callable, Sequence @@ -48,7 +49,7 @@ class _AsyncioIOServicesAdapter( def run(self) -> None: ... def stop(self) -> None: ... def add_callback_threadsafe(self, callback: Callable[[], object]) -> None: ... - def call_later(self, delay: float, callback: Callable[[], object]) -> _TimerHandle: ... + def call_later(self, delay: FloatInt, callback: Callable[[], object]) -> _TimerHandle: ... def getaddrinfo( self, host: str | bytes | None, diff --git a/stubs/pika/pika/adapters/blocking_connection.pyi b/stubs/pika/pika/adapters/blocking_connection.pyi index 5dd25332bacb..ec4c8bdad001 100644 --- a/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/stubs/pika/pika/adapters/blocking_connection.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections import deque from collections.abc import Callable, Generator, Mapping, Sequence @@ -18,7 +19,7 @@ T = TypeVar("T", bound=Connection.Blocked | Connection.Unblocked) # noqa: Y001 LOGGER: Logger class _IoloopTimerContext: - def __init__(self, duration: float, connection: SelectConnection) -> None: ... + def __init__(self, duration: FloatInt, connection: SelectConnection) -> None: ... def __enter__(self) -> Self: ... def __exit__( self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None @@ -55,13 +56,13 @@ class BlockingConnection: def add_on_connection_unblocked_callback( self, callback: Callable[[connection.Connection, Method[Connection.Unblocked]], None] ) -> None: ... - def call_later(self, delay: float, callback: Callable[[], None]) -> object: ... + def call_later(self, delay: FloatInt, callback: Callable[[], None]) -> object: ... def add_callback_threadsafe(self, callback: Callable[..., None]) -> None: ... def remove_timeout(self, timeout_id: object) -> None: ... def update_secret(self, new_secret: str, reason: str) -> None: ... def close(self, reply_code: int = 200, reply_text: str = "Normal shutdown") -> None: ... - def process_data_events(self, time_limit: float | None = 0) -> None: ... - def sleep(self, duration: float) -> None: ... + def process_data_events(self, time_limit: FloatInt | None = 0) -> None: ... + def sleep(self, duration: FloatInt) -> None: ... def channel(self, channel_number: int | None = None) -> BlockingChannel: ... @property def is_closed(self) -> bool: ... @@ -220,7 +221,7 @@ class BlockingChannel: auto_ack: bool = False, exclusive: bool = False, arguments: Mapping[str, Incomplete] | None = None, - inactivity_timeout: float = ..., # different between overloads + inactivity_timeout: FloatInt = ..., # different between overloads consumer_tag: str | None = None, ) -> Generator[tuple[Basic.Deliver, BasicProperties, bytes] | tuple[None, None, None]]: ... diff --git a/stubs/pika/pika/adapters/gevent_connection.pyi b/stubs/pika/pika/adapters/gevent_connection.pyi index 995579bf4991..10c5ae2aa9a0 100644 --- a/stubs/pika/pika/adapters/gevent_connection.pyi +++ b/stubs/pika/pika/adapters/gevent_connection.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Sequence from logging import Logger from typing import Final @@ -48,7 +49,7 @@ class _GeventSelectorIOLoop(AbstractSelectorIOLoop[_TimerWatcher]): def start(self) -> None: ... def stop(self) -> None: ... def add_callback(self, callback: Callable[[], object]) -> None: ... - def call_later(self, delay: float, callback: Callable[[], object]) -> _TimerWatcher: ... + def call_later(self, delay: FloatInt, callback: Callable[[], object]) -> _TimerWatcher: ... def remove_timeout(self, timeout_handle: _TimerWatcher) -> None: ... def add_handler(self, fd: int, handler: Callable[[int, int], None], events: int) -> None: ... def update_handler(self, fd: int, events: int) -> None: ... diff --git a/stubs/pika/pika/adapters/select_connection.pyi b/stubs/pika/pika/adapters/select_connection.pyi index 09d88fde568b..637345e7681f 100644 --- a/stubs/pika/pika/adapters/select_connection.pyi +++ b/stubs/pika/pika/adapters/select_connection.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc import select from collections.abc import Callable, Sequence @@ -42,9 +43,9 @@ class SelectConnection(BaseConnection[IOLoop]): class _Timeout: __slots__ = ("deadline", "callback") - deadline: float + deadline: FloatInt callback: Callable[[], None] - def __init__(self, deadline: float, callback: Callable[[], None]) -> None: ... + def __init__(self, deadline: FloatInt, callback: Callable[[], None]) -> None: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... def __lt__(self, other: object) -> bool: ... @@ -55,7 +56,7 @@ class _Timeout: class _Timer: def __init__(self) -> None: ... def close(self) -> None: ... - def call_later(self, delay: float, callback: Callable[[], None]) -> _Timeout: ... + def call_later(self, delay: FloatInt, callback: Callable[[], None]) -> _Timeout: ... def remove_timeout(self, timeout: _Timeout) -> None: ... def get_remaining_interval(self) -> float | None: ... def process_timeouts(self) -> None: ... @@ -72,7 +73,7 @@ class IOLoop(AbstractSelectorIOLoop[_Timeout]): ERROR: Final[int] def __init__(self) -> None: ... def close(self) -> None: ... - def call_later(self, delay: float, callback: Callable[[], object]) -> _Timeout: ... + def call_later(self, delay: FloatInt, callback: Callable[[], object]) -> _Timeout: ... def remove_timeout(self, timeout_handle: _Timeout) -> None: ... def add_callback_threadsafe(self, callback: Callable[[], object]) -> None: ... add_callback = add_callback_threadsafe diff --git a/stubs/pika/pika/adapters/utils/nbio_interface.pyi b/stubs/pika/pika/adapters/utils/nbio_interface.pyi index 6b963642813e..6a63490f734d 100644 --- a/stubs/pika/pika/adapters/utils/nbio_interface.pyi +++ b/stubs/pika/pika/adapters/utils/nbio_interface.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc from collections.abc import Callable from socket import socket @@ -17,7 +18,7 @@ class AbstractIOServices(pika.compat.AbstractBase, metaclass=abc.ABCMeta): @abc.abstractmethod def add_callback_threadsafe(self, callback: Callable[..., None]) -> None: ... @abc.abstractmethod - def call_later(self, delay: float, callback: Callable[..., None]) -> AbstractTimerReference: ... + def call_later(self, delay: FloatInt, callback: Callable[..., None]) -> AbstractTimerReference: ... @abc.abstractmethod def getaddrinfo( self, diff --git a/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi b/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi index 020017eacaf4..5a1019d8c954 100644 --- a/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi +++ b/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc from collections.abc import Callable from logging import Logger @@ -30,7 +31,7 @@ class AbstractSelectorIOLoop(Generic[_Timeout], metaclass=abc.ABCMeta): @abc.abstractmethod def stop(self) -> None: ... @abc.abstractmethod - def call_later(self, delay: float, callback: Callable[[], object]) -> _Timeout: ... + def call_later(self, delay: FloatInt, callback: Callable[[], object]) -> _Timeout: ... @abc.abstractmethod def remove_timeout(self, timeout_handle: _Timeout) -> None: ... @abc.abstractmethod @@ -55,7 +56,7 @@ class SelectorIOServicesAdapter( def run(self) -> None: ... def stop(self) -> None: ... def add_callback_threadsafe(self, callback: Callable[[], None]) -> None: ... - def call_later(self, delay: float, callback: Callable[[], None]) -> _TimerHandle: ... + def call_later(self, delay: FloatInt, callback: Callable[[], None]) -> _TimerHandle: ... def getaddrinfo( self, host: str | bytes | None, diff --git a/stubs/pika/pika/connection.pyi b/stubs/pika/pika/connection.pyi index 0264ccc017e0..83e2a2acb9fb 100644 --- a/stubs/pika/pika/connection.pyi +++ b/stubs/pika/pika/connection.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc import ssl from _typeshed import Incomplete @@ -62,7 +63,7 @@ class Parameters: @property def blocked_connection_timeout(self) -> float | None: ... @blocked_connection_timeout.setter - def blocked_connection_timeout(self, value: float | None) -> None: ... + def blocked_connection_timeout(self, value: FloatInt | None) -> None: ... @property def channel_max(self) -> int: ... @@ -112,17 +113,17 @@ class Parameters: @property def retry_delay(self) -> int | float: ... @retry_delay.setter - def retry_delay(self, value: float) -> None: ... + def retry_delay(self, value: FloatInt) -> None: ... @property def socket_timeout(self) -> float | None: ... @socket_timeout.setter - def socket_timeout(self, value: float | None) -> None: ... + def socket_timeout(self, value: FloatInt | None) -> None: ... @property def stack_timeout(self) -> float | None: ... @stack_timeout.setter - def stack_timeout(self, value: float | None) -> None: ... + def stack_timeout(self, value: FloatInt | None) -> None: ... @property def ssl_options(self) -> SSLOptions | None: ... @@ -152,11 +153,11 @@ class ConnectionParameters(Parameters): heartbeat: int | Callable[[Connection, int], int] | None = ..., ssl_options: SSLOptions | None = ..., connection_attempts: int = ..., - retry_delay: float = ..., - socket_timeout: float | None = ..., - stack_timeout: float | None = ..., + retry_delay: FloatInt = ..., + socket_timeout: FloatInt | None = ..., + stack_timeout: FloatInt | None = ..., locale: str = ..., - blocked_connection_timeout: float | None = ..., + blocked_connection_timeout: FloatInt | None = ..., client_properties: dict[str, Incomplete] | None = ..., tcp_options: dict[str, Incomplete] | None = ..., ) -> None: ... diff --git a/stubs/pika/pika/heartbeat.pyi b/stubs/pika/pika/heartbeat.pyi index 1c6ec89dfc60..2389794f2046 100644 --- a/stubs/pika/pika/heartbeat.pyi +++ b/stubs/pika/pika/heartbeat.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from logging import Logger from pika.connection import Connection @@ -5,7 +6,7 @@ from pika.connection import Connection LOGGER: Logger class HeartbeatChecker: - def __init__(self, connection: Connection, timeout: float) -> None: ... + def __init__(self, connection: Connection, timeout: FloatInt) -> None: ... @property def bytes_received_on_connection(self) -> int: ... @property diff --git a/stubs/pony/pony/options.pyi b/stubs/pony/pony/options.pyi index c65f52a795c0..179f4484a5d6 100644 --- a/stubs/pony/pony/options.pyi +++ b/stubs/pony/pony/options.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final DEBUG: Final[bool] @@ -8,7 +9,7 @@ STD_STYLESHEETS: Final[list[tuple[str, ...]]] BASE_STYLESHEETS_PLACEHOLDER: Final[str] COMPONENT_STYLESHEETS_PLACEHOLDER: Final[str] SCRIPTS_PLACEHOLDER: Final[str] -RELOADING_CHECK_INTERVAL: Final[float] +RELOADING_CHECK_INTERVAL: Final[FloatInt] LOG_TO_SQLITE: Final[None] LOGGING_LEVEL: Final[None] LOGGING_PONY_LEVEL: Final[None] diff --git a/stubs/pony/pony/orm/dbapiprovider.pyi b/stubs/pony/pony/orm/dbapiprovider.pyi index 700561338f34..c80378f9c5ea 100644 --- a/stubs/pony/pony/orm/dbapiprovider.pyi +++ b/stubs/pony/pony/orm/dbapiprovider.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import json import re import types @@ -142,7 +143,7 @@ class IntConverter(Converter): class RealConverter(Converter): EQ: str NE: str - default_tolerance: float + default_tolerance: FloatInt optimistic: bool def init(self, kwargs) -> None: ... def validate(self, val, obj=None): ... diff --git a/stubs/pony/pony/orm/dbproviders/sqlite.pyi b/stubs/pony/pony/orm/dbproviders/sqlite.pyi index 3c1e85a3546d..594504de25cc 100644 --- a/stubs/pony/pony/orm/dbproviders/sqlite.pyi +++ b/stubs/pony/pony/orm/dbproviders/sqlite.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re import sys import types @@ -194,7 +195,7 @@ class SQLitePool(Pool): filename: StrOrBytesPath, create_db: bool | None, *, - timeout: float = 5.0, + timeout: FloatInt = 5.0, detect_types: int = 0, check_same_thread: bool = True, factory: type[_Connection], @@ -209,7 +210,7 @@ class SQLitePool(Pool): filename: StrOrBytesPath, create_db: bool | None, *, - timeout: float = 5.0, + timeout: FloatInt = 5.0, detect_types: int = 0, check_same_thread: bool = True, factory: type[_Connection], diff --git a/stubs/pony/pony/utils/utils.pyi b/stubs/pony/pony/utils/utils.pyi index b7fd74ffca7a..6f50c3bba13c 100644 --- a/stubs/pony/pony/utils/utils.pyi +++ b/stubs/pony/pony/utils/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import ast import io import pickle @@ -60,7 +61,7 @@ def strjoin( sep: str, strings: Iterable[str], source_encoding: str = "ascii", dest_encoding: str | None = None ) -> str | bytes: ... def count(*args, **kwargs): ... -def avg(iter: Iterable[float | None]) -> float | None: ... +def avg(iter: Iterable[FloatInt | None]) -> float | None: ... @overload def group_concat(items: None, sep: str = ",") -> None: ... @@ -70,7 +71,7 @@ def group_concat(items: Iterable[object], sep: str = ",") -> str: ... def coalesce(*args: Any) -> Any: ... def distinct(iter): ... def concat(*args) -> str: ... -def between(x: float, a: float, b: float) -> bool: ... +def between(x: FloatInt, a: FloatInt, b: FloatInt) -> bool: ... def is_utf8(encoding: str) -> bool: ... def pickle_ast(val): ... def unpickle_ast(pickled: io.BytesIO): ... diff --git a/stubs/protobuf/google/protobuf/duration.pyi b/stubs/protobuf/google/protobuf/duration.pyi index c7e858fedbf3..83087d695680 100644 --- a/stubs/protobuf/google/protobuf/duration.pyi +++ b/stubs/protobuf/google/protobuf/duration.pyi @@ -1,12 +1,13 @@ +from _typeshed import FloatInt from datetime import timedelta from google.protobuf.duration_pb2 import Duration def from_json_string(value: str) -> Duration: ... -def from_microseconds(micros: float) -> Duration: ... -def from_milliseconds(millis: float) -> Duration: ... -def from_nanoseconds(nanos: float) -> Duration: ... -def from_seconds(seconds: float) -> Duration: ... +def from_microseconds(micros: FloatInt) -> Duration: ... +def from_milliseconds(millis: FloatInt) -> Duration: ... +def from_nanoseconds(nanos: FloatInt) -> Duration: ... +def from_seconds(seconds: FloatInt) -> Duration: ... def from_timedelta(td: timedelta) -> Duration: ... def to_json_string(duration: Duration) -> str: ... def to_microseconds(duration: Duration) -> int: ... diff --git a/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi b/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi index f77663b566b6..c515a766ca89 100644 --- a/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi +++ b/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import OptExcInfo from collections.abc import Callable from typing import TypeVar @@ -11,7 +12,7 @@ class LocalTestResult(TestResult): def addError(self, test: _TestCase, error: OptExcInfo) -> None: ... def addFailure(self, test: _TestCase, error: OptExcInfo) -> None: ... def addSkip(self, test: _TestCase, reason: str) -> None: ... - def addDuration(self, test: _TestCase, duration: float) -> None: ... + def addDuration(self, test: _TestCase, duration: FloatInt) -> None: ... class ReferenceLeakCheckerMixin: NB_RUNS: int diff --git a/stubs/protobuf/google/protobuf/internal/type_checkers.pyi b/stubs/protobuf/google/protobuf/internal/type_checkers.pyi index 6486de0124b5..ca5966498f73 100644 --- a/stubs/protobuf/google/protobuf/internal/type_checkers.pyi +++ b/stubs/protobuf/google/protobuf/internal/type_checkers.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import Any, Generic, TypeVar @@ -5,8 +6,8 @@ from google.protobuf.descriptor import EnumDescriptor, FieldDescriptor _T = TypeVar("_T") -def TruncateToFourByteFloat(original: float) -> float: ... -def ToShortestFloat(original: float) -> float: ... +def TruncateToFourByteFloat(original: FloatInt) -> float: ... +def ToShortestFloat(original: FloatInt) -> float: ... def GetTypeChecker( field: FieldDescriptor, ) -> TypeChecker[Any] | IntValueChecker | EnumValueChecker | UnicodeValueChecker | DoubleValueChecker | BoolValueChecker: ... @@ -42,11 +43,11 @@ class Int64ValueChecker(IntValueChecker): ... class Uint64ValueChecker(IntValueChecker): ... class DoubleValueChecker: - def CheckValue(self, proposed_value: float) -> float: ... + def CheckValue(self, proposed_value: FloatInt) -> float: ... def DefaultValue(self) -> float: ... class FloatValueChecker(DoubleValueChecker): - def CheckValue(self, proposed_value: float) -> float: ... + def CheckValue(self, proposed_value: FloatInt) -> float: ... TYPE_TO_BYTE_SIZE_FN: dict[int, Callable[..., int]] TYPE_TO_ENCODER: dict[int, Callable[..., Any]] diff --git a/stubs/protobuf/google/protobuf/internal/well_known_types.pyi b/stubs/protobuf/google/protobuf/internal/well_known_types.pyi index 6324155b8568..cc3d7d1ace92 100644 --- a/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +++ b/stubs/protobuf/google/protobuf/internal/well_known_types.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsItems from collections.abc import Iterable, Iterator, KeysView, Mapping, Sequence from datetime import datetime, timedelta, tzinfo @@ -72,7 +73,7 @@ class FieldMask: self, source: _Message, destination: _Message, replace_message_field: bool = False, replace_repeated_field: bool = False ) -> None: ... -_StructValue: TypeAlias = struct_pb2.Struct | struct_pb2.ListValue | str | float | bool | None +_StructValue: TypeAlias = struct_pb2.Struct | struct_pb2.ListValue | str | FloatInt | bool | None _StructValueArg: TypeAlias = _StructValue | Mapping[str, _StructValueArg] | Sequence[_StructValueArg] class Struct: diff --git a/stubs/protobuf/google/protobuf/internal/wire_format.pyi b/stubs/protobuf/google/protobuf/internal/wire_format.pyi index 0d4aa04031ec..1622982be2fb 100644 --- a/stubs/protobuf/google/protobuf/internal/wire_format.pyi +++ b/stubs/protobuf/google/protobuf/internal/wire_format.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from google.protobuf.message import Message TAG_TYPE_BITS: int @@ -34,8 +35,8 @@ def Fixed32ByteSize(field_number: int, fixed32: int) -> int: ... def Fixed64ByteSize(field_number: int, fixed64: int) -> int: ... def SFixed32ByteSize(field_number: int, sfixed32: int) -> int: ... def SFixed64ByteSize(field_number: int, sfixed64: int) -> int: ... -def FloatByteSize(field_number: int, flt: float) -> int: ... -def DoubleByteSize(field_number: int, double: float) -> int: ... +def FloatByteSize(field_number: int, flt: FloatInt) -> int: ... +def DoubleByteSize(field_number: int, double: FloatInt) -> int: ... def BoolByteSize(field_number: int, b: bool) -> int: ... def EnumByteSize(field_number: int, enum: int) -> int: ... def StringByteSize(field_number: int, string: str) -> int: ... diff --git a/stubs/protobuf/google/protobuf/timestamp.pyi b/stubs/protobuf/google/protobuf/timestamp.pyi index b6687a744e45..5d475d4a130c 100644 --- a/stubs/protobuf/google/protobuf/timestamp.pyi +++ b/stubs/protobuf/google/protobuf/timestamp.pyi @@ -1,12 +1,13 @@ +from _typeshed import FloatInt from datetime import datetime, tzinfo from google.protobuf.timestamp_pb2 import Timestamp def from_json_string(value: str) -> Timestamp: ... -def from_microseconds(micros: float) -> Timestamp: ... -def from_milliseconds(millis: float) -> Timestamp: ... -def from_nanoseconds(nanos: float) -> Timestamp: ... -def from_seconds(seconds: float) -> Timestamp: ... +def from_microseconds(micros: FloatInt) -> Timestamp: ... +def from_milliseconds(millis: FloatInt) -> Timestamp: ... +def from_nanoseconds(nanos: FloatInt) -> Timestamp: ... +def from_seconds(seconds: FloatInt) -> Timestamp: ... def from_current_time() -> Timestamp: ... def to_json_string(ts: Timestamp) -> str: ... def to_microseconds(ts: Timestamp) -> int: ... diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index 6c4fda89160f..68c33d9ab23c 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import Incomplete, StrOrBytesPath from collections.abc import Callable, Collection, Iterable, Iterator @@ -327,7 +328,7 @@ class Process: def num_threads(self) -> int: ... def threads(self) -> list[_ntp.pthread]: ... def children(self, recursive: bool = False) -> list[Process]: ... - def cpu_percent(self, interval: float | None = None) -> float: ... + def cpu_percent(self, interval: FloatInt | None = None) -> float: ... def cpu_times(self) -> _ntp.pcputimes: ... def memory_info(self) -> _ntp.pmem: ... def memory_full_info(self) -> _ntp.pfullmem: ... @@ -340,7 +341,7 @@ class Process: def resume(self) -> None: ... def terminate(self) -> None: ... def kill(self) -> None: ... - def wait(self, timeout: float | None = None) -> int: ... + def wait(self, timeout: FloatInt | None = None) -> int: ... def net_connections(self, kind: str = "inet") -> list[_ntp.pconn]: ... class Popen(Process): @@ -427,7 +428,7 @@ def pid_exists(pid: int) -> bool: ... process_iter: _ProcessIterCallable def wait_procs( - procs: Iterable[Process], timeout: float | None = None, callback: Callable[[Process], object] | None = None + procs: Iterable[Process], timeout: FloatInt | None = None, callback: Callable[[Process], object] | None = None ) -> tuple[list[Process], list[Process]]: ... def cpu_count(logical: bool = True) -> int | None: ... @@ -442,16 +443,16 @@ def cpu_times(percpu: Literal[False] = False) -> _ntp.scputimes: ... def cpu_times(percpu: Literal[True]) -> list[_ntp.scputimes]: ... @overload -def cpu_percent(interval: float | None = None, percpu: Literal[False] = False) -> float: ... +def cpu_percent(interval: FloatInt | None = None, percpu: Literal[False] = False) -> float: ... @overload -def cpu_percent(interval: float | None, percpu: Literal[True]) -> list[float]: ... +def cpu_percent(interval: FloatInt | None, percpu: Literal[True]) -> list[float]: ... @overload def cpu_percent(*, percpu: Literal[True]) -> list[float]: ... @overload -def cpu_times_percent(interval: float | None = None, percpu: Literal[False] = False) -> _ntp.scputimes: ... +def cpu_times_percent(interval: FloatInt | None = None, percpu: Literal[False] = False) -> _ntp.scputimes: ... @overload -def cpu_times_percent(interval: float | None, percpu: Literal[True]) -> list[_ntp.scputimes]: ... +def cpu_times_percent(interval: FloatInt | None, percpu: Literal[True]) -> list[_ntp.scputimes]: ... @overload def cpu_times_percent(*, percpu: Literal[True]) -> list[_ntp.scputimes]: ... diff --git a/stubs/psutil/psutil/_common.pyi b/stubs/psutil/psutil/_common.pyi index e7a974bc77cc..edfc586162f4 100644 --- a/stubs/psutil/psutil/_common.pyi +++ b/stubs/psutil/psutil/_common.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import enum import io import sys @@ -90,17 +91,17 @@ class AccessDenied(Error): def __init__(self, pid: int | None = None, name: str | None = None, msg: str | None = None) -> None: ... class TimeoutExpired(Error): - seconds: float + seconds: FloatInt pid: int | None name: str | None msg: str - def __init__(self, seconds: float, pid: int | None = None, name: str | None = None) -> None: ... + def __init__(self, seconds: FloatInt, pid: int | None = None, name: str | None = None) -> None: ... _P = ParamSpec("_P") _R = TypeVar("_R") _T = TypeVar("_T") -def usage_percent(used: ConvertibleToFloat, total: float, round_: SupportsIndex | None = None) -> float: ... +def usage_percent(used: ConvertibleToFloat, total: FloatInt, round_: SupportsIndex | None = None) -> float: ... # returned function has `cache_clear()` attribute: def memoize(fun: Callable[_P, _R]) -> Callable[_P, _R]: ... diff --git a/stubs/psutil/psutil/_ntuples.pyi b/stubs/psutil/psutil/_ntuples.pyi index 7e47772cdf77..b2444ba4ec55 100644 --- a/stubs/psutil/psutil/_ntuples.pyi +++ b/stubs/psutil/psutil/_ntuples.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import Incomplete from socket import AddressFamily, SocketKind @@ -10,7 +11,7 @@ class sswap(NamedTuple): total: int used: int free: int - percent: float + percent: FloatInt sin: int sout: int @@ -18,7 +19,7 @@ class sdiskusage(NamedTuple): total: int used: int free: int - percent: float + percent: FloatInt # redefine for linux: if sys.platform != "linux": @@ -50,7 +51,7 @@ class suser(NamedTuple): name: str terminal: str | None host: str | None - started: float + started: FloatInt pid: str class sconn(NamedTuple): @@ -83,15 +84,15 @@ class scpustats(NamedTuple): syscalls: int class scpufreq(NamedTuple): - current: float - min: float - max: float + current: FloatInt + min: FloatInt + max: FloatInt class shwtemp(NamedTuple): label: str - current: float - high: float | None - critical: float | None + current: FloatInt + high: FloatInt | None + critical: FloatInt | None class sbattery(NamedTuple): percent: int @@ -117,10 +118,10 @@ else: # redefine for linux: if sys.platform != "linux": class pcputimes(NamedTuple): - user: float - system: float - children_user: float - children_system: float + user: FloatInt + system: FloatInt + children_user: FloatInt + children_system: FloatInt class popenfile(NamedTuple): path: str @@ -128,8 +129,8 @@ if sys.platform != "linux": class pthread(NamedTuple): id: int - user_time: float - system_time: float + user_time: FloatInt + system_time: FloatInt class puids(NamedTuple): real: int @@ -173,21 +174,21 @@ if sys.platform == "linux": class scputimes(NamedTuple): # Note: scputimes has different fields depending on exactly how Linux # is setup, but we'll include the "complete" set of fields - user: float - nice: float - system: float - idle: float - iowait: float - irq: float - softirq: float - steal: float - guest: float - guest_nice: float + user: FloatInt + nice: FloatInt + system: FloatInt + idle: FloatInt + iowait: FloatInt + irq: FloatInt + softirq: FloatInt + steal: FloatInt + guest: FloatInt + guest_nice: FloatInt class svmem(NamedTuple): total: int available: int - percent: float + percent: FloatInt used: int free: int active: int @@ -273,24 +274,24 @@ if sys.platform == "linux": write_chars: int class pcputimes(NamedTuple): - user: float - system: float - children_user: float - children_system: float - iowait: float + user: FloatInt + system: FloatInt + children_user: FloatInt + children_system: FloatInt + iowait: FloatInt elif sys.platform == "win32": class scputimes(NamedTuple): - user: float - system: float - idle: float - interrupt: float - dpc: float + user: FloatInt + system: FloatInt + idle: FloatInt + interrupt: FloatInt + dpc: FloatInt class svmem(NamedTuple): total: int available: int - percent: float + percent: FloatInt used: int free: int @@ -343,15 +344,15 @@ elif sys.platform == "win32": elif sys.platform == "darwin": class scputimes(NamedTuple): - user: float - nice: float - system: float - idle: float + user: FloatInt + nice: FloatInt + system: FloatInt + idle: FloatInt class svmem(NamedTuple): total: int available: int - percent: float + percent: FloatInt used: int free: int active: int diff --git a/stubs/psutil/psutil/_psaix.pyi b/stubs/psutil/psutil/_psaix.pyi index 195fd25591e2..e1fd1cb8e040 100644 --- a/stubs/psutil/psutil/_psaix.pyi +++ b/stubs/psutil/psutil/_psaix.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys # sys.platform.startswith("aix"): @@ -37,15 +38,15 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw pfullmem = pmem class scputimes(NamedTuple): - user: float - system: float - idle: float - iowait: float + user: FloatInt + system: FloatInt + idle: FloatInt + iowait: FloatInt class svmem(NamedTuple): total: int available: int - percent: float + percent: FloatInt used: int free: int @@ -108,5 +109,5 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw def open_files(self) -> list[ntp.popenfile]: ... def num_fds(self) -> int: ... def num_ctx_switches(self) -> ntp.pctxsw: ... - def wait(self, timeout: float | None = None) -> int | None: ... + def wait(self, timeout: FloatInt | None = None) -> int | None: ... def io_counters(self) -> ntp.pio: ... diff --git a/stubs/psutil/psutil/_psbsd.pyi b/stubs/psutil/psutil/_psbsd.pyi index 7b7a18140705..1aceb127a1bc 100644 --- a/stubs/psutil/psutil/_psbsd.pyi +++ b/stubs/psutil/psutil/_psbsd.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys # sys.platform.startswith(("freebsd", "midnightbsd", "openbsd", "netbsd")): @@ -37,7 +38,7 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw class svmem(NamedTuple): total: int available: int - percent: float + percent: FloatInt used: int free: int active: int @@ -48,11 +49,11 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw wired: int class scputimes(NamedTuple): - user: float - nice: float - system: float - idle: float - irq: float + user: FloatInt + nice: FloatInt + system: FloatInt + idle: FloatInt + irq: FloatInt class pmem(NamedTuple): rss: int @@ -64,10 +65,10 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw pfullmem = pmem class pcputimes(NamedTuple): - user: float - system: float - children_user: float - children_system: float + user: FloatInt + system: FloatInt + children_user: FloatInt + children_system: FloatInt class pmmap_grouped(NamedTuple): path: Incomplete @@ -118,9 +119,9 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw def boot_time() -> float: ... def users() -> list[ntp.suser]: ... - INIT_BOOT_TIME: Final[float] # only NetBSD + INIT_BOOT_TIME: Final[FloatInt] # only NetBSD - def adjust_proc_create_time(ctime: float) -> float: ... # only NetBSD + def adjust_proc_create_time(ctime: FloatInt) -> float: ... # only NetBSD def pids() -> list[int]: ... def pid_exists(pid: int) -> bool: ... def wrap_exceptions(fun: Callable[_P, _R]) -> Callable[_P, _R]: ... @@ -178,7 +179,7 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw def num_ctx_switches(self) -> ntp.pctxsw: ... def threads(self) -> list[ntp.pthread]: ... def net_connections(self, kind: str = "inet") -> list[ntp.pconn]: ... - def wait(self, timeout: float | None = None) -> int | None: ... + def wait(self, timeout: FloatInt | None = None) -> int | None: ... def nice_get(self) -> int: ... def nice_set(self, value: int) -> None: ... def status(self) -> str: ... diff --git a/stubs/psutil/psutil/_pslinux.pyi b/stubs/psutil/psutil/_pslinux.pyi index 34bb16456b44..4c17811f5fc6 100644 --- a/stubs/psutil/psutil/_pslinux.pyi +++ b/stubs/psutil/psutil/_pslinux.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys if sys.platform == "linux": @@ -153,7 +154,7 @@ if sys.platform == "linux": def io_counters(self) -> ntp.pio: ... def cpu_times(self) -> ntp.pcputimes: ... def cpu_num(self) -> int: ... - def wait(self, timeout: float | None = None) -> int | None: ... + def wait(self, timeout: FloatInt | None = None) -> int | None: ... def create_time(self, monotonic: bool = False) -> float: ... def memory_info(self) -> ntp.pmem: ... def memory_full_info(self) -> ntp.pfullmem: ... diff --git a/stubs/psutil/psutil/_psosx.pyi b/stubs/psutil/psutil/_psosx.pyi index b8f5cbce2acc..4bd34899541c 100644 --- a/stubs/psutil/psutil/_psosx.pyi +++ b/stubs/psutil/psutil/_psosx.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys if sys.platform == "darwin": @@ -51,8 +52,8 @@ if sys.platform == "darwin": def net_connections(kind: str = "inet") -> list[ntp.sconn]: ... def net_if_stats() -> dict[str, ntp.snicstats]: ... def boot_time() -> float: ... - INIT_BOOT_TIME: float - def adjust_proc_create_time(ctime: float) -> float: ... + INIT_BOOT_TIME: FloatInt + def adjust_proc_create_time(ctime: FloatInt) -> float: ... def users() -> list[ntp.suser]: ... def pids() -> list[int]: ... pid_exists = _psposix.pid_exists @@ -82,7 +83,7 @@ if sys.platform == "darwin": def open_files(self) -> list[ntp.popenfile]: ... def net_connections(self, kind: str = "inet") -> list[ntp.pconn]: ... def num_fds(self) -> int: ... - def wait(self, timeout: float | None = None) -> int | None: ... + def wait(self, timeout: FloatInt | None = None) -> int | None: ... def nice_get(self) -> int: ... def nice_set(self, value: int) -> None: ... def status(self) -> str: ... diff --git a/stubs/psutil/psutil/_psposix.pyi b/stubs/psutil/psutil/_psposix.pyi index 69694bfa4490..bd16b008846a 100644 --- a/stubs/psutil/psutil/_psposix.pyi +++ b/stubs/psutil/psutil/_psposix.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import enum import sys from _typeshed import FileDescriptorOrPath, Incomplete, StrOrBytesPath, Unused @@ -61,18 +62,18 @@ def negsig_to_enum(num: int) -> int: ... def convert_exit_code(status: int) -> int: ... def wait_pid_posix( pid: int, - timeout: float | None = None, + timeout: FloatInt | None = None, _waitpid: Unused = ..., _timer: Callable[[], float] = ..., _min: Callable[..., Incomplete] = ..., - _sleep: Callable[[float], None] = ..., + _sleep: Callable[[FloatInt], None] = ..., _pid_exists: Callable[[int], bool] = ..., ) -> int | None: ... -def wait_pid_pidfd_open(pid: int, timeout: float | None = None) -> int | None: ... -def wait_pid_kqueue(pid: int, timeout: float | None = None) -> int | None: ... +def wait_pid_pidfd_open(pid: int, timeout: FloatInt | None = None) -> int | None: ... +def wait_pid_kqueue(pid: int, timeout: FloatInt | None = None) -> int | None: ... def can_use_pidfd_open() -> bool: ... def can_use_kqueue() -> bool: ... -def wait_pid(pid: int, timeout: float | None = None) -> int | None: ... +def wait_pid(pid: int, timeout: FloatInt | None = None) -> int | None: ... if sys.platform == "darwin": def disk_usage(path: StrOrBytesPath) -> ntp.sdiskusage: ... diff --git a/stubs/psutil/psutil/_pssunos.pyi b/stubs/psutil/psutil/_pssunos.pyi index d1e3b6dba4aa..8d8155b3a0a5 100644 --- a/stubs/psutil/psutil/_pssunos.pyi +++ b/stubs/psutil/psutil/_pssunos.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys # sys.platform.startswith(("sunos", "solaris")): @@ -37,21 +38,21 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw proc_info_map: Final[dict[str, int]] class scputimes(NamedTuple): - user: float - system: float - idle: float - iowait: float + user: FloatInt + system: FloatInt + idle: FloatInt + iowait: FloatInt class pcputimes(NamedTuple): - user: float - system: float - children_user: float - children_system: float + user: FloatInt + system: FloatInt + children_user: FloatInt + children_system: FloatInt class svmem(NamedTuple): total: int available: int - percent: float + percent: FloatInt used: int free: int @@ -148,4 +149,4 @@ if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darw def memory_maps(self) -> list[tuple[str, str, str, int, int, int]]: ... def num_fds(self) -> int: ... def num_ctx_switches(self) -> ntp.pctxsw: ... - def wait(self, timeout: float | None = None) -> int | None: ... + def wait(self, timeout: FloatInt | None = None) -> int | None: ... diff --git a/stubs/psutil/psutil/_pswindows.pyi b/stubs/psutil/psutil/_pswindows.pyi index 8d9d89e1d783..f0ac85815876 100644 --- a/stubs/psutil/psutil/_pswindows.pyi +++ b/stubs/psutil/psutil/_pswindows.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys if sys.platform == "win32": @@ -156,7 +157,7 @@ if sys.platform == "win32": def memory_maps(self) -> Iterator[tuple[str, str, str, int]]: ... def kill(self) -> None: ... def send_signal(self, sig: Literal[Signals.SIGTERM, Signals.CTRL_C_EVENT, Signals.CTRL_BREAK_EVENT]) -> None: ... - def wait(self, timeout: float | None = None) -> int | None: ... + def wait(self, timeout: FloatInt | None = None) -> int | None: ... def username(self) -> str: ... def create_time(self, fast_only: bool = False) -> float: ... def num_threads(self) -> int: ... diff --git a/stubs/psycopg2/psycopg2/_psycopg.pyi b/stubs/psycopg2/psycopg2/_psycopg.pyi index e88bd5787714..7897cea437ca 100644 --- a/stubs/psycopg2/psycopg2/_psycopg.pyi +++ b/stubs/psycopg2/psycopg2/_psycopg.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime as dt from _typeshed import ConvertibleToInt, Incomplete, SupportsRead, SupportsReadline, SupportsWrite, Unused from collections.abc import Callable, Iterable, Mapping, Sequence @@ -338,7 +339,7 @@ class Diagnostics: @disjoint_base class Float: - def __init__(self, value: float, /, **kwargs: Unused) -> None: ... + def __init__(self, value: FloatInt, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> float: ... def getquoted(self) -> bytes: ... @@ -613,16 +614,16 @@ class _datetime: def Date(year: int, month: int, day: int, /) -> _datetime: ... def DateFromPy(date: dt.date, /) -> _datetime: ... -def DateFromTicks(ticks: float, /) -> _datetime: ... +def DateFromTicks(ticks: FloatInt, /) -> _datetime: ... def IntervalFromPy(interval: dt.timedelta, /) -> _datetime: ... -def Time(hour: int, minutes: int, seconds: float, tzinfo: dt.tzinfo | None = None, /) -> _datetime: ... +def Time(hour: int, minutes: int, seconds: FloatInt, tzinfo: dt.tzinfo | None = None, /) -> _datetime: ... def TimeFromPy(time: dt.time, /) -> _datetime: ... -def TimeFromTicks(ticks: float, /) -> _datetime: ... +def TimeFromTicks(ticks: FloatInt, /) -> _datetime: ... def Timestamp( - year: int, month: int, day: int, hour: int = 0, minutes: int = 0, seconds: float = 0, tzinfo: dt.tzinfo | None = None, / + year: int, month: int, day: int, hour: int = 0, minutes: int = 0, seconds: FloatInt = 0, tzinfo: dt.tzinfo | None = None, / ) -> _datetime: ... def TimestampFromPy(datetime: dt.datetime, /) -> _datetime: ... -def TimestampFromTicks(ticks: float, /) -> _datetime: ... +def TimestampFromTicks(ticks: FloatInt, /) -> _datetime: ... def _connect(*args, **kwargs): ... def adapt(obj: object, protocol=..., alternate=..., /) -> Any: ... def encrypt_password( diff --git a/stubs/psycopg2/psycopg2/extras.pyi b/stubs/psycopg2/psycopg2/extras.pyi index 1820c9c0f055..5040dafee016 100644 --- a/stubs/psycopg2/psycopg2/extras.pyi +++ b/stubs/psycopg2/psycopg2/extras.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections import OrderedDict from collections.abc import Callable from typing import Any, NamedTuple, TypeVar, overload @@ -197,7 +198,7 @@ class ReplicationCursor(_replicationCursor): ) -> None: ... def fileno(self): ... def consume_stream( - self, consume: Callable[[ReplicationMessage], object], keepalive_interval: float | None = None + self, consume: Callable[[ReplicationMessage], object], keepalive_interval: FloatInt | None = None ) -> None: ... class UUID_adapter: diff --git a/stubs/psycopg2/psycopg2/tz.pyi b/stubs/psycopg2/psycopg2/tz.pyi index 75d1484805f7..42cb04f0062a 100644 --- a/stubs/psycopg2/psycopg2/tz.pyi +++ b/stubs/psycopg2/psycopg2/tz.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from typing import Any from typing_extensions import Self @@ -5,8 +6,8 @@ from typing_extensions import Self ZERO: datetime.timedelta class FixedOffsetTimezone(datetime.tzinfo): - def __init__(self, offset: datetime.timedelta | float | None = None, name: str | None = None) -> None: ... - def __new__(cls, offset: datetime.timedelta | float | None = None, name: str | None = None) -> Self: ... + def __init__(self, offset: datetime.timedelta | FloatInt | None = None, name: str | None = None) -> None: ... + def __new__(cls, offset: datetime.timedelta | FloatInt | None = None, name: str | None = None) -> Self: ... def __eq__(self, other: object) -> bool: ... def __ne__(self, other: object) -> bool: ... def __getinitargs__(self) -> tuple[Any, ...]: ... diff --git a/stubs/pyaudio/pyaudio.pyi b/stubs/pyaudio/pyaudio.pyi index 8df1043bb36b..9d226ea847ba 100644 --- a/stubs/pyaudio/pyaudio.pyi +++ b/stubs/pyaudio/pyaudio.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from collections.abc import Callable, Mapping, Sequence from typing import ClassVar, Final, TypeAlias @@ -94,7 +95,7 @@ else: _ChannelMap: TypeAlias = Sequence[int] _PaHostApiInfo: TypeAlias = Mapping[str, str | int] _PaDeviceInfo: TypeAlias = Mapping[str, str | int | float] -_StreamCallback: TypeAlias = Callable[[bytes | None, int, Mapping[str, float], int], tuple[bytes | None, int]] +_StreamCallback: TypeAlias = Callable[[bytes | None, int, Mapping[str, FloatInt], int], tuple[bytes | None, int]] def get_format_from_width(width: int, unsigned: bool = ...) -> int: ... def get_portaudio_version() -> int: ... diff --git a/stubs/pycocotools/pycocotools/coco.pyi b/stubs/pycocotools/pycocotools/coco.pyi index 60fc33c200d5..50f74a92c1db 100644 --- a/stubs/pycocotools/pycocotools/coco.pyi +++ b/stubs/pycocotools/pycocotools/coco.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection, Sequence from pathlib import Path from typing import Any, Generic, Literal, TypeAlias, TypedDict, TypeVar, overload, type_check_only @@ -16,7 +17,7 @@ class _Image(TypedDict): height: int file_name: str -_TPolygonSegmentation: TypeAlias = list[list[float]] +_TPolygonSegmentation: TypeAlias = list[list[FloatInt]] @type_check_only class _RLE(TypedDict): @@ -29,8 +30,8 @@ class _Annotation(TypedDict): image_id: int category_id: int segmentation: _TPolygonSegmentation | _RLE | _EncodedRLE - area: float - bbox: list[float] + area: FloatInt + bbox: list[FloatInt] iscrowd: int _TSeg = TypeVar("_TSeg", _TPolygonSegmentation, _RLE, _EncodedRLE) @@ -41,8 +42,8 @@ class _AnnotationG(TypedDict, Generic[_TSeg]): image_id: int category_id: int segmentation: _TSeg - area: float - bbox: list[float] + area: FloatInt + bbox: list[FloatInt] iscrowd: int @type_check_only @@ -71,7 +72,7 @@ class COCO: self, imgIds: Collection[int] | int = [], catIds: Collection[int] | int = [], - areaRng: Sequence[float] = [], + areaRng: Sequence[FloatInt] = [], iscrowd: bool | None = None, ) -> list[int]: ... def getCatIds( diff --git a/stubs/pycocotools/pycocotools/cocoeval.pyi b/stubs/pycocotools/pycocotools/cocoeval.pyi index ab763578101a..524e049b5029 100644 --- a/stubs/pycocotools/pycocotools/cocoeval.pyi +++ b/stubs/pycocotools/pycocotools/cocoeval.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal, TypeAlias, TypedDict, type_check_only import numpy as np @@ -18,7 +19,7 @@ class _ImageEvaluationResult(TypedDict): gtIds: list[int] dtMatches: _NDFloatArray gtMatches: _NDFloatArray - dtScores: list[float] + dtScores: list[FloatInt] gtIgnore: _NDFloatArray dtIgnore: _NDFloatArray @@ -38,7 +39,7 @@ class COCOeval: eval: _EvaluationResult params: Params stats: _NDFloatArray - ious: dict[tuple[int, int], list[float]] + ious: dict[tuple[int, int], list[FloatInt]] def __init__(self, cocoGt: COCO | None = None, cocoDt: COCO | None = None, iouType: _TIOU = "segm") -> None: ... def evaluate(self) -> None: ... def computeIoU(self, imgId: int, catId: int) -> list[float]: ... @@ -53,7 +54,7 @@ class Params: iouThrs: _NDFloatArray recThrs: _NDFloatArray maxDets: list[int] - areaRng: list[list[float]] + areaRng: list[list[FloatInt]] areaRngLbl: list[str] useCats: int kpt_oks_sigmas: _NDFloatArray diff --git a/stubs/pycocotools/pycocotools/mask.pyi b/stubs/pycocotools/pycocotools/mask.pyi index 7d92f2863ec4..d20dfe88b805 100644 --- a/stubs/pycocotools/pycocotools/mask.pyi +++ b/stubs/pycocotools/pycocotools/mask.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any, TypeAlias, overload import numpy as np @@ -11,8 +12,8 @@ _NDArrayUInt32: TypeAlias = npt.NDArray[np.uint32] _NDArrayFloat64: TypeAlias = npt.NDArray[np.float64] def iou( - dt: _NDArrayUInt32 | list[float] | list[_EncodedRLE], - gt: _NDArrayUInt32 | list[float] | list[_EncodedRLE], + dt: _NDArrayUInt32 | list[FloatInt] | list[_EncodedRLE], + gt: _NDArrayUInt32 | list[FloatInt] | list[_EncodedRLE], pyiscrowd: list[int] | _NDArrayUInt8, ) -> list[Any] | _NDArrayFloat64: ... def merge(rleObjs: list[_EncodedRLE], intersect: int = 0) -> _EncodedRLE: ... diff --git a/stubs/pycups/cups.pyi b/stubs/pycups/cups.pyi index 3ccf11bcbd8c..0f213dcb7c87 100644 --- a/stubs/pycups/cups.pyi +++ b/stubs/pycups/cups.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Unused from collections.abc import Callable, Sequence from io import IOBase @@ -674,7 +675,7 @@ class Connection: ) -> dict[int, _CupsJob]: ... def getNotifications(self, subscription_ids: list[int], sequence_numbers: list[int] = ...) -> _CupsNotifications: ... def getPPD(self, name: str, /) -> str: ... - def getPPD3(self, name: str, modtime: float = ..., filename: str = ...) -> tuple[int, float, str]: ... + def getPPD3(self, name: str, modtime: FloatInt = ..., filename: str = ...) -> tuple[int, float, str]: ... def getPPDs( self, limit: int = ..., @@ -850,11 +851,11 @@ class PPD: def __init__(self, filename: str, /) -> None: ... def conflicts(self) -> int: ... def emit(self, file: _FileOrFd, section: int, /) -> None: ... - def emitAfterOrder(self, file: _FileOrFd, section: int, limit: int, min_order: float, /) -> None: ... + def emitAfterOrder(self, file: _FileOrFd, section: int, limit: int, min_order: FloatInt, /) -> None: ... def emitFd(self, fd: int, section: int, /) -> None: ... def emitJCL(self, file: _FileOrFd, job_id: int, user: str, title: str, /) -> None: ... def emitJCLEnd(self, file: _FileOrFd, /) -> None: ... - def emitString(self, section: int, min_order: float, /) -> str: ... + def emitString(self, section: int, min_order: FloatInt, /) -> str: ... def findAttr(self, name: str, spec: str = ...) -> Attribute | None: ... def findNextAttr(self, name: str, spec: str = ...) -> Attribute | None: ... def findOption(self, name: str, /) -> Option | None: ... diff --git a/stubs/pycurl/pycurl/_pycurl.pyi b/stubs/pycurl/pycurl/_pycurl.pyi index 7fbcd416bd05..ee268b691e18 100644 --- a/stubs/pycurl/pycurl/_pycurl.pyi +++ b/stubs/pycurl/pycurl/_pycurl.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt # Stub for the pycurl C extension (imported at runtime as `pycurl._pycurl`). import sys from _typeshed import ReadableBuffer, Unused, WriteableBuffer @@ -115,7 +116,7 @@ class CurlMulti: ) -> None: ... def perform(self) -> tuple[int, int]: ... def fdset(self) -> tuple[list[int], list[int], list[int]]: ... - def select(self, timeout: float) -> int: ... + def select(self, timeout: FloatInt) -> int: ... def info_read(self, max_objects: int = ...) -> tuple[int, list[Curl], list[tuple[Curl, int, str]]]: ... def socket_action(self, sockfd: int, ev_bitmask: int) -> tuple[int, int]: ... # `assign()` accepts literally any object, it's only passed to callbacks and not processed; `None` used to unassign diff --git a/stubs/pyinstaller/PyInstaller/building/api.pyi b/stubs/pyinstaller/PyInstaller/building/api.pyi index 97e2c340c5a9..83159721257b 100644 --- a/stubs/pyinstaller/PyInstaller/building/api.pyi +++ b/stubs/pyinstaller/PyInstaller/building/api.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt # PYZ, EXE and COLLECT referenced in https://pyinstaller.org/en/stable/spec-files.html#spec-file-operation # MERGE is referenced in https://pyinstaller.org/en/stable/spec-files.html#example-merge-spec-file # hide_console referenced in https://pyinstaller.org/en/stable/feature-notes.html#automatic-hiding-and-minimization-of-console-window-under-windows @@ -145,7 +146,7 @@ class EXE(Target): upx: bool = False, cdict: Mapping[str, bool] | None = None, ) -> None: ... - mtm: float + mtm: FloatInt def assemble(self) -> None: ... class COLLECT(Target): diff --git a/stubs/pyinstaller/PyInstaller/compat.pyi b/stubs/pyinstaller/PyInstaller/compat.pyi index dd51f4aeb530..3137c2a7ba76 100644 --- a/stubs/pyinstaller/PyInstaller/compat.pyi +++ b/stubs/pyinstaller/PyInstaller/compat.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt # https://pyinstaller.org/en/stable/hooks.html#module-PyInstaller.compat from _typeshed import FileDescriptorOrPath from collections.abc import Iterable @@ -67,7 +68,7 @@ def unsetenv(name: str) -> None: ... def exec_command( *cmdargs: str, encoding: str | None = None, raise_enoent: bool | None = None, **kwargs: int | bool | Iterable[int] | None ) -> str: ... -def exec_command_rc(*cmdargs: str, **kwargs: float | bool | Iterable[int] | None) -> int: ... +def exec_command_rc(*cmdargs: str, **kwargs: FloatInt | bool | Iterable[int] | None) -> int: ... def exec_command_all( *cmdargs: str, encoding: str | None = None, **kwargs: int | bool | Iterable[int] | None ) -> tuple[int, str, str]: ... diff --git a/stubs/pyluach/pyluach/dates.pyi b/stubs/pyluach/pyluach/dates.pyi index 3cc936a8c592..2a7aa00a4bb2 100644 --- a/stubs/pyluach/pyluach/dates.pyi +++ b/stubs/pyluach/pyluach/dates.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc import builtins import datetime @@ -24,10 +25,10 @@ class BaseDate(abc.ABC, metaclass=abc.ABCMeta): @abc.abstractmethod def to_heb(self) -> HebrewDate: ... def __hash__(self) -> int: ... - def __add__(self, other: float) -> BaseDate: ... + def __add__(self, other: FloatInt) -> BaseDate: ... @overload - def __sub__(self, other: float) -> BaseDate: ... + def __sub__(self, other: FloatInt) -> BaseDate: ... @overload def __sub__(self, other: BaseDate) -> int: ... @@ -50,15 +51,15 @@ class CalendarDateMixin: year: int month: int day: int - def __init__(self, year: int, month: int, day: int, jd: float | None = None) -> None: ... + def __init__(self, year: int, month: int, day: int, jd: FloatInt | None = None) -> None: ... def __iter__(self) -> Generator[int]: ... def tuple(self) -> builtins.tuple[int, int, int]: ... def dict(self) -> _DateDict: ... def replace(self, year: int | None = None, month: int | None = None, day: int | None = None) -> Self: ... class JulianDay(BaseDate): - day: float - def __init__(self, day: float) -> None: ... + day: FloatInt + def __init__(self, day: FloatInt) -> None: ... @property def jd(self) -> float: ... @staticmethod @@ -70,7 +71,7 @@ class JulianDay(BaseDate): def to_pydate(self) -> datetime.date: ... class GregorianDate(BaseDate, CalendarDateMixin): - def __init__(self, year: int, month: int, day: int, jd: float | None = None) -> None: ... + def __init__(self, year: int, month: int, day: int, jd: FloatInt | None = None) -> None: ... def __format__(self, fmt: str) -> str: ... def strftime(self, fmt: str) -> str: ... @property @@ -85,7 +86,7 @@ class GregorianDate(BaseDate, CalendarDateMixin): def to_pydate(self) -> datetime.date: ... class HebrewDate(BaseDate, CalendarDateMixin): - def __init__(self, year: int, month: int, day: int, jd: float | None = None) -> None: ... + def __init__(self, year: int, month: int, day: int, jd: FloatInt | None = None) -> None: ... def __format__(self, fmt: str) -> str: ... @property def jd(self) -> float: ... diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index 675a633379fd..d56137eec766 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import threading from _typeshed import OptExcInfo from collections.abc import Callable @@ -48,7 +49,7 @@ class AbstractListener(threading.Thread): def _mark_ready(self) -> None: ... # undocumented def _run(self) -> None: ... # undocumented def _stop_platform(self) -> None: ... # undocumented - def join(self, timeout: float | None = None, *args: Any) -> None: ... + def join(self, timeout: FloatInt | None = None, *args: Any) -> None: ... class Events(Generic[_T, _AbstractListenerT]): _Listener: type[_AbstractListenerT] | None # undocumented @@ -67,7 +68,7 @@ class Events(Generic[_T, _AbstractListenerT]): ) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> _T: ... - def get(self, timeout: float | None = None) -> _T | None: ... + def get(self, timeout: FloatInt | None = None) -> _T | None: ... def _event_mapper(self, event: Callable[_P, object]) -> Callable[_P, None]: ... class NotifierMixin: ... diff --git a/stubs/pynput/pynput/keyboard/__init__.pyi b/stubs/pynput/pynput/keyboard/__init__.pyi index 8d553e0087f9..74b2b1582a1c 100644 --- a/stubs/pynput/pynput/keyboard/__init__.pyi +++ b/stubs/pynput/pynput/keyboard/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsItems from collections.abc import Callable from typing import Any @@ -19,7 +20,7 @@ class Events(_util.Events[Any, Listener]): def __init__(self) -> None: ... def __next__(self) -> Press | Release: ... - def get(self, timeout: float | None = None) -> Press | Release | None: ... + def get(self, timeout: FloatInt | None = None) -> Press | Release | None: ... class HotKey: def __init__(self, keys: list[KeyCode], on_activate: Callable[[], object]) -> None: ... diff --git a/stubs/pynput/pynput/mouse/__init__.pyi b/stubs/pynput/pynput/mouse/__init__.pyi index 42738f852a09..a90c3dc88537 100644 --- a/stubs/pynput/pynput/mouse/__init__.pyi +++ b/stubs/pynput/pynput/mouse/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any from pynput import _util @@ -29,4 +30,4 @@ class Events(_util.Events[Any, Listener]): def __init__(self) -> None: ... def __next__(self) -> Move | Click | Scroll: ... - def get(self, timeout: float | None = None) -> Move | Click | Scroll | None: ... + def get(self, timeout: FloatInt | None = None) -> Move | Click | Scroll | None: ... diff --git a/stubs/pyogrio/pyogrio/core.pyi b/stubs/pyogrio/pyogrio/core.pyi index a3b0264eebc6..7d01bfd5c0c0 100644 --- a/stubs/pyogrio/pyogrio/core.pyi +++ b/stubs/pyogrio/pyogrio/core.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from pathlib import Path from typing import Any, Literal, TypedDict, type_check_only @@ -34,7 +35,7 @@ class _LayerInfo(TypedDict): geometry_type: str | None features: int # total_bounds is `None` for non-spatial layers or if expensive to compute - total_bounds: tuple[float, float, float, float] | None + total_bounds: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None driver: str capabilities: _Capabilities dataset_metadata: dict[str, str] | None @@ -61,7 +62,7 @@ def read_bounds( skip_features: int = 0, max_features: int | None = None, where: str | None = None, - bbox: tuple[float, float, float, float] | None = None, + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, mask: shp.Geometry | None = None, ) -> tuple[Array1D[np.int64], Array2D[np.float64]]: ... def read_info( diff --git a/stubs/pyogrio/pyogrio/geopandas.pyi b/stubs/pyogrio/pyogrio/geopandas.pyi index ec6f67fb1829..5fc95f30983c 100644 --- a/stubs/pyogrio/pyogrio/geopandas.pyi +++ b/stubs/pyogrio/pyogrio/geopandas.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import os from collections.abc import Collection, Mapping from typing import Any, Literal, overload @@ -20,7 +21,7 @@ def read_dataframe( skip_features: int = 0, max_features: int | None = None, where: str | None = None, - bbox: tuple[float, float, float, float] | None = None, + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, mask: shp.Geometry | None = None, fids: ArrayLikeInt | None = None, sql: str | None = None, @@ -46,7 +47,7 @@ def read_dataframe( skip_features: int = 0, max_features: int | None = None, where: str | None = None, - bbox: tuple[float, float, float, float] | None = None, + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, mask: shp.Geometry | None = None, fids: ArrayLikeInt | None = None, sql: str | None = None, diff --git a/stubs/pyogrio/pyogrio/raw.pyi b/stubs/pyogrio/pyogrio/raw.pyi index 2271f506f985..b3e14ded178e 100644 --- a/stubs/pyogrio/pyogrio/raw.pyi +++ b/stubs/pyogrio/pyogrio/raw.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection, Iterable from contextlib import AbstractContextManager from typing import Any, Literal, TypedDict, overload, type_check_only @@ -35,7 +36,7 @@ def read( skip_features: int = 0, max_features: int | None = None, where: str | None = None, - bbox: tuple[float, float, float, float] | None = None, + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, mask: shp.Geometry | None = None, fids: ArrayLikeInt | None = None, sql: str | None = None, @@ -56,7 +57,7 @@ def read( skip_features: int = 0, max_features: int | None = None, where: str | None = None, - bbox: tuple[float, float, float, float] | None = None, + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, mask: shp.Geometry | None = None, fids: ArrayLikeInt | None = None, sql: str | None = None, @@ -78,7 +79,7 @@ def read_arrow( skip_features: int = 0, max_features: int | None = None, where: str | None = None, - bbox: tuple[float, float, float, float] | None = None, + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, mask: shp.Geometry | None = None, fids: ArrayLikeInt | None = None, sql: str | None = None, @@ -102,7 +103,7 @@ def open_arrow( skip_features: int = 0, max_features: int | None = None, where: str | None = None, - bbox: tuple[float, float, float, float] | None = None, + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, mask: shp.Geometry | None = None, fids: ArrayLikeInt | None = None, sql: str | None = None, @@ -125,7 +126,7 @@ def open_arrow( skip_features: int = 0, max_features: int | None = None, where: str | None = None, - bbox: tuple[float, float, float, float] | None = None, + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, mask: shp.Geometry | None = None, fids: ArrayLikeInt | None = None, sql: str | None = None, diff --git a/stubs/pyserial/serial/__init__.pyi b/stubs/pyserial/serial/__init__.pyi index 7677f130ed41..0d2238f89fc6 100644 --- a/stubs/pyserial/serial/__init__.pyi +++ b/stubs/pyserial/serial/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from serial.serialutil import * @@ -17,14 +18,14 @@ def serial_for_url( baudrate: int = ..., bytesize: int = ..., parity: str = ..., - stopbits: float = ..., - timeout: float | None = ..., + stopbits: FloatInt = ..., + timeout: FloatInt | None = ..., xonxoff: bool = ..., rtscts: bool = ..., - write_timeout: float | None = ..., + write_timeout: FloatInt | None = ..., dsrdtr: bool = ..., - inter_byte_timeout: float | None = ..., - exclusive: float | None = ..., + inter_byte_timeout: FloatInt | None = ..., + exclusive: FloatInt | None = ..., *, do_not_open: bool = ..., ) -> Serial: ... diff --git a/stubs/pyserial/serial/rfc2217.pyi b/stubs/pyserial/serial/rfc2217.pyi index 39275b8b7e8f..f982f5cf4a89 100644 --- a/stubs/pyserial/serial/rfc2217.pyi +++ b/stubs/pyserial/serial/rfc2217.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging from _typeshed import ReadableBuffer from collections.abc import Callable, Generator @@ -141,7 +142,7 @@ class TelnetSubnegotiation: def is_ready(self) -> bool: ... @property def active(self) -> bool: ... - def wait(self, timeout: float = 3) -> None: ... + def wait(self, timeout: FloatInt = 3) -> None: ... def check_answer(self, suboption: bytes) -> None: ... class Serial(SerialBase): diff --git a/stubs/pyserial/serial/rs485.pyi b/stubs/pyserial/serial/rs485.pyi index b76617efb818..d8d82a6057fb 100644 --- a/stubs/pyserial/serial/rs485.pyi +++ b/stubs/pyserial/serial/rs485.pyi @@ -1,18 +1,19 @@ +from _typeshed import FloatInt import serial class RS485Settings: rts_level_for_tx: bool rts_level_for_rx: bool loopback: bool - delay_before_tx: float | None - delay_before_rx: float | None + delay_before_tx: FloatInt | None + delay_before_rx: FloatInt | None def __init__( self, rts_level_for_tx: bool = True, rts_level_for_rx: bool = False, loopback: bool = False, - delay_before_tx: float | None = None, - delay_before_rx: float | None = None, + delay_before_tx: FloatInt | None = None, + delay_before_rx: FloatInt | None = None, ) -> None: ... class RS485(serial.Serial): ... diff --git a/stubs/pyserial/serial/serialposix.pyi b/stubs/pyserial/serial/serialposix.pyi index 2313419ca368..876483552466 100644 --- a/stubs/pyserial/serial/serialposix.pyi +++ b/stubs/pyserial/serial/serialposix.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import ReadableBuffer from typing_extensions import Never @@ -66,7 +67,7 @@ class Serial(SerialBase, PlatformSpecific): def write(self, b: ReadableBuffer, /) -> int | None: ... def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... - def send_break(self, duration: float = 0.25) -> None: ... + def send_break(self, duration: FloatInt = 0.25) -> None: ... @property def cts(self) -> bool: ... @property diff --git a/stubs/pyserial/serial/serialutil.pyi b/stubs/pyserial/serial/serialutil.pyi index a21681d688e7..835373bd2cb3 100644 --- a/stubs/pyserial/serial/serialutil.pyi +++ b/stubs/pyserial/serial/serialutil.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import io from _typeshed import ReadableBuffer, WriteableBuffer from abc import abstractmethod @@ -16,7 +17,7 @@ PARITY_ODD: Final = "O" PARITY_MARK: Final = "M" PARITY_SPACE: Final = "S" STOPBITS_ONE: Final = 1 -STOPBITS_ONE_POINT_FIVE: float +STOPBITS_ONE_POINT_FIVE: FloatInt STOPBITS_TWO: Final = 2 FIVEBITS: Final = 5 SIXBITS: Final = 6 @@ -34,18 +35,18 @@ class Timeout: TIME: Callable[[], float] is_infinite: bool is_non_blocking: bool - duration: float - target_time: float - def __init__(self, duration: float) -> None: ... + duration: FloatInt + target_time: FloatInt + def __init__(self, duration: FloatInt) -> None: ... def expired(self) -> bool: ... def time_left(self) -> float: ... - def restart(self, duration: float) -> None: ... + def restart(self, duration: FloatInt) -> None: ... class SerialBase(io.RawIOBase): BAUDRATES: tuple[int, ...] BYTESIZES: tuple[int, ...] PARITIES: tuple[str, ...] - STOPBITS: tuple[int, float, int] + STOPBITS: tuple[int, FloatInt, int] is_open: bool portstr: str | None name: str | None @@ -55,13 +56,13 @@ class SerialBase(io.RawIOBase): baudrate: int = 9600, bytesize: int = 8, parity: str = "N", - stopbits: float = 1, - timeout: float | None = None, + stopbits: FloatInt = 1, + timeout: FloatInt | None = None, xonxoff: bool = False, rtscts: bool = False, - write_timeout: float | None = None, + write_timeout: FloatInt | None = None, dsrdtr: bool = False, - inter_byte_timeout: float | None = None, + inter_byte_timeout: FloatInt | None = None, exclusive: bool | None = None, ) -> None: ... @@ -108,22 +109,22 @@ class SerialBase(io.RawIOBase): @property def stopbits(self) -> float: ... @stopbits.setter - def stopbits(self, stopbits: float) -> None: ... + def stopbits(self, stopbits: FloatInt) -> None: ... @property def timeout(self) -> float | None: ... @timeout.setter - def timeout(self, timeout: float | None) -> None: ... + def timeout(self, timeout: FloatInt | None) -> None: ... @property def write_timeout(self) -> float | None: ... @write_timeout.setter - def write_timeout(self, timeout: float | None) -> None: ... + def write_timeout(self, timeout: FloatInt | None) -> None: ... @property def inter_byte_timeout(self) -> float | None: ... @inter_byte_timeout.setter - def inter_byte_timeout(self, ic_timeout: float | None) -> None: ... + def inter_byte_timeout(self, ic_timeout: FloatInt | None) -> None: ... @property def xonxoff(self) -> bool: ... @@ -163,7 +164,7 @@ class SerialBase(io.RawIOBase): def get_settings(self) -> dict[str, Any]: ... def apply_settings(self, d: dict[str, Any]) -> None: ... def readinto(self, buffer: WriteableBuffer, /) -> int: ... # returns int unlike `io.RawIOBase` - def send_break(self, duration: float = 0.25) -> None: ... + def send_break(self, duration: FloatInt = 0.25) -> None: ... def read_all(self) -> bytes: ... def read_until(self, expected: bytes = b"\n", size: int | None = None) -> bytes: ... def iread_until(self, expected: bytes = ..., size: int | None = ...) -> Generator[bytes]: ... diff --git a/stubs/pyserial/serial/urlhandler/protocol_socket.pyi b/stubs/pyserial/serial/urlhandler/protocol_socket.pyi index 9ac407eb76db..aed50b1b9e89 100644 --- a/stubs/pyserial/serial/urlhandler/protocol_socket.pyi +++ b/stubs/pyserial/serial/urlhandler/protocol_socket.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt import logging from _typeshed import ReadableBuffer from serial.serialutil import SerialBase LOGGER_LEVELS: dict[str, int] -POLL_TIMEOUT: float +POLL_TIMEOUT: FloatInt class Serial(SerialBase): logger: logging.Logger | None diff --git a/stubs/pyserial/serial/urlhandler/protocol_spy.pyi b/stubs/pyserial/serial/urlhandler/protocol_spy.pyi index 29b45167dc76..e326a4b2faa0 100644 --- a/stubs/pyserial/serial/urlhandler/protocol_spy.pyi +++ b/stubs/pyserial/serial/urlhandler/protocol_spy.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Generator from typing import TextIO, type_check_only @@ -20,14 +21,14 @@ class FormatRaw(_Formatter): def __init__(self, output: TextIO, color: bool) -> None: ... class FormatHexdump(_Formatter): - start_time: float + start_time: FloatInt output: TextIO color: bool rx_color: str tx_color: str control_color: str def __init__(self, output: TextIO, color: bool) -> None: ... - def write_line(self, timestamp: float, label: str, value: str, value2: str = "") -> None: ... + def write_line(self, timestamp: FloatInt, label: str, value: str, value2: str = "") -> None: ... class Serial(serial.Serial): formatter: FormatRaw | FormatHexdump | None diff --git a/stubs/python-dateutil/dateutil/tz/tz.pyi b/stubs/python-dateutil/dateutil/tz/tz.pyi index fe2eaf50ee22..3ca2b0b8e432 100644 --- a/stubs/python-dateutil/dateutil/tz/tz.pyi +++ b/stubs/python-dateutil/dateutil/tz/tz.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import Unused from datetime import datetime, timedelta, tzinfo @@ -33,7 +34,7 @@ class tzutc(tzinfo): UTC: tzutc class tzoffset(tzinfo): - def __init__(self, name: str | None, offset: float | timedelta) -> None: ... + def __init__(self, name: str | None, offset: FloatInt | timedelta) -> None: ... def utcoffset(self, dt: datetime | None) -> timedelta | None: ... def dst(self, dt: datetime | None) -> timedelta | None: ... def is_ambiguous(self, dt: datetime | None) -> bool: ... @@ -44,7 +45,7 @@ class tzoffset(tzinfo): def __ne__(self, other: object) -> bool: ... __reduce__ = object.__reduce__ @classmethod - def instance(cls, name: str | None, offset: float | timedelta) -> tzoffset: ... + def instance(cls, name: str | None, offset: FloatInt | timedelta) -> tzoffset: ... class tzlocal(_tzinfo): def __init__(self) -> None: ... @@ -59,7 +60,7 @@ class tzlocal(_tzinfo): class _ttinfo: __slots__ = ["offset", "delta", "isdst", "abbr", "isstd", "isgmt", "dstoffset"] - offset: float + offset: FloatInt delta: timedelta isdst: bool abbr: str @@ -108,7 +109,7 @@ class tzstr(tzrange): hasdst: bool def __init__(self, s: str, posix_offset: bool = False) -> None: ... @classmethod - def instance(cls, name: str | None, offset: float | timedelta) -> tzoffset: ... + def instance(cls, name: str | None, offset: FloatInt | timedelta) -> tzoffset: ... @type_check_only class _ICalReader(Protocol): diff --git a/stubs/python-jenkins/jenkins/__init__.pyi b/stubs/python-jenkins/jenkins/__init__.pyi index 1f392073916e..5af60944671f 100644 --- a/stubs/python-jenkins/jenkins/__init__.pyi +++ b/stubs/python-jenkins/jenkins/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Mapping, MutableMapping, Sequence from re import Pattern @@ -13,7 +14,7 @@ LAUNCHER_COMMAND: Final[str] LAUNCHER_JNLP: Final[str] LAUNCHER_WINDOWS_SERVICE: Final[str] DEFAULT_HEADERS: Final[dict[str, str]] -DEFAULT_TIMEOUT: Final[float] +DEFAULT_TIMEOUT: Final[FloatInt] DEFAULT_RETRIES: Final = 0 INFO: Final[str] PLUGIN_INFO: Final[str] diff --git a/stubs/python-xlib/Xlib/ext/nvcontrol.pyi b/stubs/python-xlib/Xlib/ext/nvcontrol.pyi index e8087a1ee37b..99ed117dca29 100644 --- a/stubs/python-xlib/Xlib/ext/nvcontrol.pyi +++ b/stubs/python-xlib/Xlib/ext/nvcontrol.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Unused from typing import Final @@ -154,7 +155,7 @@ NV_CTRL_FRAMELOCK_POLARITY_FALLING_EDGE: Final = 0x2 NV_CTRL_FRAMELOCK_POLARITY_BOTH_EDGES: Final = 0x3 NV_CTRL_FRAMELOCK_SYNC_DELAY: Final = 24 NV_CTRL_FRAMELOCK_SYNC_DELAY_MAX: Final = 2047 -NV_CTRL_FRAMELOCK_SYNC_DELAY_FACTOR: Final[float] +NV_CTRL_FRAMELOCK_SYNC_DELAY_FACTOR: Final[FloatInt] NV_CTRL_FRAMELOCK_SYNC_INTERVAL: Final = 25 NV_CTRL_FRAMELOCK_PORT0_STATUS: Final = 26 NV_CTRL_FRAMELOCK_PORT0_STATUS_INPUT: Final = 0 diff --git a/stubs/python-xlib/Xlib/ext/randr.pyi b/stubs/python-xlib/Xlib/ext/randr.pyi index 9aac2eee1301..cef22fb87c7b 100644 --- a/stubs/python-xlib/Xlib/ext/randr.pyi +++ b/stubs/python-xlib/Xlib/ext/randr.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from typing import Final, TypeAlias @@ -127,7 +128,7 @@ def configure_output_property(self: Display | resource.Resource, output: int, pr class ChangeOutputProperty(rq.Request): ... def change_output_property( - self: Display | resource.Resource, output: int, property: int, type: int, mode: int, value: Sequence[float] | Sequence[str] + self: Display | resource.Resource, output: int, property: int, type: int, mode: int, value: Sequence[FloatInt] | Sequence[str] ) -> ChangeOutputProperty: ... class DeleteOutputProperty(rq.Request): ... diff --git a/stubs/python-xlib/Xlib/ext/xinput.pyi b/stubs/python-xlib/Xlib/ext/xinput.pyi index 6711faef3570..2ef87721a5e3 100644 --- a/stubs/python-xlib/Xlib/ext/xinput.pyi +++ b/stubs/python-xlib/Xlib/ext/xinput.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToFloat, SliceableBuffer, Unused from collections.abc import Iterable, Sequence from typing import Final, TypeVar @@ -115,7 +116,7 @@ PROPERTY_TYPE_FLOAT: Final = "FLOAT" # ignore[override] because of Liskov substitution principle violations class FP1616(rq.Int32): - def check_value(self, value: float) -> int: ... # type: ignore[override] + def check_value(self, value: FloatInt) -> int: ... # type: ignore[override] def parse_value(self, value: ConvertibleToFloat, display: Unused) -> float: ... # type: ignore[override] class FP3232(rq.ValueField): @@ -182,7 +183,7 @@ def get_device_property( class XIChangeProperty(rq.Request): ... def change_device_property( - self: Display | resource.Resource, deviceid: int, property: int, type: int, mode: int, value: Sequence[float] | Sequence[str] + self: Display | resource.Resource, deviceid: int, property: int, type: int, mode: int, value: Sequence[FloatInt] | Sequence[str] ) -> XIChangeProperty: ... class XIDeleteProperty(rq.Request): ... diff --git a/stubs/python-xlib/Xlib/protocol/rq.pyi b/stubs/python-xlib/Xlib/protocol/rq.pyi index 2f05c4f7732b..682371f6f3b9 100644 --- a/stubs/python-xlib/Xlib/protocol/rq.pyi +++ b/stubs/python-xlib/Xlib/protocol/rq.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToInt, SliceableBuffer, Unused from array import array @@ -251,7 +252,7 @@ class PropertyData(ValueField): self, data: SliceableBuffer, display: Unused, length: ConvertibleToInt | None, format: int ) -> tuple[tuple[int, SliceableBuffer] | None, SliceableBuffer]: ... def pack_value( # type: ignore[override] # Override Callable - self, value: tuple[int, Sequence[float] | Sequence[str]] + self, value: tuple[int, Sequence[FloatInt] | Sequence[str]] ) -> tuple[bytes, int, Literal[8, 16, 32]]: ... class FixedPropertyData(PropertyData): diff --git a/stubs/python-xlib/Xlib/xobject/drawable.pyi b/stubs/python-xlib/Xlib/xobject/drawable.pyi index 5aa7fadf3ef2..4c0f3d40e408 100644 --- a/stubs/python-xlib/Xlib/xobject/drawable.pyi +++ b/stubs/python-xlib/Xlib/xobject/drawable.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Sequence from typing import Any, Literal, Protocol, type_check_only @@ -158,7 +159,7 @@ class Window(Drawable): property: int, property_type: int, format: int, - data: Sequence[float] | Sequence[str], + data: Sequence[FloatInt] | Sequence[str], mode: int = 0, onerror: ErrorHandler[object] | None = None, ) -> None: ... diff --git a/stubs/pytz/pytz/reference.pyi b/stubs/pytz/pytz/reference.pyi index be187db03f33..ef286d17ff04 100644 --- a/stubs/pytz/pytz/reference.pyi +++ b/stubs/pytz/pytz/reference.pyi @@ -1,9 +1,10 @@ +from _typeshed import FloatInt import datetime from pytz import UTC as UTC class FixedOffset(datetime.tzinfo): - def __init__(self, offset: float, name: str) -> None: ... + def __init__(self, offset: FloatInt, name: str) -> None: ... def utcoffset(self, dt: datetime.datetime | None) -> datetime.timedelta: ... def tzname(self, dt: datetime.datetime | None) -> str: ... def dst(self, dt: datetime.datetime | None) -> datetime.timedelta: ... @@ -27,7 +28,7 @@ class USTimeZone(datetime.tzinfo): reprname: str stdname: str dstname: str - def __init__(self, hours: float, reprname: str, stdname: str, dstname: str) -> None: ... + def __init__(self, hours: FloatInt, reprname: str, stdname: str, dstname: str) -> None: ... def tzname(self, dt: datetime.datetime | None) -> str: ... def utcoffset(self, dt: datetime.datetime | None) -> datetime.timedelta: ... def dst(self, dt: datetime.datetime | None) -> datetime.timedelta: ... diff --git a/stubs/pywin32/_win32typing.pyi b/stubs/pywin32/_win32typing.pyi index 2aa7c963d83e..a8d05e1c6b0d 100644 --- a/stubs/pywin32/_win32typing.pyi +++ b/stubs/pywin32/_win32typing.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt # Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module. from _typeshed import Incomplete, ReadableBuffer, Unused from collections.abc import Callable, Iterable, Sequence @@ -4293,7 +4294,7 @@ class PyIOleControlSite: def LockInPlaceActive(self, fLock, /) -> None: ... def GetExtendedControl(self) -> None: ... def TransformCoords( - self, PtlHimetric: tuple[Incomplete, Incomplete], pPtfContainer: tuple[float, float], dwFlags, / + self, PtlHimetric: tuple[Incomplete, Incomplete], pPtfContainer: tuple[FloatInt, FloatInt], dwFlags, / ) -> None: ... def TranslateAccelerator(self, pMsg: PyMSG, grfModifiers, /) -> None: ... def OnFocus(self, fGotFocus, /) -> None: ... diff --git a/stubs/pywin32/win32/win32api.pyi b/stubs/pywin32/win32/win32api.pyi index 493dcce90c87..4f746f6e6d77 100644 --- a/stubs/pywin32/win32/win32api.pyi +++ b/stubs/pywin32/win32/win32api.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer from collections.abc import Callable, Iterable from typing import Literal, TypedDict, overload, type_check_only @@ -291,7 +292,7 @@ def SetStdHandle(handle, handle1: int, /) -> None: ... def SetSystemPowerState(Suspend, Force, /) -> None: ... def SetThreadLocale(lcid, /) -> None: ... def SetTimeZoneInformation(tzi, /): ... -def SetWindowLong(hwnd: int | None, offset: int, value: float, /) -> int: ... +def SetWindowLong(hwnd: int | None, offset: int, value: FloatInt, /) -> int: ... @deprecated("This function is obsolete, use `win32api.SetWindowLong` instead.") def SetWindowWord(hwnd, offset: int, val: int) -> int: ... def ShellExecute(hwnd: int, op: str, file: str, params: str, _dir: str, bShow, /): ... diff --git a/stubs/pywin32/win32/win32gui.pyi b/stubs/pywin32/win32/win32gui.pyi index 66ee8849c47e..55948cd24ca3 100644 --- a/stubs/pywin32/win32/win32gui.pyi +++ b/stubs/pywin32/win32/win32gui.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer from collections.abc import Callable, Iterable from typing import Any, Literal, TypeAlias, TypeVar @@ -36,26 +37,26 @@ def CascadeWindows( /, ) -> int: ... def SendMessage( - hwnd: int | None, message: int, wparam: int | None = ..., lparam: ReadableBuffer | float | None = ..., / + hwnd: int | None, message: int, wparam: int | None = ..., lparam: ReadableBuffer | FloatInt | None = ..., / ) -> int: ... def SendMessageTimeout( hwnd: int, message: int, - wparam: ReadableBuffer | float | None, - lparam: ReadableBuffer | float | None, + wparam: ReadableBuffer | FloatInt | None, + lparam: ReadableBuffer | FloatInt | None, flags: int, timeout: int, /, ) -> tuple[int, int]: ... def PostMessage( - hwnd: int | None, message: int, wparam: int | None = ..., lparam: ReadableBuffer | float | None = ..., / + hwnd: int | None, message: int, wparam: int | None = ..., lparam: ReadableBuffer | FloatInt | None = ..., / ) -> None: ... def PostThreadMessage(threadId, message, wparam, lparam, /) -> None: ... def ReplyMessage(result, /): ... def ResetDC(hdc: int, devmode: _win32typing.PyDEVMODEW, /) -> int: ... def RegisterWindowMessage(name: str, /): ... def DefWindowProc( - hwnd: int | None, message: int, wparam: ReadableBuffer | float | None, lparam: ReadableBuffer | float | None, / + hwnd: int | None, message: int, wparam: ReadableBuffer | FloatInt | None, lparam: ReadableBuffer | FloatInt | None, / ) -> int: ... def EnumWindows(callback: Callable[[int, _T], int | None], extra: _T, /) -> None: ... def EnumThreadWindows(dwThreadId, callback: Callable[[int, _T], int | None], extra: _T, /) -> None: ... @@ -301,7 +302,7 @@ def Ellipse(hdc: int, LeftRect, TopRect, RightRect, BottomRect, /) -> None: ... def Pie(hdc: int, LeftRect, TopRect, RightRect, BottomRect, XRadial1, YRadial1, XRadial2, YRadial2, /) -> None: ... def Arc(hdc: int, LeftRect, TopRect, RightRect, BottomRect, XRadial1, YRadial1, XRadial2, YRadial2, /) -> None: ... def ArcTo(hdc: int, LeftRect, TopRect, RightRect, BottomRect, XRadial1, YRadial1, XRadial2, YRadial2, /) -> None: ... -def AngleArc(hdc: int, Y, Y1, Radius, StartAngle: float, SweepAngle: float, /) -> None: ... +def AngleArc(hdc: int, Y, Y1, Radius, StartAngle: FloatInt, SweepAngle: FloatInt, /) -> None: ... def Chord(hdc: int, LeftRect, TopRect, RightRect, BottomRect, XRadial1, YRadial1, XRadial2, YRadial2, /) -> None: ... def ExtFloodFill(arg: int, XStart, YStart, Color, FillType, /) -> None: ... def SetPixel(hdc: int, X, Y, Color, /): ... @@ -399,7 +400,7 @@ def WidenPath(hdc: int, /) -> None: ... def StrokePath(hdc: int, /) -> None: ... def StrokeAndFillPath(hdc: int, /) -> None: ... def GetMiterLimit(hdc: int, /) -> float: ... -def SetMiterLimit(hdc: int, NewLimit: float, /) -> float: ... +def SetMiterLimit(hdc: int, NewLimit: FloatInt, /) -> float: ... def PathToRegion(hdc: int, /) -> _win32typing.PyGdiHANDLE: ... def GetPath(hdc: int, /) -> tuple[tuple[tuple[int, int], ...], tuple[int, ...]]: ... def CreateRoundRectRgn(LeftRect, TopRect, RightRect, BottomRect, WidthEllipse, HeightEllipse, /): ... diff --git a/stubs/pyxdg/xdg/IconTheme.pyi b/stubs/pyxdg/xdg/IconTheme.pyi index 40ba87afda55..790091eaffda 100644 --- a/stubs/pyxdg/xdg/IconTheme.pyi +++ b/stubs/pyxdg/xdg/IconTheme.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import StrPath from collections.abc import Collection @@ -43,8 +44,8 @@ class IconData(IniFile): icondirs: list[str] themes: list[IconTheme] theme_cache: dict[str, IconTheme] -dir_cache: dict[str, tuple[str, float, float]] -icon_cache: dict[tuple[str, int, str, tuple[str, ...]], tuple[float, str]] +dir_cache: dict[str, tuple[str, FloatInt, FloatInt]] +icon_cache: dict[tuple[str, int, str, tuple[str, ...]], tuple[FloatInt, str]] def getIconPath( iconname: str, size: int | None = None, theme: str | None = None, extensions: Collection[str] = ["png", "svg", "xpm"] diff --git a/stubs/qrbill/qrbill/bill.pyi b/stubs/qrbill/qrbill/bill.pyi index b89b902c45be..f55365724d48 100644 --- a/stubs/qrbill/qrbill/bill.pyi +++ b/stubs/qrbill/qrbill/bill.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsWrite from collections.abc import Iterable, Iterator, Mapping from decimal import Decimal @@ -20,7 +21,7 @@ _AddressDict: TypeAlias = Mapping[str, str | None] IBAN_ALLOWED_COUNTRIES: list[str] QR_IID: dict[str, int] AMOUNT_REGEX: str -MM_TO_UU: float +MM_TO_UU: FloatInt BILL_HEIGHT: int RECEIPT_WIDTH: str PAYMENT_WIDTH: str @@ -178,16 +179,16 @@ class QRBill: def proc_font_info(self) -> dict[str, Any]: ... def qr_data(self) -> str: ... def qr_image(self) -> SvgPathImage: ... - def draw_swiss_cross(self, dwg: _SvgDrawing, grp: _SvgGroup, origin: tuple[float, float], size: float) -> None: ... - def draw_blank_rect(self, dwg: _SvgDrawing, grp: _SvgGroup, x: float, y: float, width: float, height: float) -> None: ... + def draw_swiss_cross(self, dwg: _SvgDrawing, grp: _SvgGroup, origin: tuple[FloatInt, FloatInt], size: FloatInt) -> None: ... + def draw_blank_rect(self, dwg: _SvgDrawing, grp: _SvgGroup, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt) -> None: ... def label(self, txt: str) -> str: ... def as_svg(self, file_out: str | Path | SupportsWrite[str], full_page: bool = False) -> None: ... def transform_to_full_page(self, dwg: _SvgDrawing, bill: _SvgGroup) -> None: ... def draw_bill(self, dwg: _SvgDrawing, horiz_scissors: bool = True) -> _SvgGroup: ... -def add_mm(*mms: str | float) -> float: ... -def mm(val: str | float) -> float: ... +def add_mm(*mms: str | FloatInt) -> float: ... +def mm(val: str | FloatInt) -> float: ... def format_ref_number(bill: QRBill) -> str: ... -def format_amount(amount_: str | float) -> str: ... +def format_amount(amount_: str | FloatInt) -> str: ... def wrap_infos(infos: Iterable[str]) -> Iterator[str]: ... def replace_linebreaks(text: str | None) -> str: ... diff --git a/stubs/qrcode/qrcode/image/styles/colormasks.pyi b/stubs/qrcode/qrcode/image/styles/colormasks.pyi index 4c66dd25e97a..db7fd6643961 100644 --- a/stubs/qrcode/qrcode/image/styles/colormasks.pyi +++ b/stubs/qrcode/qrcode/image/styles/colormasks.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsRead from pathlib import Path @@ -15,8 +16,8 @@ class QRColorMask: def apply_mask(self, image: Image.Image, use_cache: bool = False) -> None: ... def get_fg_pixel(self, image: Image.Image, x: int, y: int) -> Ink: ... def get_bg_pixel(self, image: Image.Image, x: int, y: int) -> Ink: ... - def interp_num(self, n1: int, n2: int, norm: float) -> int: ... - def interp_color(self, col1: Ink, col2: Ink, norm: float) -> Ink: ... + def interp_num(self, n1: int, n2: int, norm: FloatInt) -> int: ... + def interp_color(self, col1: Ink, col2: Ink, norm: FloatInt) -> Ink: ... def extrap_num(self, n1: int, n2: int, interped_num: int) -> float | None: ... def extrap_color(self, col1: Ink, col2: Ink, interped_color: Ink) -> float | None: ... diff --git a/stubs/qrcode/qrcode/image/styles/moduledrawers/pil.pyi b/stubs/qrcode/qrcode/image/styles/moduledrawers/pil.pyi index 637091661493..d343ec03bd6b 100644 --- a/stubs/qrcode/qrcode/image/styles/moduledrawers/pil.pyi +++ b/stubs/qrcode/qrcode/image/styles/moduledrawers/pil.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc from typing import Literal @@ -18,10 +19,10 @@ class SquareModuleDrawer(StyledPilQRModuleDrawer): def drawrect(self, box: Box, is_active: bool) -> None: ... # type: ignore[override] class GappedSquareModuleDrawer(StyledPilQRModuleDrawer): - size_ratio: float - def __init__(self, size_ratio: float = 0.8) -> None: ... + size_ratio: FloatInt + def __init__(self, size_ratio: FloatInt = 0.8) -> None: ... imgDraw: ImageDraw.ImageDraw - delta: float + delta: FloatInt def drawrect(self, box: Box, is_active: bool) -> None: ... # type: ignore[override] class CircleModuleDrawer(StyledPilQRModuleDrawer): @@ -30,8 +31,8 @@ class CircleModuleDrawer(StyledPilQRModuleDrawer): class RoundedModuleDrawer(StyledPilQRModuleDrawer): needs_neighbors: Literal[True] - radius_ratio: float - def __init__(self, radius_ratio: float = 1) -> None: ... + radius_ratio: FloatInt + def __init__(self, radius_ratio: FloatInt = 1) -> None: ... corner_width: int SQUARE: Image.Image NW_ROUND: Image.Image @@ -43,8 +44,8 @@ class RoundedModuleDrawer(StyledPilQRModuleDrawer): class VerticalBarsDrawer(StyledPilQRModuleDrawer): needs_neighbors: Literal[True] - horizontal_shrink: float - def __init__(self, horizontal_shrink: float = 0.8) -> None: ... + horizontal_shrink: FloatInt + def __init__(self, horizontal_shrink: FloatInt = 0.8) -> None: ... half_height: int delta: int SQUARE: Image.Image @@ -55,8 +56,8 @@ class VerticalBarsDrawer(StyledPilQRModuleDrawer): class HorizontalBarsDrawer(StyledPilQRModuleDrawer): needs_neighbors: Literal[True] - vertical_shrink: float - def __init__(self, vertical_shrink: float = 0.8) -> None: ... + vertical_shrink: FloatInt + def __init__(self, vertical_shrink: FloatInt = 0.8) -> None: ... half_width: int delta: int SQUARE: Image.Image diff --git a/stubs/qrcode/qrcode/image/styles/moduledrawers/svg.pyi b/stubs/qrcode/qrcode/image/styles/moduledrawers/svg.pyi index dbbaa5653931..6a72b0e301e1 100644 --- a/stubs/qrcode/qrcode/image/styles/moduledrawers/svg.pyi +++ b/stubs/qrcode/qrcode/image/styles/moduledrawers/svg.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc from decimal import Decimal from typing import Any, NamedTuple @@ -22,7 +23,7 @@ class BaseSvgQRModuleDrawer(QRModuleDrawer, metaclass=abc.ABCMeta): size_ratio: Decimal # kwargs are used to allow for subclasses with additional keyword arguments def __init__(self, *, size_ratio: Decimal = ..., **kwargs: Any) -> None: ... - box_delta: float + box_delta: FloatInt box_size: Decimal box_half: Decimal def coords(self, box: Box) -> Coords: ... diff --git a/stubs/rasterio/rasterio/__init__.pyi b/stubs/rasterio/rasterio/__init__.pyi index 0fe6afa52c86..2175fe568c18 100644 --- a/stubs/rasterio/rasterio/__init__.pyi +++ b/stubs/rasterio/rasterio/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging import os from collections.abc import Callable, Sequence @@ -77,7 +78,7 @@ def open( crs: CRSInput | None = None, transform: Affine | None = None, dtype: DTypeLike | None = None, - nodata: float | None = None, + nodata: FloatInt | None = None, sharing: bool = False, thread_safe: bool = False, opener: _Opener | None = None, @@ -94,7 +95,7 @@ def open( crs: CRSInput | None = None, transform: Affine | None = None, dtype: DTypeLike | None = None, - nodata: float | None = None, + nodata: FloatInt | None = None, sharing: bool = False, thread_safe: bool = False, opener: _Opener | None = None, @@ -111,7 +112,7 @@ def open( crs: CRSInput | None = None, transform: Affine | None = None, dtype: DTypeLike | None = None, - nodata: float | None = None, + nodata: FloatInt | None = None, sharing: bool = False, thread_safe: bool = False, opener: _Opener | None = None, diff --git a/stubs/rasterio/rasterio/_base.pyi b/stubs/rasterio/rasterio/_base.pyi index 503fc835e84f..d906e64797ec 100644 --- a/stubs/rasterio/rasterio/_base.pyi +++ b/stubs/rasterio/rasterio/_base.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging import os from collections.abc import Iterable, Sequence @@ -22,11 +23,11 @@ def get_dataset_driver(path: str) -> str: ... def driver_supports_mode(drivername: str, creation_mode: str) -> bool: ... def driver_can_create(drivername: str) -> bool: ... def driver_can_create_copy(drivername: str) -> bool: ... -def tastes_like_gdal(seq: Affine | Sequence[float]) -> bool: ... +def tastes_like_gdal(seq: Affine | Sequence[FloatInt]) -> bool: ... def _raster_driver_extensions() -> dict[str, str]: ... def _can_create_osr(crs: CRSInput) -> bool: ... def _transform( - src_crs: CRSInput, dst_crs: CRSInput, xs: Sequence[float], ys: Sequence[float], zs: Sequence[float] | None + src_crs: CRSInput, dst_crs: CRSInput, xs: Sequence[FloatInt], ys: Sequence[FloatInt], zs: Sequence[FloatInt] | None ) -> tuple[list[float], list[float], list[float]]: ... class DatasetBase: @@ -73,7 +74,7 @@ class DatasetBase: @property def nodata(self) -> float | None: ... @nodata.setter - def nodata(self, value: float | None) -> None: ... + def nodata(self, value: FloatInt | None) -> None: ... @property def mask_flag_enums(self) -> tuple[list[MaskFlags], ...]: ... @@ -88,7 +89,7 @@ class DatasetBase: @descriptions.setter def descriptions(self, value: Sequence[str | None]) -> None: ... - def write_transform(self, transform: Sequence[float]) -> None: ... + def write_transform(self, transform: Sequence[FloatInt]) -> None: ... @property def transform(self) -> Affine: ... @@ -98,12 +99,12 @@ class DatasetBase: @property def offsets(self) -> tuple[float, ...]: ... @offsets.setter - def offsets(self, value: Sequence[float]) -> None: ... + def offsets(self, value: Sequence[FloatInt]) -> None: ... @property def scales(self) -> tuple[float, ...]: ... @scales.setter - def scales(self, value: Sequence[float]) -> None: ... + def scales(self, value: Sequence[FloatInt]) -> None: ... @property def units(self) -> tuple[str | None, ...]: ... diff --git a/stubs/rasterio/rasterio/_io.pyi b/stubs/rasterio/rasterio/_io.pyi index bd0ce16ba759..c26e3eeda8b2 100644 --- a/stubs/rasterio/rasterio/_io.pyi +++ b/stubs/rasterio/rasterio/_io.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import os from collections.abc import Iterator, Sequence from typing import Any, BinaryIO, Final @@ -21,8 +22,8 @@ def _gdal_typename(dt: DTypeLike) -> str: ... def _get_gdal_dtype(type_name: DTypeLike) -> int: ... def _boundless_vrt_doc( src_dataset: DatasetBase, - nodata: float | None = None, - background: float | None = None, + nodata: FloatInt | None = None, + background: FloatInt | None = None, hidenodata: bool = False, width: int | None = None, height: int | None = None, @@ -31,15 +32,15 @@ def _boundless_vrt_doc( resampling: Resampling = ..., ) -> str: ... def sample_gen( - dataset: DatasetBase, xy: Sequence[tuple[float, float]], indexes: Indexes | None = None, masked: bool = False + dataset: DatasetBase, xy: Sequence[tuple[FloatInt, FloatInt]], indexes: Indexes | None = None, masked: bool = False ) -> Iterator[NDArray[Any]]: ... class Statistics: - min: float - max: float - mean: float - std: float - def __init__(self, min: float, max: float, mean: float, std: float) -> None: ... + min: FloatInt + max: FloatInt + mean: FloatInt + std: FloatInt + def __init__(self, min: FloatInt, max: FloatInt, mean: FloatInt, std: FloatInt) -> None: ... class DatasetReaderBase(DatasetBase): def read( @@ -72,7 +73,7 @@ class DatasetReaderBase(DatasetBase): resampling: Resampling = ..., ) -> NDArray[Any]: ... def sample( - self, xy: Sequence[tuple[float, float]], indexes: Indexes | None = None, masked: bool = False + self, xy: Sequence[tuple[FloatInt, FloatInt]], indexes: Indexes | None = None, masked: bool = False ) -> Iterator[NDArray[Any]]: ... def stats(self, *, indexes: Indexes | None = None, approx: bool = False) -> list[Statistics]: ... @deprecated("DatasetReaderBase.statistics() will be removed in 2.0.0; please switch to stats().") @@ -117,7 +118,7 @@ class DatasetWriterBase(DatasetReaderBase): crs: CRSInput | None = None, transform: Affine | None = None, dtype: DTypeLike | None = None, - nodata: float | None = None, + nodata: FloatInt | None = None, gcps: Sequence[GroundControlPoint] | None = None, rpcs: RPC | None = None, sharing: bool = False, @@ -165,7 +166,7 @@ class BufferedDatasetWriterBase(DatasetWriterBase): crs: CRSInput | None = None, transform: Affine | None = None, dtype: DTypeLike | None = None, - nodata: float | None = None, + nodata: FloatInt | None = None, gcps: Sequence[GroundControlPoint] | None = None, rpcs: RPC | None = None, sharing: bool = False, diff --git a/stubs/rasterio/rasterio/_typing.pyi b/stubs/rasterio/rasterio/_typing.pyi index a1011123b397..fd0a3e5d6889 100644 --- a/stubs/rasterio/rasterio/_typing.pyi +++ b/stubs/rasterio/rasterio/_typing.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Mapping, Sequence from enum import Enum from typing import Any, BinaryIO, Protocol, TypeAlias, type_check_only @@ -57,7 +58,7 @@ _OGRGeometry: TypeAlias = Any # noqa: Y047 # Scalar or arbitrarily nested list of scalars; used by helpers that # recurse into sequences while preserving the nesting depth. -_NestedScalar: TypeAlias = float | list[_NestedScalar] # noqa: Y047 +_NestedScalar: TypeAlias = FloatInt | list[_NestedScalar] # noqa: Y047 # fsspec-style opener forwarded to `rasterio.open(opener=...)`: # `(path: str, mode: str) -> file-like`. diff --git a/stubs/rasterio/rasterio/_warp.pyi b/stubs/rasterio/rasterio/_warp.pyi index a50b4e37564f..a7855927ba0b 100644 --- a/stubs/rasterio/rasterio/_warp.pyi +++ b/stubs/rasterio/rasterio/_warp.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from typing import Any, Final, overload from typing_extensions import deprecated @@ -26,15 +27,15 @@ def _reproject( gcps: Sequence[GroundControlPoint] | None = None, rpcs: RPC | None = None, src_crs: CRSInput | None = None, - src_nodata: float | None = None, + src_nodata: FloatInt | None = None, dst_transform: Affine | None = None, dst_crs: CRSInput | None = None, - dst_nodata: float | None = None, + dst_nodata: FloatInt | None = None, dst_alpha: int = 0, src_alpha: int = 0, resampling: Resampling = ..., init_dest_nodata: bool = True, - tolerance: float = 0.125, + tolerance: FloatInt = 0.125, num_threads: int = 1, warp_mem_limit: int = 0, working_data_type: int = 0, @@ -46,17 +47,17 @@ def _calculate_default_transform( dst_crs: CRSInput, width: int, height: int, - left: float | None = None, - bottom: float | None = None, - right: float | None = None, - top: float | None = None, + left: FloatInt | None = None, + bottom: FloatInt | None = None, + right: FloatInt | None = None, + top: FloatInt | None = None, gcps: Sequence[GroundControlPoint] | None = None, rpcs: RPC | None = None, src_geoloc_array: NDArray[Any] | None = None, **kwargs: _GDALOption, ) -> tuple[Affine, int, int]: ... def _transform_bounds( - src_crs: CRS, dst_crs: CRS, left: float, bottom: float, right: float, top: float, densify_pts: int + src_crs: CRS, dst_crs: CRS, left: FloatInt, bottom: FloatInt, right: FloatInt, top: FloatInt, densify_pts: int ) -> tuple[float, float, float, float]: ... def _suggested_proxy_vrt_doc( width: int, @@ -72,9 +73,9 @@ class WarpedVRTReaderBase(DatasetReaderBase): src_crs: CRS src_transform: Affine | None resampling: Resampling - tolerance: float - src_nodata: float | None - dst_nodata: float | None + tolerance: FloatInt + src_nodata: FloatInt | None + dst_nodata: FloatInt | None working_dtype: DTypeLike | None warp_extras: dict[str, _GDALOption] @@ -90,9 +91,9 @@ class WarpedVRTReaderBase(DatasetReaderBase): src_crs: CRSInput | None = None, crs: CRSInput | None = None, resampling: Resampling = ..., - tolerance: float = 0.125, - src_nodata: float | None = ..., - nodata: float | None = ..., + tolerance: FloatInt = 0.125, + src_nodata: FloatInt | None = ..., + nodata: FloatInt | None = ..., width: int | None = None, height: int | None = None, src_transform: Affine | None = None, @@ -112,9 +113,9 @@ class WarpedVRTReaderBase(DatasetReaderBase): src_crs: CRSInput | None = None, crs: CRSInput | None = None, resampling: Resampling = ..., - tolerance: float = 0.125, - src_nodata: float | None = ..., - nodata: float | None = ..., + tolerance: FloatInt = 0.125, + src_nodata: FloatInt | None = ..., + nodata: FloatInt | None = ..., width: int | None = None, height: int | None = None, src_transform: Affine | None = None, @@ -136,7 +137,7 @@ class WarpedVRTReaderBase(DatasetReaderBase): masked: bool = False, out_shape: ShapeND | None = None, resampling: Resampling = ..., - fill_value: float | None = None, + fill_value: FloatInt | None = None, out_dtype: DTypeLike | None = None, # Swallows the deprecated `boundless` kwarg (raises ValueError if True). **kwargs: bool, diff --git a/stubs/rasterio/rasterio/control.pyi b/stubs/rasterio/rasterio/control.pyi index 0fbec047e6be..948648066eab 100644 --- a/stubs/rasterio/rasterio/control.pyi +++ b/stubs/rasterio/rasterio/control.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from typing import Literal, TypedDict, type_check_only @@ -5,16 +6,16 @@ from typing import Literal, TypedDict, type_check_only class GroundControlPointDict(TypedDict): id: str info: str | None - row: float - col: float - x: float - y: float - z: float | None + row: FloatInt + col: FloatInt + x: FloatInt + y: FloatInt + z: FloatInt | None @type_check_only class GroundControlPointGeometry(TypedDict): type: Literal["Point"] - coordinates: Sequence[float] + coordinates: Sequence[FloatInt] @type_check_only class GroundControlPointFeature(TypedDict): @@ -26,18 +27,18 @@ class GroundControlPointFeature(TypedDict): class GroundControlPoint: id: str info: str | None - row: float - col: float - x: float - y: float - z: float | None + row: FloatInt + col: FloatInt + x: FloatInt + y: FloatInt + z: FloatInt | None def __init__( self, - row: float | None = None, - col: float | None = None, - x: float | None = None, - y: float | None = None, - z: float | None = None, + row: FloatInt | None = None, + col: FloatInt | None = None, + x: FloatInt | None = None, + y: FloatInt | None = None, + z: FloatInt | None = None, id: str | None = None, info: str | None = None, ) -> None: ... diff --git a/stubs/rasterio/rasterio/coords.pyi b/stubs/rasterio/rasterio/coords.pyi index c7b97fc2fe31..8d8105e42fd9 100644 --- a/stubs/rasterio/rasterio/coords.pyi +++ b/stubs/rasterio/rasterio/coords.pyi @@ -1,11 +1,12 @@ +from _typeshed import FloatInt from typing import NamedTuple, TypeAlias -_Quadruple: TypeAlias = tuple[float, float, float, float] +_Quadruple: TypeAlias = tuple[FloatInt, FloatInt, FloatInt, FloatInt] class BoundingBox(NamedTuple): - left: float - bottom: float - right: float - top: float + left: FloatInt + bottom: FloatInt + right: FloatInt + top: FloatInt def disjoint_bounds(bounds1: BoundingBox | _Quadruple, bounds2: BoundingBox | _Quadruple) -> bool: ... diff --git a/stubs/rasterio/rasterio/dtypes.pyi b/stubs/rasterio/rasterio/dtypes.pyi index f76501ed11d1..862a1ac0af50 100644 --- a/stubs/rasterio/rasterio/dtypes.pyi +++ b/stubs/rasterio/rasterio/dtypes.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from typing import Any, Final @@ -27,7 +28,7 @@ dtype_fwd: Final[dict[int, str | None]] dtype_rev: Final[dict[str | None, int]] typename_fwd: Final[dict[int, str]] typename_rev: Final[dict[str, int]] -dtype_ranges: Final[dict[str, tuple[float, float]]] +dtype_ranges: Final[dict[str, tuple[FloatInt, FloatInt]]] dtype_info_registry: Final[dict[str, type]] # `numpy.finfo` instances cached at module import; used by `in_dtype_range`. @@ -35,7 +36,7 @@ f16i: Final[np.finfo[np.float16]] f32i: Final[np.finfo[np.float32]] f64i: Final[np.finfo[np.float64]] -def in_dtype_range(value: float, dtype: DTypeLike) -> bool: ... +def in_dtype_range(value: FloatInt, dtype: DTypeLike) -> bool: ... def check_dtype(dt: DTypeLike) -> bool: ... def get_minimum_dtype(values: ArrayLike) -> str: ... diff --git a/stubs/rasterio/rasterio/features.pyi b/stubs/rasterio/rasterio/features.pyi index ba2ab44be1e2..9464a15750e4 100644 --- a/stubs/rasterio/rasterio/features.pyi +++ b/stubs/rasterio/rasterio/features.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging import os from collections.abc import Iterable, Iterator @@ -28,16 +29,16 @@ def sieve( source: NDArray[Any], size: int, out: NDArray[Any] | None = None, mask: NDArray[np.bool_] | None = None, connectivity: int = 4 ) -> NDArray[Any]: ... def rasterize( - shapes: Iterable[tuple[Geometry, float] | Geometry], + shapes: Iterable[tuple[Geometry, FloatInt] | Geometry], out_shape: tuple[int, int] | None = None, - fill: float = 0, - nodata: float | None = None, + fill: FloatInt = 0, + nodata: FloatInt | None = None, masked: bool = False, out: NDArray[Any] | None = None, transform: Affine = ..., all_touched: bool = False, merge_alg: MergeAlg = ..., - default_value: float = 1, + default_value: FloatInt = 1, dtype: DTypeLike | None = None, skip_invalid: bool = True, dst_path: str | os.PathLike[str] | None = None, @@ -47,7 +48,7 @@ def bounds(geometry: Geometry, north_up: bool = True, transform: Affine | None = @overload def geometry_window( - dataset: DatasetReaderBase, shapes: Iterable[Geometry], pad_x: float = 0, pad_y: float = 0, *, boundless: bool = False + dataset: DatasetReaderBase, shapes: Iterable[Geometry], pad_x: FloatInt = 0, pad_y: FloatInt = 0, *, boundless: bool = False ) -> Window: ... @overload @deprecated( @@ -57,11 +58,11 @@ def geometry_window( def geometry_window( dataset: DatasetReaderBase, shapes: Iterable[Geometry], - pad_x: float = 0, - pad_y: float = 0, + pad_x: FloatInt = 0, + pad_y: FloatInt = 0, north_up: bool | None = None, rotated: bool | None = None, - pixel_precision: float | None = None, + pixel_precision: FloatInt | None = None, boundless: bool = False, ) -> Window: ... diff --git a/stubs/rasterio/rasterio/fill.pyi b/stubs/rasterio/rasterio/fill.pyi index 8f121f75a3a8..1198f97bba61 100644 --- a/stubs/rasterio/rasterio/fill.pyi +++ b/stubs/rasterio/rasterio/fill.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any from numpy.ma import MaskedArray @@ -6,6 +7,6 @@ from numpy.typing import NDArray def fillnodata( image: NDArray[Any] | MaskedArray[Any, Any], mask: NDArray[Any] | None = None, - max_search_distance: float = 100.0, + max_search_distance: FloatInt = 100.0, smoothing_iterations: int = 0, ) -> NDArray[Any]: ... diff --git a/stubs/rasterio/rasterio/io.pyi b/stubs/rasterio/rasterio/io.pyi index c4308f98628a..903ec5e45148 100644 --- a/stubs/rasterio/rasterio/io.pyi +++ b/stubs/rasterio/rasterio/io.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging from types import TracebackType from typing import Any, Final @@ -35,7 +36,7 @@ class MemoryFile(MemoryFileBase): crs: CRSInput | None = None, transform: Affine | None = None, dtype: DTypeLike | None = None, - nodata: float | None = None, + nodata: FloatInt | None = None, sharing: bool = False, thread_safe: bool = False, **kwargs: _OpenOption, diff --git a/stubs/rasterio/rasterio/mask.pyi b/stubs/rasterio/rasterio/mask.pyi index e0259b0c1d42..3a4e14895936 100644 --- a/stubs/rasterio/rasterio/mask.pyi +++ b/stubs/rasterio/rasterio/mask.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging from collections.abc import Iterable from typing import Any, Final @@ -18,17 +19,17 @@ def raster_geometry_mask( invert: bool = False, crop: bool = False, pad: bool = False, - pad_width: float = 0.5, + pad_width: FloatInt = 0.5, ) -> tuple[NDArray[Any], Affine, tuple[int, int, int, int]]: ... def mask( dataset: DatasetReaderBase, shapes: Iterable[Geometry], all_touched: bool = False, invert: bool = False, - nodata: float | None = None, + nodata: FloatInt | None = None, filled: bool = True, crop: bool = False, pad: bool = False, - pad_width: float = 0.5, + pad_width: FloatInt = 0.5, indexes: int | Iterable[int] | None = None, ) -> tuple[NDArray[Any], Affine]: ... diff --git a/stubs/rasterio/rasterio/merge.pyi b/stubs/rasterio/rasterio/merge.pyi index e9713eb21dcb..bd845a2c2bc9 100644 --- a/stubs/rasterio/rasterio/merge.pyi +++ b/stubs/rasterio/rasterio/merge.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging import os from collections.abc import Callable, Sequence @@ -27,9 +28,9 @@ def copy_count(merged_data: _Arr, new_data: _Arr, merged_mask: _Arr, new_mask: _ @overload def merge( sources: Sequence[DatasetReaderBase | str | os.PathLike[str]], - bounds: tuple[float, float, float, float] | None = None, - res: float | tuple[float, float] | None = None, - nodata: float | None = None, + bounds: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, + res: FloatInt | tuple[FloatInt, FloatInt] | None = None, + nodata: FloatInt | None = None, dtype: DTypeLike | None = None, *, indexes: int | Sequence[int] | None = None, @@ -47,9 +48,9 @@ def merge( @deprecated("The `precision` parameter is unused since rasterio 1.3 and will be removed in 2.0.0.") def merge( sources: Sequence[DatasetReaderBase | str | os.PathLike[str]], - bounds: tuple[float, float, float, float] | None = None, - res: float | tuple[float, float] | None = None, - nodata: float | None = None, + bounds: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, + res: FloatInt | tuple[FloatInt, FloatInt] | None = None, + nodata: FloatInt | None = None, dtype: DTypeLike | None = None, precision: int | None = None, indexes: int | Sequence[int] | None = None, diff --git a/stubs/rasterio/rasterio/plot.pyi b/stubs/rasterio/rasterio/plot.pyi index a407bb686479..0673f8e4f692 100644 --- a/stubs/rasterio/rasterio/plot.pyi +++ b/stubs/rasterio/rasterio/plot.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging from collections.abc import Mapping, Sequence from typing import Any, Final, Literal @@ -24,7 +25,7 @@ def show( ax: Any | None = None, title: str | None = None, transform: Affine | None = None, - percent_range: tuple[float, float] | None = None, + percent_range: tuple[FloatInt, FloatInt] | None = None, adjust: bool = False, **kwargs: Any, ) -> Any: ... @@ -42,8 +43,8 @@ def show_hist( title: str = "Histogram", ax: Any | None = None, label: str | Sequence[str] | None = None, - range: tuple[float, float] | None = None, + range: tuple[FloatInt, FloatInt] | None = None, **kwargs: Any, ) -> None: ... def adjust_band(band: NDArray[Any], kind: Literal["linear", "log"] | None = None) -> NDArray[Any]: ... -def contrast_strech(arr: NDArray[Any], percent_range: tuple[float, float] = (2.0, 98.0)) -> NDArray[Any]: ... +def contrast_strech(arr: NDArray[Any], percent_range: tuple[FloatInt, FloatInt] = (2.0, 98.0)) -> NDArray[Any]: ... diff --git a/stubs/rasterio/rasterio/rpc.pyi b/stubs/rasterio/rasterio/rpc.pyi index b4e2be46df5c..55b2fbf743f1 100644 --- a/stubs/rasterio/rasterio/rpc.pyi +++ b/stubs/rasterio/rasterio/rpc.pyi @@ -1,42 +1,43 @@ +from _typeshed import FloatInt from collections.abc import Sequence from typing import Any from typing_extensions import Self class RPC: - height_off: float - height_scale: float - lat_off: float - lat_scale: float - line_den_coeff: Sequence[float] - line_num_coeff: Sequence[float] - line_off: float - line_scale: float - long_off: float - long_scale: float - samp_den_coeff: Sequence[float] - samp_num_coeff: Sequence[float] - samp_off: float - samp_scale: float - err_bias: float | None - err_rand: float | None + height_off: FloatInt + height_scale: FloatInt + lat_off: FloatInt + lat_scale: FloatInt + line_den_coeff: Sequence[FloatInt] + line_num_coeff: Sequence[FloatInt] + line_off: FloatInt + line_scale: FloatInt + long_off: FloatInt + long_scale: FloatInt + samp_den_coeff: Sequence[FloatInt] + samp_num_coeff: Sequence[FloatInt] + samp_off: FloatInt + samp_scale: FloatInt + err_bias: FloatInt | None + err_rand: FloatInt | None def __init__( self, - height_off: float, - height_scale: float, - lat_off: float, - lat_scale: float, - line_den_coeff: Sequence[float], - line_num_coeff: Sequence[float], - line_off: float, - line_scale: float, - long_off: float, - long_scale: float, - samp_den_coeff: Sequence[float], - samp_num_coeff: Sequence[float], - samp_off: float, - samp_scale: float, - err_bias: float | None = None, - err_rand: float | None = None, + height_off: FloatInt, + height_scale: FloatInt, + lat_off: FloatInt, + lat_scale: FloatInt, + line_den_coeff: Sequence[FloatInt], + line_num_coeff: Sequence[FloatInt], + line_off: FloatInt, + line_scale: FloatInt, + long_off: FloatInt, + long_scale: FloatInt, + samp_den_coeff: Sequence[FloatInt], + samp_num_coeff: Sequence[FloatInt], + samp_off: FloatInt, + samp_scale: FloatInt, + err_bias: FloatInt | None = None, + err_rand: FloatInt | None = None, ) -> None: ... def to_dict(self) -> dict[str, Any]: ... def to_gdal(self) -> dict[str, str]: ... diff --git a/stubs/rasterio/rasterio/sample.pyi b/stubs/rasterio/rasterio/sample.pyi index 4d7722bae293..ff6b724614bf 100644 --- a/stubs/rasterio/rasterio/sample.pyi +++ b/stubs/rasterio/rasterio/sample.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Iterator, Sequence from typing import Any @@ -6,8 +7,8 @@ from rasterio.io import DatasetReaderBase def sample_gen( dataset: DatasetReaderBase, - xy: Iterable[tuple[float, float]], + xy: Iterable[tuple[FloatInt, FloatInt]], indexes: int | Sequence[int] | None = None, masked: bool = False, ) -> Iterator[NDArray[Any]]: ... -def sort_xy(xy: Iterable[tuple[float, float]]) -> list[tuple[float, float]]: ... +def sort_xy(xy: Iterable[tuple[FloatInt, FloatInt]]) -> list[tuple[float, float]]: ... diff --git a/stubs/rasterio/rasterio/stack.pyi b/stubs/rasterio/rasterio/stack.pyi index 307ffa1a5b64..9194bd21fac8 100644 --- a/stubs/rasterio/rasterio/stack.pyi +++ b/stubs/rasterio/rasterio/stack.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import logging import os from collections.abc import Sequence @@ -12,9 +13,9 @@ logger: Final[logging.Logger] def stack( sources: Sequence[DatasetReaderBase | str | os.PathLike[str]], - bounds: tuple[float, float, float, float] | None = None, - res: float | tuple[float, float] | None = None, - nodata: float | None = None, + bounds: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, + res: FloatInt | tuple[FloatInt, FloatInt] | None = None, + nodata: FloatInt | None = None, dtype: DTypeLike | None = None, indexes: int | Sequence[int] | None = None, output_count: int | None = None, diff --git a/stubs/rasterio/rasterio/transform.pyi b/stubs/rasterio/rasterio/transform.pyi index 56bae474245d..34e5b3dc19bd 100644 --- a/stubs/rasterio/rasterio/transform.pyi +++ b/stubs/rasterio/rasterio/transform.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import ConvertibleToInt from collections.abc import Callable, Sequence from typing import Final, Literal, TypeAlias, overload @@ -11,10 +12,10 @@ from rasterio.enums import TransformDirection as TransformDirection, TransformMe from rasterio.errors import RasterioDeprecationWarning as RasterioDeprecationWarning from rasterio.rpc import RPC -_Sextuple: TypeAlias = tuple[float, float, float, float, float, float] +_Sextuple: TypeAlias = tuple[FloatInt, FloatInt, FloatInt, FloatInt, FloatInt, FloatInt] _OffsetOptions: TypeAlias = Literal["center", "ul", "ur", "ll", "lr"] _T = TypeVar("_T", default=int) -_RoundOperation: TypeAlias = Callable[[float], _T] +_RoundOperation: TypeAlias = Callable[[FloatInt], _T] IDENTITY: Final[Affine] GDAL_IDENTITY: Final[_Sextuple] @@ -24,16 +25,16 @@ class TransformMethodsMixin: self, row: int | Sequence[int], col: int | Sequence[int], - z: float | Sequence[float] | None = None, + z: FloatInt | Sequence[FloatInt] | None = None, offset: _OffsetOptions = "center", transform_method: TransformMethod = ..., **rpc_options: _GDALOption, ) -> tuple[float, float] | tuple[list[float], list[float]]: ... def index( self, - x: float | Sequence[float], - y: float | Sequence[float], - z: float | Sequence[float] | None = None, + x: FloatInt | Sequence[FloatInt], + y: FloatInt | Sequence[FloatInt], + z: FloatInt | Sequence[FloatInt] | None = None, op: _RoundOperation[ConvertibleToInt] | None = None, precision: int | None = None, transform_method: TransformMethod = ..., @@ -42,23 +43,23 @@ class TransformMethodsMixin: def tastes_like_gdal(seq: Affine | _Sextuple) -> bool: ... def guard_transform(transform: Affine | _Sextuple) -> Affine: ... -def from_origin(west: float, north: float, xsize: float, ysize: float) -> Affine: ... -def from_bounds(west: float, south: float, east: float, north: float, width: float, height: float) -> Affine: ... +def from_origin(west: FloatInt, north: FloatInt, xsize: FloatInt, ysize: FloatInt) -> Affine: ... +def from_bounds(west: FloatInt, south: FloatInt, east: FloatInt, north: FloatInt, width: FloatInt, height: FloatInt) -> Affine: ... def array_bounds(height: int, width: int, transform: Affine) -> tuple[float, float, float, float]: ... def from_gcps(gcps: Sequence[GroundControlPoint]) -> Affine: ... def xy( transform: Affine | Sequence[GroundControlPoint] | RPC, rows: int | Sequence[int], cols: int | Sequence[int], - zs: float | Sequence[float] | None = None, + zs: FloatInt | Sequence[FloatInt] | None = None, offset: _OffsetOptions = "center", **rpc_options: _GDALOption, ) -> tuple[float, float] | tuple[list[float], list[float]]: ... def rowcol( transform: Affine | Sequence[GroundControlPoint] | RPC, - xs: float | Sequence[float], - ys: float | Sequence[float], - zs: float | Sequence[float] | None = None, + xs: FloatInt | Sequence[FloatInt], + ys: FloatInt | Sequence[FloatInt], + zs: FloatInt | Sequence[FloatInt] | None = None, op: _RoundOperation[_T] | None = None, precision: int | None = None, **rpc_options: _GDALOption, @@ -75,25 +76,25 @@ class TransformerBase: self, rows: int | Sequence[int], cols: int | Sequence[int], - zs: float | Sequence[float] | None = None, + zs: FloatInt | Sequence[FloatInt] | None = None, offset: _OffsetOptions = "center", ) -> tuple[float, float] | tuple[list[float], list[float]]: ... @overload def rowcol( self, - xs: float | Sequence[float], - ys: float | Sequence[float], - zs: float | Sequence[float] | None = None, + xs: FloatInt | Sequence[FloatInt], + ys: FloatInt | Sequence[FloatInt], + zs: FloatInt | Sequence[FloatInt] | None = None, op: _RoundOperation[_T] | None = None, ) -> tuple[_T, _T] | tuple[list[_T], list[_T]]: ... @overload @deprecated("The `precision` parameter is unused since rasterio 1.3 and will be removed in 2.0.0.") def rowcol( self, - xs: float | Sequence[float], - ys: float | Sequence[float], - zs: float | Sequence[float] | None = None, + xs: FloatInt | Sequence[FloatInt], + ys: FloatInt | Sequence[FloatInt], + zs: FloatInt | Sequence[FloatInt] | None = None, op: _RoundOperation[_T] | None = None, precision: int | None = None, ) -> tuple[_T, _T] | tuple[list[_T], list[_T]]: ... diff --git a/stubs/rasterio/rasterio/warp.pyi b/stubs/rasterio/rasterio/warp.pyi index ffd58099a02f..f12d3a1e2300 100644 --- a/stubs/rasterio/rasterio/warp.pyi +++ b/stubs/rasterio/rasterio/warp.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Mapping, Sequence from typing import Any, Final, TypeAlias, overload @@ -10,7 +11,7 @@ from rasterio.control import GroundControlPoint from rasterio.enums import Resampling from rasterio.rpc import RPC -_Resolution: TypeAlias = tuple[float, float] | float +_Resolution: TypeAlias = tuple[FloatInt, FloatInt] | FloatInt _Gcps: TypeAlias = Sequence[GroundControlPoint] _Rpcs: TypeAlias = RPC | Mapping[str, Any] @@ -22,7 +23,7 @@ def transform( @overload def transform_geom( - src_crs: CRSInput, dst_crs: CRSInput, geom: Geometry | Sequence[Geometry], *, precision: float = -1 + src_crs: CRSInput, dst_crs: CRSInput, geom: Geometry | Sequence[Geometry], *, precision: FloatInt = -1 ) -> dict[str, Any] | list[dict[str, Any]]: ... @overload @deprecated( @@ -35,12 +36,12 @@ def transform_geom( dst_crs: CRSInput, geom: Geometry | Sequence[Geometry], antimeridian_cutting: bool | None = None, - antimeridian_offset: float | None = None, - precision: float = -1, + antimeridian_offset: FloatInt | None = None, + precision: FloatInt = -1, ) -> dict[str, Any] | list[dict[str, Any]]: ... def transform_bounds( - src_crs: CRSInput, dst_crs: CRSInput, left: float, bottom: float, right: float, top: float, densify_pts: int = 21 + src_crs: CRSInput, dst_crs: CRSInput, left: FloatInt, bottom: FloatInt, right: FloatInt, top: FloatInt, densify_pts: int = 21 ) -> tuple[float, float, float, float]: ... def reproject( source: ArrayLike | Incomplete, @@ -49,10 +50,10 @@ def reproject( gcps: _Gcps | None = None, rpcs: _Rpcs | None = None, src_crs: CRSInput | None = None, - src_nodata: float | None = None, + src_nodata: FloatInt | None = None, dst_transform: Affine | None = None, dst_crs: CRSInput | None = None, - dst_nodata: float | None = None, + dst_nodata: FloatInt | None = None, dst_resolution: _Resolution | None = None, src_alpha: int = 0, dst_alpha: int = 0, @@ -60,7 +61,7 @@ def reproject( resampling: Resampling = ..., num_threads: int = 1, init_dest_nodata: bool = True, - tolerance: float = 0.125, + tolerance: FloatInt = 0.125, warp_mem_limit: int = 0, src_geoloc_array: NDArray[Any] | None = None, **kwargs: _GDALOption, @@ -71,10 +72,10 @@ def calculate_default_transform( dst_crs: CRSInput, width: int, height: int, - left: float | None = None, - bottom: float | None = None, - right: float | None = None, - top: float | None = None, + left: FloatInt | None = None, + bottom: FloatInt | None = None, + right: FloatInt | None = None, + top: FloatInt | None = None, gcps: _Gcps | None = None, rpcs: _Rpcs | None = None, resolution: _Resolution | None = None, diff --git a/stubs/rasterio/rasterio/windows.pyi b/stubs/rasterio/rasterio/windows.pyi index c5c80b9861f9..36230e6487c9 100644 --- a/stubs/rasterio/rasterio/windows.pyi +++ b/stubs/rasterio/rasterio/windows.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Sequence from typing import Any, TypeAlias, overload from typing_extensions import Self, deprecated @@ -6,38 +7,38 @@ from affine import Affine as Affine from numpy.typing import NDArray from rasterio.errors import RasterioDeprecationWarning as RasterioDeprecationWarning, WindowError as WindowError -_Bounds: TypeAlias = tuple[float, float, float, float] +_Bounds: TypeAlias = tuple[FloatInt, FloatInt, FloatInt, FloatInt] _Ranges: TypeAlias = tuple[tuple[int, int], tuple[int, int]] _Slices: TypeAlias = tuple[slice, slice] class WindowMethodsMixin: @overload - def window(self, left: float, bottom: float, right: float, top: float) -> Window: ... + def window(self, left: FloatInt, bottom: FloatInt, right: FloatInt, top: FloatInt) -> Window: ... @overload @deprecated("The `precision` parameter is unused since rasterio 1.3 and will be removed in 2.0.0.") - def window(self, left: float, bottom: float, right: float, top: float, precision: int | None = None) -> Window: ... + def window(self, left: FloatInt, bottom: FloatInt, right: FloatInt, top: FloatInt, precision: int | None = None) -> Window: ... def window_transform(self, window: Window) -> Affine: ... def window_bounds(self, window: Window) -> _Bounds: ... def iter_args(function: Callable[..., Any]) -> Callable[..., Any]: ... def toranges(window: Window | _Ranges) -> _Ranges: ... -def get_data_window(arr: NDArray[Any], nodata: float | None = None) -> Window: ... +def get_data_window(arr: NDArray[Any], nodata: FloatInt | None = None) -> Window: ... def union(*windows: Window) -> Window: ... def intersection(*windows: Window) -> Window: ... def intersect(*windows: Window) -> bool: ... @overload -def from_bounds(left: float, bottom: float, right: float, top: float, transform: Affine | None = None) -> Window: ... +def from_bounds(left: FloatInt, bottom: FloatInt, right: FloatInt, top: FloatInt, transform: Affine | None = None) -> Window: ... @overload @deprecated( "`height`, `width`, and `precision` on windows.from_bounds are unused since rasterio 1.3 and will be removed in 2.0.0." ) def from_bounds( - left: float, - bottom: float, - right: float, - top: float, + left: FloatInt, + bottom: FloatInt, + right: FloatInt, + top: FloatInt, transform: Affine | None = None, height: int | None = None, width: int | None = None, @@ -53,15 +54,15 @@ def window_index(window: Window, height: int = 0, width: int = 0) -> _Slices: .. def round_window_to_full_blocks( window: Window, block_shapes: Sequence[tuple[int, int]], height: int = 0, width: int = 0 ) -> Window: ... -def validate_length_value(instance: object, attribute: object, value: float) -> None: ... +def validate_length_value(instance: object, attribute: object, value: FloatInt) -> None: ... def subdivide(window: Window, height: int, width: int) -> list[Window]: ... class Window: - col_off: float - row_off: float - width: float - height: float - def __init__(self, col_off: float, row_off: float, width: float, height: float) -> None: ... + col_off: FloatInt + row_off: FloatInt + width: FloatInt + height: FloatInt + def __init__(self, col_off: FloatInt, row_off: FloatInt, width: FloatInt, height: FloatInt) -> None: ... def flatten(self) -> tuple[float, float, float, float]: ... def todict(self) -> dict[str, float]: ... def toranges(self) -> _Ranges: ... diff --git a/stubs/ratelimit/ratelimit/decorators.pyi b/stubs/ratelimit/ratelimit/decorators.pyi index a31adc2fa819..1e4445e42546 100644 --- a/stubs/ratelimit/ratelimit/decorators.pyi +++ b/stubs/ratelimit/ratelimit/decorators.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import ParamSpec, TypeVar @@ -6,7 +7,7 @@ _T = TypeVar("_T") class RateLimitDecorator: def __init__( - self, calls: int = 15, period: float = 900, clock: Callable[[], float] = ..., raise_on_limit: bool = True + self, calls: int = 15, period: FloatInt = 900, clock: Callable[[], float] = ..., raise_on_limit: bool = True ) -> None: ... def __call__(self, func: Callable[_P, _T]) -> Callable[_P, _T]: ... diff --git a/stubs/ratelimit/ratelimit/exception.pyi b/stubs/ratelimit/ratelimit/exception.pyi index 2271781458b0..bceee2163326 100644 --- a/stubs/ratelimit/ratelimit/exception.pyi +++ b/stubs/ratelimit/ratelimit/exception.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt class RateLimitException(Exception): - period_remaining: float - def __init__(self, message: str, period_remaining: float) -> None: ... + period_remaining: FloatInt + def __init__(self, message: str, period_remaining: FloatInt) -> None: ... diff --git a/stubs/regex/regex/_main.pyi b/stubs/regex/regex/_main.pyi index 2a1d693e8ffb..ffedd312c218 100644 --- a/stubs/regex/regex/_main.pyi +++ b/stubs/regex/regex/_main.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import MaybeNone, ReadableBuffer, Unused from collections.abc import Callable, Mapping from types import GenericAlias @@ -92,7 +93,7 @@ def search( endpos: int | None = None, partial: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> Match[str] | None: ... @@ -105,7 +106,7 @@ def search( endpos: int | None = None, partial: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> Match[bytes] | None: ... @@ -119,7 +120,7 @@ def match( endpos: int | None = None, partial: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> Match[str] | None: ... @@ -132,7 +133,7 @@ def match( endpos: int | None = None, partial: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> Match[bytes] | None: ... @@ -148,7 +149,7 @@ def fullmatch( endpos: int | None = None, partial: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> Match[str] | None: ... @@ -161,7 +162,7 @@ def fullmatch( endpos: int | None = None, partial: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> Match[bytes] | None: ... @@ -173,7 +174,7 @@ def split( maxsplit: int = 0, flags: int = 0, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> list[str | MaybeNone]: ... @@ -184,7 +185,7 @@ def split( maxsplit: int = 0, flags: int = 0, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> list[bytes | MaybeNone]: ... @@ -196,7 +197,7 @@ def splititer( maxsplit: int = 0, flags: int = 0, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> _regex.Splitter[str]: ... @@ -207,7 +208,7 @@ def splititer( maxsplit: int = 0, flags: int = 0, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> _regex.Splitter[bytes]: ... @@ -221,7 +222,7 @@ def findall( endpos: int | None = None, overlapped: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> list[Any]: ... @@ -234,7 +235,7 @@ def findall( endpos: int | None = None, overlapped: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> list[Any]: ... @@ -249,7 +250,7 @@ def finditer( overlapped: bool = False, partial: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> _regex.Scanner[str]: ... @@ -263,7 +264,7 @@ def finditer( overlapped: bool = False, partial: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> _regex.Scanner[bytes]: ... @@ -278,7 +279,7 @@ def sub( pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> str: ... @@ -292,7 +293,7 @@ def sub( pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> bytes: ... @@ -307,7 +308,7 @@ def subf( pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> str: ... @@ -321,7 +322,7 @@ def subf( pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> bytes: ... @@ -336,7 +337,7 @@ def subn( pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> tuple[str, int]: ... @@ -350,7 +351,7 @@ def subn( pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> tuple[bytes, int]: ... @@ -365,7 +366,7 @@ def subfn( pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> tuple[str, int]: ... @@ -379,7 +380,7 @@ def subfn( pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ignore_unused: bool = False, **kwargs: Any, ) -> tuple[bytes, int]: ... @@ -420,7 +421,7 @@ class Pattern(Generic[AnyStr]): endpos: int | None = None, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> Match[str] | None: ... @overload def search( @@ -430,7 +431,7 @@ class Pattern(Generic[AnyStr]): endpos: int | None = None, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> Match[bytes] | None: ... @overload @@ -441,7 +442,7 @@ class Pattern(Generic[AnyStr]): endpos: int | None = None, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> Match[str] | None: ... @overload def match( @@ -451,7 +452,7 @@ class Pattern(Generic[AnyStr]): endpos: int | None = None, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> Match[bytes] | None: ... prefixmatch = match @@ -464,7 +465,7 @@ class Pattern(Generic[AnyStr]): endpos: int | None = None, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> Match[str] | None: ... @overload def fullmatch( @@ -474,12 +475,12 @@ class Pattern(Generic[AnyStr]): endpos: int | None = None, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> Match[bytes] | None: ... @overload def split( - self: Pattern[str], string: str, maxsplit: int = 0, concurrent: bool | None = None, timeout: float | None = None + self: Pattern[str], string: str, maxsplit: int = 0, concurrent: bool | None = None, timeout: FloatInt | None = None ) -> list[str | MaybeNone]: ... @overload def split( @@ -487,12 +488,12 @@ class Pattern(Generic[AnyStr]): string: ReadableBuffer, maxsplit: int = 0, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> list[bytes | MaybeNone]: ... @overload def splititer( - self: Pattern[str], string: str, maxsplit: int = 0, concurrent: bool | None = None, timeout: float | None = None + self: Pattern[str], string: str, maxsplit: int = 0, concurrent: bool | None = None, timeout: FloatInt | None = None ) -> _regex.Splitter[str]: ... @overload def splititer( @@ -500,7 +501,7 @@ class Pattern(Generic[AnyStr]): string: ReadableBuffer, maxsplit: int = 0, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> _regex.Splitter[bytes]: ... @overload @@ -511,7 +512,7 @@ class Pattern(Generic[AnyStr]): endpos: int | None = None, overlapped: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> list[Any]: ... @overload def findall( @@ -521,7 +522,7 @@ class Pattern(Generic[AnyStr]): endpos: int | None = None, overlapped: bool = False, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> list[Any]: ... @overload @@ -533,7 +534,7 @@ class Pattern(Generic[AnyStr]): overlapped: bool = False, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> _regex.Scanner[str]: ... @overload def finditer( @@ -544,7 +545,7 @@ class Pattern(Generic[AnyStr]): overlapped: bool = False, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> _regex.Scanner[bytes]: ... @overload @@ -556,7 +557,7 @@ class Pattern(Generic[AnyStr]): pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> str: ... @overload def sub( @@ -567,7 +568,7 @@ class Pattern(Generic[AnyStr]): pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> bytes: ... @overload @@ -579,7 +580,7 @@ class Pattern(Generic[AnyStr]): pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> str: ... @overload def subf( @@ -590,7 +591,7 @@ class Pattern(Generic[AnyStr]): pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> bytes: ... @overload @@ -602,7 +603,7 @@ class Pattern(Generic[AnyStr]): pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> tuple[str, int]: ... @overload def subn( @@ -613,7 +614,7 @@ class Pattern(Generic[AnyStr]): pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> tuple[bytes, int]: ... @overload @@ -625,7 +626,7 @@ class Pattern(Generic[AnyStr]): pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> tuple[str, int]: ... @overload def subfn( @@ -636,7 +637,7 @@ class Pattern(Generic[AnyStr]): pos: int | None = None, endpos: int | None = None, concurrent: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> tuple[bytes, int]: ... @overload @@ -648,7 +649,7 @@ class Pattern(Generic[AnyStr]): overlapped: bool = False, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> _regex.Scanner[str]: ... @overload def scanner( @@ -659,7 +660,7 @@ class Pattern(Generic[AnyStr]): overlapped: bool = False, concurrent: bool | None = None, partial: bool = False, - timeout: float | None = None, + timeout: FloatInt | None = None, ) -> _regex.Scanner[bytes]: ... def __copy__(self) -> Self: ... diff --git a/stubs/reportlab/reportlab/graphics/barcode/code39.pyi b/stubs/reportlab/reportlab/graphics/barcode/code39.pyi index bea530fb0076..1144849214b8 100644 --- a/stubs/reportlab/reportlab/graphics/barcode/code39.pyi +++ b/stubs/reportlab/reportlab/graphics/barcode/code39.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from reportlab.graphics.barcode.common import Barcode @@ -9,9 +10,9 @@ class _Code39Base(Barcode): quiet: int gap: Incomplete barHeight: Incomplete - ratio: float + ratio: FloatInt checksum: int - bearers: float + bearers: FloatInt stop: int def __init__(self, value: str = "", **args) -> None: ... decomposed: Incomplete diff --git a/stubs/reportlab/reportlab/graphics/barcode/common.pyi b/stubs/reportlab/reportlab/graphics/barcode/common.pyi index 513fb79debf7..d4ba6461eb1e 100644 --- a/stubs/reportlab/reportlab/graphics/barcode/common.pyi +++ b/stubs/reportlab/reportlab/graphics/barcode/common.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from reportlab.platypus.flowables import Flowable @@ -43,9 +44,9 @@ class I2of5(Barcode): patterns: Incomplete barHeight: Incomplete barWidth: Incomplete - ratio: float + ratio: FloatInt checksum: int - bearers: float + bearers: FloatInt bearerBox: bool quiet: int lquiet: Incomplete @@ -65,9 +66,9 @@ class MSI(Barcode): stop: int barHeight: Incomplete barWidth: Incomplete - ratio: float + ratio: FloatInt checksum: int - bearers: float + bearers: FloatInt quiet: int lquiet: Incomplete rquiet: Incomplete @@ -87,9 +88,9 @@ class Codabar(Barcode): stop: int barHeight: Incomplete barWidth: Incomplete - ratio: float + ratio: FloatInt checksum: int - bearers: float + bearers: FloatInt quiet: int lquiet: Incomplete rquiet: Incomplete @@ -110,9 +111,9 @@ class Code11(Barcode): stop: int barHeight: Incomplete barWidth: Incomplete - ratio: float + ratio: FloatInt checksum: int - bearers: float + bearers: FloatInt quiet: int lquiet: Incomplete rquiet: Incomplete diff --git a/stubs/reportlab/reportlab/graphics/barcode/lto.pyi b/stubs/reportlab/reportlab/graphics/barcode/lto.pyi index dde1e45e2e4a..aa1d6a7649ae 100644 --- a/stubs/reportlab/reportlab/graphics/barcode/lto.pyi +++ b/stubs/reportlab/reportlab/graphics/barcode/lto.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from reportlab.graphics.barcode.code39 import Standard39 @@ -6,7 +7,7 @@ class BaseLTOLabel(Standard39): LABELWIDTH: Incomplete LABELHEIGHT: Incomplete LABELROUND: Incomplete - CODERATIO: float + CODERATIO: FloatInt CODENOMINALWIDTH: Incomplete CODEBARHEIGHT: Incomplete CODEBARWIDTH: Incomplete @@ -25,7 +26,7 @@ class VerticalLTOLabel(BaseLTOLabel): LABELFONT: Incomplete BLOCKWIDTH: Incomplete BLOCKHEIGHT: Incomplete - LINEWIDTH: float + LINEWIDTH: FloatInt NBBLOCKS: int COLORSCHEME: Incomplete colored: Incomplete diff --git a/stubs/reportlab/reportlab/graphics/charts/axes.pyi b/stubs/reportlab/reportlab/graphics/charts/axes.pyi index 51274804d9e4..b080dd74e271 100644 --- a/stubs/reportlab/reportlab/graphics/charts/axes.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/axes.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -53,7 +54,7 @@ class CategoryAxis(_AxisG): gridStrokeLineJoin: Incomplete gridStrokeLineCap: Incomplete gridStrokeMiterLimit: Incomplete - gridStrokeWidth: float + gridStrokeWidth: FloatInt gridStrokeColor: Incomplete gridStrokeDashArray: Incomplete gridStart: Incomplete @@ -141,7 +142,7 @@ class _isListOfDaysAndMonths(Validator): isListOfDaysAndMonths: Incomplete class NormalDateXValueAxis(XValueAxis): - bottomAxisLabelSlack: float + bottomAxisLabelSlack: FloatInt niceMonth: int forceEndDate: int forceFirstDate: int @@ -177,7 +178,7 @@ class XTimeValueAxis(TimeValueAxis, XValueAxis): class AdjYValueAxis(YValueAxis): requiredRange: int leftAxisPercent: int - leftAxisOrigShiftIPC: float + leftAxisOrigShiftIPC: FloatInt leftAxisOrigShiftMin: int leftAxisSkipLL0: int valueSteps: Incomplete diff --git a/stubs/reportlab/reportlab/graphics/charts/barcharts.pyi b/stubs/reportlab/reportlab/graphics/charts/barcharts.pyi index 303ca4bc20c1..18ba700a01ac 100644 --- a/stubs/reportlab/reportlab/graphics/charts/barcharts.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/barcharts.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -10,7 +11,7 @@ __version__: Final[str] class BarChartProperties(PropHolder): strokeColor: Incomplete fillColor: Incomplete - strokeWidth: float + strokeWidth: FloatInt symbol: Incomplete strokeDashArray: Incomplete def __init__(self) -> None: ... @@ -49,8 +50,8 @@ class _FakeGroup: def sort(self) -> None: ... class BarChart3D(BarChart): - theta_x: float - theta_y: float + theta_x: FloatInt + theta_y: FloatInt zDepth: Incomplete zSpace: Incomplete def calcBarPositions(self) -> None: ... diff --git a/stubs/reportlab/reportlab/graphics/charts/dotbox.pyi b/stubs/reportlab/reportlab/graphics/charts/dotbox.pyi index d67fdfe982b9..09305ff9ea74 100644 --- a/stubs/reportlab/reportlab/graphics/charts/dotbox.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/dotbox.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from reportlab.graphics.widgetbase import Widget @@ -10,7 +11,7 @@ class DotBox(Widget): labelFontName: str labelFontSize: int labelOffset: int - strokeWidth: float + strokeWidth: FloatInt gridDivWidth: Incomplete gridColor: Incomplete dotDiameter: Incomplete diff --git a/stubs/reportlab/reportlab/graphics/charts/legends.pyi b/stubs/reportlab/reportlab/graphics/charts/legends.pyi index f9eddc0b8bd9..ed04425f2ed0 100644 --- a/stubs/reportlab/reportlab/graphics/charts/legends.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/legends.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -44,7 +45,7 @@ class Legend(Widget): yGap: int variColumn: int dividerLines: int - dividerWidth: float + dividerWidth: FloatInt dividerDashArray: Incomplete dividerColor: Incomplete dividerOffsX: Incomplete @@ -74,7 +75,7 @@ class TotalAnnotator(LegendColEndCallout): fontName: str | None = None, fontSize: int = 10, fillColor=..., - strokeWidth: float = 0.5, + strokeWidth: FloatInt = 0.5, strokeColor=..., strokeDashArray=None, dx: int = 0, diff --git a/stubs/reportlab/reportlab/graphics/charts/linecharts.pyi b/stubs/reportlab/reportlab/graphics/charts/linecharts.pyi index 16d1c4bf69e7..74a2bb7d5d8d 100644 --- a/stubs/reportlab/reportlab/graphics/charts/linecharts.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/linecharts.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -46,8 +47,8 @@ class _FakeGroup: def sort(self) -> None: ... class HorizontalLineChart3D(HorizontalLineChart): - theta_x: float - theta_y: float + theta_x: FloatInt + theta_y: FloatInt zDepth: int zSpace: int def calcPositions(self) -> None: ... diff --git a/stubs/reportlab/reportlab/graphics/charts/lineplots.pyi b/stubs/reportlab/reportlab/graphics/charts/lineplots.pyi index 77c6ad29d27d..e459c66198ca 100644 --- a/stubs/reportlab/reportlab/graphics/charts/lineplots.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/lineplots.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -59,8 +60,8 @@ class LinePlot(AbstractLineChart): def addCrossHair(self, name, xv, yv, strokeColor=..., strokeWidth: int = 1, beforeLines: bool = True): ... class LinePlot3D(LinePlot): - theta_x: float - theta_y: float + theta_x: FloatInt + theta_y: FloatInt zDepth: int zSpace: int def calcPositions(self) -> None: ... diff --git a/stubs/reportlab/reportlab/graphics/charts/piecharts.pyi b/stubs/reportlab/reportlab/graphics/charts/piecharts.pyi index aa15c8d58846..ef819072793c 100644 --- a/stubs/reportlab/reportlab/graphics/charts/piecharts.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/piecharts.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -22,29 +23,29 @@ class WedgeProperties(PropHolder): fontName: Incomplete fontSize: Incomplete fontColor: Incomplete - labelRadius: float + labelRadius: FloatInt label_dx: int label_text: Incomplete label_topPadding: int label_boxAnchor: str label_boxStrokeColor: Incomplete - label_boxStrokeWidth: float + label_boxStrokeWidth: FloatInt label_boxFillColor: Incomplete label_strokeColor: Incomplete - label_strokeWidth: float + label_strokeWidth: FloatInt label_leading: Incomplete label_textAnchor: str label_simple_pointer: int label_visible: int label_pointer_strokeColor: Incomplete - label_pointer_strokeWidth: float + label_pointer_strokeWidth: FloatInt label_pointer_elbowLength: int label_pointer_edgePad: int label_pointer_piePad: int visible: int shadingKind: Incomplete - shadingAmount: float - shadingAngle: float + shadingAmount: FloatInt + shadingAngle: FloatInt shadingDirection: str def __init__(self) -> None: ... @@ -54,7 +55,7 @@ class AbstractPieChart(PlotArea): def boundsOverlap(P, Q): ... def findOverlapRun(B, wrap: int = 1): ... -def fixLabelOverlaps(L, sideLabels: bool = False, mult0: float = 1.0) -> None: ... +def fixLabelOverlaps(L, sideLabels: bool = False, mult0: FloatInt = 1.0) -> None: ... def intervalIntersection(A, B): ... def theta0(data, direction): ... @@ -78,7 +79,7 @@ class Pie(AbstractPieChart): orderMode: str xradius: Incomplete sideLabels: int - sideLabelsOffset: float + sideLabelsOffset: FloatInt slices: Incomplete angleRange: int def __init__(self, *, angleRange: int = 360, **kwds) -> None: ... @@ -119,7 +120,7 @@ class LegendedPie(Pie): class Wedge3dProperties(PropHolder): strokeWidth: int - shading: float + shading: FloatInt visible: int strokeColorShaded: Incomplete strokeColor: Incomplete @@ -128,16 +129,16 @@ class Wedge3dProperties(PropHolder): fontName: Incomplete fontSize: Incomplete fontColor: Incomplete - labelRadius: float + labelRadius: FloatInt label_dx: int label_text: Incomplete label_topPadding: int label_boxAnchor: str label_boxStrokeColor: Incomplete - label_boxStrokeWidth: float + label_boxStrokeWidth: FloatInt label_boxFillColor: Incomplete label_strokeColor: Incomplete - label_strokeWidth: float + label_strokeWidth: FloatInt label_leading: Incomplete label_textAnchor: str label_visible: int diff --git a/stubs/reportlab/reportlab/graphics/charts/slidebox.pyi b/stubs/reportlab/reportlab/graphics/charts/slidebox.pyi index 5af8e999ae03..0e58871a8554 100644 --- a/stubs/reportlab/reportlab/graphics/charts/slidebox.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/slidebox.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from reportlab.graphics.widgetbase import Widget @@ -17,12 +18,12 @@ class SlideBox(Widget): triangleWidth: Incomplete triangleFillColor: Incomplete triangleStrokeColor: Incomplete - triangleStrokeWidth: float + triangleStrokeWidth: FloatInt boxHeight: Incomplete boxWidth: Incomplete boxSpacing: Incomplete boxOutlineColor: Incomplete - boxOutlineWidth: float + boxOutlineWidth: FloatInt leftPadding: int rightPadding: int topPadding: int diff --git a/stubs/reportlab/reportlab/graphics/charts/spider.pyi b/stubs/reportlab/reportlab/graphics/charts/spider.pyi index e66e11bb7e8a..0c04ba3d8daf 100644 --- a/stubs/reportlab/reportlab/graphics/charts/spider.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/spider.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -19,12 +20,12 @@ class StrandProperty(PropHolder): def __init__(self) -> None: ... class SpokeProperty(PropHolder): - strokeWidth: float + strokeWidth: FloatInt fillColor: Incomplete strokeColor: Incomplete strokeDashArray: Incomplete visible: int - labelRadius: float + labelRadius: FloatInt def __init__(self, **kw) -> None: ... class SpokeLabel(WedgeLabel): @@ -52,7 +53,7 @@ class SpiderChart(PlotArea): height: int def __init__(self) -> None: ... def demo(self): ... - def normalizeData(self, outer: float = 0.0): ... + def normalizeData(self, outer: FloatInt = 0.0): ... def labelClass(self, kind): ... def draw(self): ... diff --git a/stubs/reportlab/reportlab/graphics/charts/utils.pyi b/stubs/reportlab/reportlab/graphics/charts/utils.pyi index 5139374047ea..cec80df1b19e 100644 --- a/stubs/reportlab/reportlab/graphics/charts/utils.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Sequence from typing import Final, Literal @@ -67,6 +68,6 @@ class FillPairedData(list[Incomplete]): other: Incomplete def __init__(self, v, other: int = 0) -> None: ... -def angle2dir(angle: float) -> Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]: ... -def angle2corner(angle: float) -> Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]: ... -def boxCornerCoords(bb: Sequence[float], cn: Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]) -> tuple[float, float]: ... +def angle2dir(angle: FloatInt) -> Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]: ... +def angle2corner(angle: FloatInt) -> Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]: ... +def boxCornerCoords(bb: Sequence[FloatInt], cn: Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]) -> tuple[float, float]: ... diff --git a/stubs/reportlab/reportlab/graphics/charts/utils3d.pyi b/stubs/reportlab/reportlab/graphics/charts/utils3d.pyi index c54c9e087c1b..24fbc6faad2a 100644 --- a/stubs/reportlab/reportlab/graphics/charts/utils3d.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/utils3d.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete class _YStrip: @@ -6,7 +7,7 @@ class _YStrip: slope: Incomplete fillColor: Incomplete fillColorShaded: Incomplete - def __init__(self, y0, y1, slope, fillColor, fillColorShaded, shading: float = 0.1) -> None: ... + def __init__(self, y0, y1, slope, fillColor, fillColorShaded, shading: FloatInt = 0.1) -> None: ... def mod_2pi(radians): ... diff --git a/stubs/reportlab/reportlab/graphics/renderPDF.pyi b/stubs/reportlab/reportlab/graphics/renderPDF.pyi index 382d054f9f63..71d60e5d63be 100644 --- a/stubs/reportlab/reportlab/graphics/renderPDF.pyi +++ b/stubs/reportlab/reportlab/graphics/renderPDF.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import IO, Final @@ -8,7 +9,7 @@ from reportlab.platypus import Flowable __version__: Final[str] -def draw(drawing: Drawing, canvas: Canvas, x: float, y: float, showBoundary=...) -> None: ... +def draw(drawing: Drawing, canvas: Canvas, x: FloatInt, y: FloatInt, showBoundary=...) -> None: ... class _PDFRenderer(Renderer): def __init__(self) -> None: ... diff --git a/stubs/reportlab/reportlab/graphics/renderPM.pyi b/stubs/reportlab/reportlab/graphics/renderPM.pyi index 68833ea9da95..e7ac68318fca 100644 --- a/stubs/reportlab/reportlab/graphics/renderPM.pyi +++ b/stubs/reportlab/reportlab/graphics/renderPM.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import IO, Final @@ -9,7 +10,7 @@ __version__: Final[str] def Color2Hex(c): ... def CairoColor(c): ... -def draw(drawing: Drawing, canvas: Canvas, x: float, y: float, showBoundary=...) -> None: ... +def draw(drawing: Drawing, canvas: Canvas, x: FloatInt, y: FloatInt, showBoundary=...) -> None: ... class _PMRenderer(Renderer): def pop(self) -> None: ... @@ -27,7 +28,7 @@ class _PMRenderer(Renderer): def drawString(self, stringObj) -> None: ... def drawPath(self, path): ... -BEZIER_ARC_MAGIC: float +BEZIER_ARC_MAGIC: FloatInt class PMCanvas: ctm: Incomplete @@ -44,13 +45,13 @@ class PMCanvas: def bezierArcCCW(self, cx, cy, rx, ry, theta0, theta1): ... def addEllipsoidalArc(self, cx, cy, rx, ry, ang1, ang2) -> None: ... def drawCentredString( - self, x: float, y: float, text: str, text_anchor: str = "middle", direction: str | None = None, shaping: bool = False + self, x: FloatInt, y: FloatInt, text: str, text_anchor: str = "middle", direction: str | None = None, shaping: bool = False ) -> None: ... - def drawRightString(self, text: str, x: float, y: float, direction: str | None = None) -> None: ... + def drawRightString(self, text: str, x: FloatInt, y: FloatInt, direction: str | None = None) -> None: ... def drawString( self, - x: float, - y: float, + x: FloatInt, + y: FloatInt, text: str, _fontInfo=None, text_anchor: str = "left", @@ -80,7 +81,7 @@ class PMCanvas: def drawToPMCanvas( d: Drawing, - dpi: float = 72, + dpi: FloatInt = 72, bg: int = 0xFFFFFF, configPIL=None, showBoundary=..., @@ -89,7 +90,7 @@ def drawToPMCanvas( ): ... def drawToPIL( d: Drawing, - dpi: float = 72, + dpi: FloatInt = 72, bg: int = 0xFFFFFF, configPIL=None, showBoundary=..., @@ -98,7 +99,7 @@ def drawToPIL( ): ... def drawToPILP( d: Drawing, - dpi: float = 72, + dpi: FloatInt = 72, bg: int = 0xFFFFFF, configPIL=None, showBoundary=..., @@ -109,7 +110,7 @@ def drawToFile( d: Drawing, fn: str | IO[bytes], fmt: str = "GIF", - dpi: float = 72, + dpi: FloatInt = 72, bg: int = 0xFFFFFF, configPIL=None, showBoundary=..., @@ -119,7 +120,7 @@ def drawToFile( def drawToString( d: Drawing, fmt: str = "GIF", - dpi: float = 72, + dpi: FloatInt = 72, bg: int = 0xFFFFFF, configPIL=None, showBoundary=..., diff --git a/stubs/reportlab/reportlab/graphics/renderPS.pyi b/stubs/reportlab/reportlab/graphics/renderPS.pyi index f7e47c5af40e..798eab669548 100644 --- a/stubs/reportlab/reportlab/graphics/renderPS.pyi +++ b/stubs/reportlab/reportlab/graphics/renderPS.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import IO, Final @@ -52,7 +53,7 @@ class PSCanvas: def scale(self, x, y) -> None: ... def transform(self, a, b, c, d, e, f) -> None: ... -def draw(drawing: Drawing, canvas: Canvas, x: float = 0, y: float = 0, showBoundary=0) -> None: ... +def draw(drawing: Drawing, canvas: Canvas, x: FloatInt = 0, y: FloatInt = 0, showBoundary=0) -> None: ... class _PSRenderer(Renderer): def drawNode(self, node) -> None: ... diff --git a/stubs/reportlab/reportlab/graphics/renderSVG.pyi b/stubs/reportlab/reportlab/graphics/renderSVG.pyi index b9611dad4138..bc91407df5dc 100644 --- a/stubs/reportlab/reportlab/graphics/renderSVG.pyi +++ b/stubs/reportlab/reportlab/graphics/renderSVG.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Sequence from math import cos as cos, pi as pi, sin as sin @@ -15,7 +16,7 @@ EXTRA_FILL_STYLES: Final[Sequence[str]] def drawToString(d: Drawing, showBoundary=0, **kwds) -> str: ... def drawToFile(d: Drawing, fn: str | IO[str], showBoundary=0, **kwds) -> None: ... -def draw(drawing: Drawing, canvas: Canvas, x: float = 0, y: float = 0, showBoundary=0) -> None: ... +def draw(drawing: Drawing, canvas: Canvas, x: FloatInt = 0, y: FloatInt = 0, showBoundary=0) -> None: ... def transformNode(doc, newTag, node=None, **attrDict): ... class EncodedWriter(list[Incomplete]): diff --git a/stubs/reportlab/reportlab/graphics/shapes.pyi b/stubs/reportlab/reportlab/graphics/shapes.pyi index 3083db90f7e0..9b32c5d6541e 100644 --- a/stubs/reportlab/reportlab/graphics/shapes.pyi +++ b/stubs/reportlab/reportlab/graphics/shapes.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsItems from abc import abstractmethod from collections.abc import Iterable, Sequence @@ -13,9 +14,9 @@ from reportlab.platypus.flowables import _HAlignment, _VAlignment _IntBool: TypeAlias = Literal[0, 1] _BoolLike: TypeAlias = _IntBool | bool _PathOp: TypeAlias = ( - tuple[Literal["moveTo"], float, float] - | tuple[Literal["lineTo"], float, float] - | tuple[Literal["curveTo"], float, float, float, float, float, float] + tuple[Literal["moveTo"], FloatInt, FloatInt] + | tuple[Literal["lineTo"], FloatInt, FloatInt] + | tuple[Literal["curveTo"], FloatInt, FloatInt, FloatInt, FloatInt, FloatInt, FloatInt] # close path may either be a tuple or just the string | Literal["closePath"] | tuple[Literal["closePath"]] @@ -27,7 +28,7 @@ _PathOp: TypeAlias = ( # verified at runtime @type_check_only class _GroupKwArgs(TypedDict, total=False): - transform: tuple[float, float, float, float, float, float] | list[float] | list[int] + transform: tuple[FloatInt, FloatInt, FloatInt, FloatInt, FloatInt, FloatInt] | list[FloatInt] | list[int] # NOTE: This should be used with care, since it will replace elements # it's mostly useful for circumventing validation logic and # reusing the list, rather than populating a new list @@ -48,32 +49,32 @@ class _DrawingKwArgs(_GroupKwArgs, total=False): # we assume it is turned off and allow all valid values hAlign: _HAlignment vAlign: _VAlignment - renderScale: float + renderScale: FloatInt initialFontName: str | None - initialFontSize: float | None + initialFontSize: FloatInt | None @type_check_only class _LineShapeKwArgs(TypedDict, total=False): strokeColor: Color | None - strokeWidth: float + strokeWidth: FloatInt strokeLineCap: Literal[0, 1, 2] strokeLineJoin: Literal[0, 1, 2] - strokeMiterLimit: float - strokeDashArray: Sequence[float] | tuple[float, Sequence[float]] - strokeOpacity: float | None + strokeMiterLimit: FloatInt + strokeDashArray: Sequence[FloatInt] | tuple[FloatInt, Sequence[FloatInt]] + strokeOpacity: FloatInt | None strokeOverprint: _BoolLike overprintMask: _BoolLike @type_check_only class _PathKwArgs(_LineShapeKwArgs, total=False): fillColor: Color | None - fillOpacity: float + fillOpacity: FloatInt fillOverprint: _BoolLike @type_check_only class _AllPathKwArgs(_PathKwArgs, total=False): - points: list[float] | None - operators: list[float] | None + points: list[FloatInt] | None + operators: list[FloatInt] | None isClipPath: _BoolLike autoclose: Literal["svg", "pdf"] | None fillMode: Literal[0, 1] @@ -85,17 +86,17 @@ class _SolidShapeKwArgs(_PathKwArgs, total=False): @type_check_only class _DefinePathKwArgs(_SolidShapeKwArgs, total=False): autoclose: Literal["svg", "pdf"] | None - bbox: tuple[float, float, float, float] | None + bbox: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None @type_check_only class _WedgeKwArgs(_SolidShapeKwArgs, total=False): - radius1: float | None - yradius1: float | None + radius1: FloatInt | None + yradius1: FloatInt | None @type_check_only class _StringKwArgs(TypedDict, total=False): fontName: str - fontSize: float + fontSize: FloatInt fillColor: Color | None textAnchor: Literal["start", "middle", "end", "numeric"] encoding: str @@ -133,28 +134,28 @@ class Shape(_SetKeyWordArgs, _DrawTimeResizeable): class Group(Shape): contents: list[Shape] - transform: tuple[float, float, float, float, float, float] | list[float] | list[int] + transform: tuple[FloatInt, FloatInt, FloatInt, FloatInt, FloatInt, FloatInt] | list[FloatInt] | list[int] def __init__(self, *elements: Shape | UserNode, **keywords: Unpack[_GroupKwArgs]) -> None: ... def add(self, node: Shape | UserNode, name: str | None = None) -> None: ... def insert(self, i: int, n: Shape | UserNode, name: str | None = None) -> None: ... def expandUserNodes(self) -> Group: ... def copy(self) -> Self: ... - def rotate(self, theta: float, cx: float = 0, cy: float = 0) -> None: ... - def translate(self, dx: float, dy: float = 0) -> None: ... - def scale(self, sx: float, sy: float = 1) -> None: ... - def skew(self, kx: float, ky: float = 0) -> None: ... - def shift(self, x: float, y: float = 0) -> None: ... + def rotate(self, theta: FloatInt, cx: FloatInt = 0, cy: FloatInt = 0) -> None: ... + def translate(self, dx: FloatInt, dy: FloatInt = 0) -> None: ... + def scale(self, sx: FloatInt, sy: FloatInt = 1) -> None: ... + def skew(self, kx: FloatInt, ky: FloatInt = 0) -> None: ... + def shift(self, x: FloatInt, y: FloatInt = 0) -> None: ... # NOTE: This changes the object to a Drawing, rather than returning # a new one, which is not ideal... - def asDrawing(self, width: float, height: float) -> None: ... + def asDrawing(self, width: FloatInt, height: FloatInt) -> None: ... def getContents(self) -> list[Shape | UserNode]: ... def getBounds(self) -> tuple[float, float, float, float]: ... class Drawing(Group, Flowable): background: Shape | UserNode | None - renderScale: float + renderScale: FloatInt def __init__( - self, width: float = 400, height: float = 200, *nodes: Shape | UserNode, **keywords: Unpack[_DrawingKwArgs] + self, width: FloatInt = 400, height: FloatInt = 200, *nodes: Shape | UserNode, **keywords: Unpack[_DrawingKwArgs] ) -> None: ... def draw(self, showBoundary=...) -> None: ... def expandUserNodes(self) -> Drawing: ... @@ -170,7 +171,7 @@ class Drawing(Group, Flowable): ): ... def asString(self, format: str, verbose: bool | None = None, preview: int = 0, **kw) -> str: ... def resized( - self, kind: Literal["fit", "fitx", "fity"] = "fit", lpad: float = 0, rpad: float = 0, bpad: float = 0, tpad: float = 0 + self, kind: Literal["fit", "fitx", "fity"] = "fit", lpad: FloatInt = 0, rpad: FloatInt = 0, bpad: FloatInt = 0, tpad: FloatInt = 0 ) -> Drawing: ... class _DrawingEditorMixin: ... @@ -183,12 +184,12 @@ isStrokeDashArray: _isStrokeDashArray class LineShape(Shape): strokeColor: Color | None - strokeWidth: float + strokeWidth: FloatInt strokeLineCap: Literal[0, 1, 2] strokeLineJoin: Literal[0, 1, 2] - strokeMiterLimit: float - strokeDashArray: Sequence[float] | tuple[float, Sequence[float]] - strokeOpacity: float | None + strokeMiterLimit: FloatInt + strokeDashArray: Sequence[FloatInt] | tuple[FloatInt, Sequence[FloatInt]] + strokeOpacity: FloatInt | None def __init__(self, kw: _LineShapeKwArgs) -> None: ... @abstractmethod def copy(self) -> Self: ... @@ -196,18 +197,18 @@ class LineShape(Shape): def getBounds(self) -> tuple[float, float, float, float]: ... class Line(LineShape): - x1: float - y1: float - x2: float - y2: float - def __init__(self, x1: float, y1: float, x2: float, y2: float, **kw: Unpack[_LineShapeKwArgs]) -> None: ... + x1: FloatInt + y1: FloatInt + x2: FloatInt + y2: FloatInt + def __init__(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, **kw: Unpack[_LineShapeKwArgs]) -> None: ... # NOTE: For some reason Line doesn't implement copy def copy(self) -> Never: ... def getBounds(self) -> tuple[float, float, float, float]: ... class SolidShape(LineShape): fillColor: Color | None - fillOpacity: float | None + fillOpacity: FloatInt | None def __init__(self, kw: _SolidShapeKwArgs) -> None: ... @abstractmethod def copy(self) -> Self: ... @@ -215,117 +216,117 @@ class SolidShape(LineShape): def getBounds(self) -> tuple[float, float, float, float]: ... class Path(SolidShape): - points: list[float] - operators: list[float] + points: list[FloatInt] + operators: list[FloatInt] isClipPath: _BoolLike autoclose: Literal["svg", "pdf"] | None fillMode: Literal[0, 1] def __init__( self, - points: list[float] | None = None, - operators: list[float] | None = None, + points: list[FloatInt] | None = None, + operators: list[FloatInt] | None = None, isClipPath: _BoolLike = 0, autoclose: Literal["svg", "pdf"] | None = None, fillMode: Literal[0, 1] = 0, **kw: Unpack[_PathKwArgs], ) -> None: ... def copy(self) -> Self: ... - def moveTo(self, x: float, y: float) -> None: ... - def lineTo(self, x: float, y: float) -> None: ... - def curveTo(self, x1: float, y1: float, x2: float, y2: float, x3: float, y3: float) -> None: ... + def moveTo(self, x: FloatInt, y: FloatInt) -> None: ... + def lineTo(self, x: FloatInt, y: FloatInt) -> None: ... + def curveTo(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, x3: FloatInt, y3: FloatInt) -> None: ... def closePath(self) -> None: ... def getBounds(self) -> tuple[float, float, float, float]: ... EmptyClipPath: Final[Path] def getArcPoints( - centerx: float, - centery: float, - radius: float, - startangledegrees: float, - endangledegrees: float, - yradius: float | None = None, - degreedelta: float | None = None, + centerx: FloatInt, + centery: FloatInt, + radius: FloatInt, + startangledegrees: FloatInt, + endangledegrees: FloatInt, + yradius: FloatInt | None = None, + degreedelta: FloatInt | None = None, reverse: _BoolLike | None = None, ) -> list[float]: ... class ArcPath(Path): def addArc( self, - centerx: float, - centery: float, - radius: float, - startangledegrees: float, - endangledegrees: float, - yradius: float | None = None, - degreedelta: float | None = None, + centerx: FloatInt, + centery: FloatInt, + radius: FloatInt, + startangledegrees: FloatInt, + endangledegrees: FloatInt, + yradius: FloatInt | None = None, + degreedelta: FloatInt | None = None, moveTo: _BoolLike | None = None, reverse: _BoolLike | None = None, ) -> None: ... def definePath( - pathSegs: Iterable[_PathOp] = [], isClipPath: _BoolLike = 0, dx: float = 0, dy: float = 0, **kw: Unpack[_DefinePathKwArgs] + pathSegs: Iterable[_PathOp] = [], isClipPath: _BoolLike = 0, dx: FloatInt = 0, dy: FloatInt = 0, **kw: Unpack[_DefinePathKwArgs] ) -> Path: ... class Rect(SolidShape): - x: float - y: float - width: float - height: float - rx: float - ry: float + x: FloatInt + y: FloatInt + width: FloatInt + height: FloatInt + rx: FloatInt + ry: FloatInt def __init__( - self, x: float, y: float, width: float, height: float, rx: float = 0, ry: float = 0, **kw: _SolidShapeKwArgs + self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, rx: FloatInt = 0, ry: FloatInt = 0, **kw: _SolidShapeKwArgs ) -> None: ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... class Image(SolidShape): - x: float - y: float - width: float - height: float + x: FloatInt + y: FloatInt + width: FloatInt + height: FloatInt path: Incomplete - def __init__(self, x: float, y: float, width: float, height: float, path, **kw: Unpack[_SolidShapeKwArgs]) -> None: ... + def __init__(self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, path, **kw: Unpack[_SolidShapeKwArgs]) -> None: ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... class Circle(SolidShape): - cx: float - cy: float - r: float - def __init__(self, cx: float, cy: float, r: float, **kw: Unpack[_SolidShapeKwArgs]) -> None: ... + cx: FloatInt + cy: FloatInt + r: FloatInt + def __init__(self, cx: FloatInt, cy: FloatInt, r: FloatInt, **kw: Unpack[_SolidShapeKwArgs]) -> None: ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... class Ellipse(SolidShape): - cx: float - cy: float - rx: float - ry: float - def __init__(self, cx: float, cy: float, rx: float, ry: float, **kw: Unpack[_SolidShapeKwArgs]) -> None: ... + cx: FloatInt + cy: FloatInt + rx: FloatInt + ry: FloatInt + def __init__(self, cx: FloatInt, cy: FloatInt, rx: FloatInt, ry: FloatInt, **kw: Unpack[_SolidShapeKwArgs]) -> None: ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... class Wedge(SolidShape): - centerx: float - centery: float - radius: float - startangledegrees: float - endangledegrees: float - yradius: float | None + centerx: FloatInt + centery: FloatInt + radius: FloatInt + startangledegrees: FloatInt + endangledegrees: FloatInt + yradius: FloatInt | None annular: bool # NOTE: This one is not actually settable on the instance if runtime validation # is turned on, but it seems bad to disallow it anyways - degreedelta: float + degreedelta: FloatInt def __init__( self, - centerx: float, - centery: float, - radius: float, - startangledegrees: float, - endangledegrees: float, - yradius: float | None = None, + centerx: FloatInt, + centery: FloatInt, + radius: FloatInt, + startangledegrees: FloatInt, + endangledegrees: FloatInt, + yradius: FloatInt | None = None, annular: bool = False, **kw: Unpack[_WedgeKwArgs], ) -> None: ... @@ -334,43 +335,43 @@ class Wedge(SolidShape): def getBounds(self) -> tuple[float, float, float, float]: ... class Polygon(SolidShape): - points: list[float] - def __init__(self, points: list[float] = [], **kw: Unpack[_SolidShapeKwArgs]) -> None: ... + points: list[FloatInt] + def __init__(self, points: list[FloatInt] = [], **kw: Unpack[_SolidShapeKwArgs]) -> None: ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... class PolyLine(LineShape): - points: list[float] - def __init__(self, points: list[float] = [], **kw: Unpack[_SolidShapeKwArgs]) -> None: ... + points: list[FloatInt] + def __init__(self, points: list[FloatInt] = [], **kw: Unpack[_SolidShapeKwArgs]) -> None: ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... class Hatching(Path): - xyLists: Sequence[tuple[float, float]] - angles: Sequence[float] - spacings: Sequence[float] + xyLists: Sequence[tuple[FloatInt, FloatInt]] + angles: Sequence[FloatInt] + spacings: Sequence[FloatInt] def __init__( self, - spacings: float | Sequence[float] = 2, - angles: float | Sequence[float] = 45, - xyLists: Sequence[tuple[float, float] | list[float]] = [], + spacings: FloatInt | Sequence[FloatInt] = 2, + angles: FloatInt | Sequence[FloatInt] = 45, + xyLists: Sequence[tuple[FloatInt, FloatInt] | list[FloatInt]] = [], **kwds: Unpack[_AllPathKwArgs], ) -> None: ... def numericXShift( - tA, text: str, w: float, fontName: str, fontSize: float, encoding: str | None = None, pivotCharacter: str = "." + tA, text: str, w: FloatInt, fontName: str, fontSize: FloatInt, encoding: str | None = None, pivotCharacter: str = "." ) -> float: ... class String(Shape): encoding: str - x: float - y: float + x: FloatInt + y: FloatInt text: str textAnchor: Literal["start", "middle", "end", "numeric"] fontName: str - fontSize: float + fontSize: FloatInt fillColor: Color | None - def __init__(self, x: float, y: float, text: str, **kw: Unpack[_StringKwArgs]) -> None: ... + def __init__(self, x: FloatInt, y: FloatInt, text: str, **kw: Unpack[_StringKwArgs]) -> None: ... def getEast(self): ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... diff --git a/stubs/reportlab/reportlab/graphics/transform.pyi b/stubs/reportlab/reportlab/graphics/transform.pyi index 820531addd22..d66c6be9993f 100644 --- a/stubs/reportlab/reportlab/graphics/transform.pyi +++ b/stubs/reportlab/reportlab/graphics/transform.pyi @@ -1,9 +1,10 @@ +from _typeshed import FloatInt def nullTransform(): ... -def translate(dx: float, dy: float = 0): ... -def scale(sx: float, sy: float = 1): ... -def rotate(angle: float, cx: float = 0, cy: float = 0): ... -def skewX(angle: float): ... -def skewY(angle: float): ... +def translate(dx: FloatInt, dy: FloatInt = 0): ... +def scale(sx: FloatInt, sy: FloatInt = 1): ... +def rotate(angle: FloatInt, cx: FloatInt = 0, cy: FloatInt = 0): ... +def skewX(angle: FloatInt): ... +def skewY(angle: FloatInt): ... def mmult(A, B): ... def combineTransforms(*T): ... def inverse(A): ... diff --git a/stubs/reportlab/reportlab/graphics/widgetbase.pyi b/stubs/reportlab/reportlab/graphics/widgetbase.pyi index b937f01cc9e7..28c777cd6815 100644 --- a/stubs/reportlab/reportlab/graphics/widgetbase.pyi +++ b/stubs/reportlab/reportlab/graphics/widgetbase.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -25,7 +26,7 @@ class ScaleWidget(Widget): y: Incomplete contents: Incomplete scale: Incomplete - def __init__(self, x: int = 0, y: int = 0, scale: float = 1.0, contents=None) -> None: ... + def __init__(self, x: int = 0, y: int = 0, scale: FloatInt = 1.0, contents=None) -> None: ... def draw(self): ... class CloneMixin: diff --git a/stubs/reportlab/reportlab/graphics/widgets/signsandsymbols.pyi b/stubs/reportlab/reportlab/graphics/widgets/signsandsymbols.pyi index 6b520e461fa5..add1645d4248 100644 --- a/stubs/reportlab/reportlab/graphics/widgets/signsandsymbols.pyi +++ b/stubs/reportlab/reportlab/graphics/widgets/signsandsymbols.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -12,7 +13,7 @@ class _Symbol(Widget): size: int fillColor: Incomplete strokeColor: Incomplete - strokeWidth: float + strokeWidth: FloatInt def __init__(self) -> None: ... def demo(self): ... @@ -156,7 +157,7 @@ class CrossHair(_Symbol): size: int fillColor: Incomplete strokeColor: Incomplete - strokeWidth: float + strokeWidth: FloatInt innerGap: str def __init__(self) -> None: ... def draw(self): ... diff --git a/stubs/reportlab/reportlab/graphics/widgets/table.pyi b/stubs/reportlab/reportlab/graphics/widgets/table.pyi index a38683fb2e8c..732cccac73c3 100644 --- a/stubs/reportlab/reportlab/graphics/widgets/table.pyi +++ b/stubs/reportlab/reportlab/graphics/widgets/table.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final @@ -14,11 +15,11 @@ class TableWidget(Widget): height: int borderStrokeColor: Incomplete fillColor: Incomplete - borderStrokeWidth: float + borderStrokeWidth: FloatInt horizontalDividerStrokeColor: Incomplete verticalDividerStrokeColor: Incomplete - horizontalDividerStrokeWidth: float - verticalDividerStrokeWidth: float + horizontalDividerStrokeWidth: FloatInt + verticalDividerStrokeWidth: FloatInt dividerDashArray: Incomplete data: Incomplete boxAnchor: str diff --git a/stubs/reportlab/reportlab/lib/colors.pyi b/stubs/reportlab/reportlab/lib/colors.pyi index de0de9789c00..ed73b7dc33d4 100644 --- a/stubs/reportlab/reportlab/lib/colors.pyi +++ b/stubs/reportlab/reportlab/lib/colors.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Iterator from typing import Final, Literal, TypeAlias, TypeVar, overload, type_check_only from typing_extensions import Self @@ -5,16 +6,16 @@ from typing_extensions import Self _ColorT = TypeVar("_ColorT", bound=Color) # NOTE: Reportlab is very inconsistent and sometimes uses the interpretation # used in reportlab.pdfgen.textobject instead, so we pick a different name -_ConvertibleToColor: TypeAlias = Color | list[float] | tuple[float, float, float, float] | tuple[float, float, float] | str | int +_ConvertibleToColor: TypeAlias = Color | list[FloatInt] | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | str | int __version__: Final[str] class Color: - red: float - green: float - blue: float - alpha: float - def __init__(self, red: float = 0, green: float = 0, blue: float = 0, alpha: float = 1) -> None: ... + red: FloatInt + green: FloatInt + blue: FloatInt + alpha: FloatInt + def __init__(self, red: FloatInt = 0, green: FloatInt = 0, blue: FloatInt = 0, alpha: FloatInt = 1) -> None: ... @property def __key__(self) -> tuple[float, ...]: ... def __hash__(self) -> int: ... @@ -44,24 +45,24 @@ class Color: def opaqueColor(c: object) -> bool: ... class CMYKColor(Color): - cyan: float - magenta: float - yellow: float - black: float + cyan: FloatInt + magenta: FloatInt + yellow: FloatInt + black: FloatInt spotName: str | None - density: float + density: FloatInt knockout: bool | None - alpha: float + alpha: FloatInt def __init__( self, - cyan: float = 0, - magenta: float = 0, - yellow: float = 0, - black: float = 0, + cyan: FloatInt = 0, + magenta: FloatInt = 0, + yellow: FloatInt = 0, + black: FloatInt = 0, spotName: str | None = None, - density: float = 1, + density: FloatInt = 1, knockout: bool | None = None, - alpha: float = 1, + alpha: FloatInt = 1, ) -> None: ... def fader(self, n: int, reverse: bool = False) -> list[Self]: ... def cmyk(self) -> tuple[float, float, float, float]: ... @@ -70,49 +71,49 @@ class CMYKColor(Color): class PCMYKColor(CMYKColor): def __init__( self, - cyan: float, - magenta: float, - yellow: float, - black: float, - density: float = 100, + cyan: FloatInt, + magenta: FloatInt, + yellow: FloatInt, + black: FloatInt, + density: FloatInt = 100, spotName: str | None = None, knockout: bool | None = None, - alpha: float = 100, + alpha: FloatInt = 100, ) -> None: ... class CMYKColorSep(CMYKColor): def __init__( self, - cyan: float = 0, - magenta: float = 0, - yellow: float = 0, - black: float = 0, + cyan: FloatInt = 0, + magenta: FloatInt = 0, + yellow: FloatInt = 0, + black: FloatInt = 0, spotName: str | None = None, - density: float = 1, - alpha: float = 1, + density: FloatInt = 1, + alpha: FloatInt = 1, ) -> None: ... class PCMYKColorSep(PCMYKColor, CMYKColorSep): def __init__( self, - cyan: float = 0, - magenta: float = 0, - yellow: float = 0, - black: float = 0, + cyan: FloatInt = 0, + magenta: FloatInt = 0, + yellow: FloatInt = 0, + black: FloatInt = 0, spotName: str | None = None, - density: float = 100, - alpha: float = 100, + density: FloatInt = 100, + alpha: FloatInt = 100, ) -> None: ... -def cmyk2rgb(cmyk: tuple[float, float, float, float], density: float = 1) -> tuple[float, float, float]: ... -def rgb2cmyk(r: float, g: float, b: float) -> tuple[float, float, float, float]: ... +def cmyk2rgb(cmyk: tuple[FloatInt, FloatInt, FloatInt, FloatInt], density: FloatInt = 1) -> tuple[float, float, float]: ... +def rgb2cmyk(r: FloatInt, g: FloatInt, b: FloatInt) -> tuple[float, float, float, float]: ... def color2bw(colorRGB: Color) -> Color: ... def HexColor(val: str | int, htmlOnly: bool = False, hasAlpha: bool = False) -> Color: ... -def linearlyInterpolatedColor(c0: _ColorT, c1: _ColorT, x0: float, x1: float, x: float) -> _ColorT: ... +def linearlyInterpolatedColor(c0: _ColorT, c1: _ColorT, x0: FloatInt, x1: FloatInt, x: FloatInt) -> _ColorT: ... @overload def obj_R_G_B( - c: Color | list[float] | tuple[float, float, float, float] | tuple[float, float, float], + c: Color | list[FloatInt] | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt], ) -> tuple[float, float, float]: ... @overload def obj_R_G_B(c: None) -> None: ... @@ -289,8 +290,8 @@ def describe(aColor: Color, mode: Literal[1]) -> str: ... @overload def describe(aColor: Color, mode: Literal[2]) -> tuple[str, float]: ... -def hue2rgb(m1: float, m2: float, h: float) -> float: ... -def hsl2rgb(h: float, s: float, l: float) -> tuple[float, float, float]: ... +def hue2rgb(m1: FloatInt, m2: FloatInt, h: FloatInt) -> float: ... +def hsl2rgb(h: FloatInt, s: FloatInt, l: FloatInt) -> tuple[float, float, float]: ... @type_check_only class _cssParse: @@ -299,7 +300,7 @@ class _cssParse: def rgbVal(self, v: str) -> float: ... def floatVal(self, v: str) -> float: ... def hueVal(self, v: str) -> float: ... - def alphaVal(self, v: str, c: float = 1, n: str = "alpha") -> float: ... + def alphaVal(self, v: str, c: FloatInt = 1, n: str = "alpha") -> float: ... s: str def __call__(self, s: str) -> Color: ... @@ -320,6 +321,6 @@ def toColorOrNone(arg: None, default: Color | None) -> None: ... def toColorOrNone(arg: _ConvertibleToColor, default: Color | None = None) -> Color: ... def setColors(**kw: _ConvertibleToColor) -> None: ... -def Whiter(c: _ColorT, f: float) -> _ColorT: ... -def Blacker(c: _ColorT, f: float) -> _ColorT: ... -def fade(aSpotColor: CMYKColor, percentages: Iterable[float]) -> list[CMYKColor]: ... +def Whiter(c: _ColorT, f: FloatInt) -> _ColorT: ... +def Blacker(c: _ColorT, f: FloatInt) -> _ColorT: ... +def fade(aSpotColor: CMYKColor, percentages: Iterable[FloatInt]) -> list[CMYKColor]: ... diff --git a/stubs/reportlab/reportlab/lib/corp.pyi b/stubs/reportlab/reportlab/lib/corp.pyi index 9c71b4a4cc9f..b1464abc667d 100644 --- a/stubs/reportlab/reportlab/lib/corp.pyi +++ b/stubs/reportlab/reportlab/lib/corp.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterable from typing import Final @@ -12,11 +13,11 @@ __version__: Final[str] class RL_CorpLogo(Widget): fillColor: Incomplete strokeColor: Incomplete - strokeWidth: float + strokeWidth: FloatInt background: Incomplete border: Incomplete borderWidth: int - shadow: float + shadow: FloatInt height: int width: int x: int diff --git a/stubs/reportlab/reportlab/lib/geomutils.pyi b/stubs/reportlab/reportlab/lib/geomutils.pyi index 1fec093fb40c..8774ccb6d0e4 100644 --- a/stubs/reportlab/reportlab/lib/geomutils.pyi +++ b/stubs/reportlab/reportlab/lib/geomutils.pyi @@ -1,5 +1,6 @@ +from _typeshed import FloatInt from typing import Final __version__: Final[str] -def normalizeTRBL(p: float | tuple[float, ...] | list[float]) -> tuple[float, ...]: ... +def normalizeTRBL(p: FloatInt | tuple[FloatInt, ...] | list[FloatInt]) -> tuple[float, ...]: ... diff --git a/stubs/reportlab/reportlab/lib/pagesizes.pyi b/stubs/reportlab/reportlab/lib/pagesizes.pyi index 617b42c9338c..a05f82c54889 100644 --- a/stubs/reportlab/reportlab/lib/pagesizes.pyi +++ b/stubs/reportlab/reportlab/lib/pagesizes.pyi @@ -1,51 +1,52 @@ +from _typeshed import FloatInt from typing import Final __version__: Final[str] -A0: Final[tuple[float, float]] -A1: Final[tuple[float, float]] -A2: Final[tuple[float, float]] -A3: Final[tuple[float, float]] -A4: Final[tuple[float, float]] -A5: Final[tuple[float, float]] -A6: Final[tuple[float, float]] -A7: Final[tuple[float, float]] -A8: Final[tuple[float, float]] -A9: Final[tuple[float, float]] -A10: Final[tuple[float, float]] -B0: Final[tuple[float, float]] -B1: Final[tuple[float, float]] -B2: Final[tuple[float, float]] -B3: Final[tuple[float, float]] -B4: Final[tuple[float, float]] -B5: Final[tuple[float, float]] -B6: Final[tuple[float, float]] -B7: Final[tuple[float, float]] -B8: Final[tuple[float, float]] -B9: Final[tuple[float, float]] -B10: Final[tuple[float, float]] -C0: Final[tuple[float, float]] -C1: Final[tuple[float, float]] -C2: Final[tuple[float, float]] -C3: Final[tuple[float, float]] -C4: Final[tuple[float, float]] -C5: Final[tuple[float, float]] -C6: Final[tuple[float, float]] -C7: Final[tuple[float, float]] -C8: Final[tuple[float, float]] -C9: Final[tuple[float, float]] -C10: Final[tuple[float, float]] -LETTER: Final[tuple[float, float]] -LEGAL: Final[tuple[float, float]] -ELEVENSEVENTEEN: Final[tuple[float, float]] -JUNIOR_LEGAL: Final[tuple[float, float]] -HALF_LETTER: Final[tuple[float, float]] -GOV_LETTER: Final[tuple[float, float]] -GOV_LEGAL: Final[tuple[float, float]] -TABLOID: Final[tuple[float, float]] -LEDGER: Final[tuple[float, float]] -letter: Final[tuple[float, float]] -legal: Final[tuple[float, float]] -elevenSeventeen: Final[tuple[float, float]] +A0: Final[tuple[FloatInt, FloatInt]] +A1: Final[tuple[FloatInt, FloatInt]] +A2: Final[tuple[FloatInt, FloatInt]] +A3: Final[tuple[FloatInt, FloatInt]] +A4: Final[tuple[FloatInt, FloatInt]] +A5: Final[tuple[FloatInt, FloatInt]] +A6: Final[tuple[FloatInt, FloatInt]] +A7: Final[tuple[FloatInt, FloatInt]] +A8: Final[tuple[FloatInt, FloatInt]] +A9: Final[tuple[FloatInt, FloatInt]] +A10: Final[tuple[FloatInt, FloatInt]] +B0: Final[tuple[FloatInt, FloatInt]] +B1: Final[tuple[FloatInt, FloatInt]] +B2: Final[tuple[FloatInt, FloatInt]] +B3: Final[tuple[FloatInt, FloatInt]] +B4: Final[tuple[FloatInt, FloatInt]] +B5: Final[tuple[FloatInt, FloatInt]] +B6: Final[tuple[FloatInt, FloatInt]] +B7: Final[tuple[FloatInt, FloatInt]] +B8: Final[tuple[FloatInt, FloatInt]] +B9: Final[tuple[FloatInt, FloatInt]] +B10: Final[tuple[FloatInt, FloatInt]] +C0: Final[tuple[FloatInt, FloatInt]] +C1: Final[tuple[FloatInt, FloatInt]] +C2: Final[tuple[FloatInt, FloatInt]] +C3: Final[tuple[FloatInt, FloatInt]] +C4: Final[tuple[FloatInt, FloatInt]] +C5: Final[tuple[FloatInt, FloatInt]] +C6: Final[tuple[FloatInt, FloatInt]] +C7: Final[tuple[FloatInt, FloatInt]] +C8: Final[tuple[FloatInt, FloatInt]] +C9: Final[tuple[FloatInt, FloatInt]] +C10: Final[tuple[FloatInt, FloatInt]] +LETTER: Final[tuple[FloatInt, FloatInt]] +LEGAL: Final[tuple[FloatInt, FloatInt]] +ELEVENSEVENTEEN: Final[tuple[FloatInt, FloatInt]] +JUNIOR_LEGAL: Final[tuple[FloatInt, FloatInt]] +HALF_LETTER: Final[tuple[FloatInt, FloatInt]] +GOV_LETTER: Final[tuple[FloatInt, FloatInt]] +GOV_LEGAL: Final[tuple[FloatInt, FloatInt]] +TABLOID: Final[tuple[FloatInt, FloatInt]] +LEDGER: Final[tuple[FloatInt, FloatInt]] +letter: Final[tuple[FloatInt, FloatInt]] +legal: Final[tuple[FloatInt, FloatInt]] +elevenSeventeen: Final[tuple[FloatInt, FloatInt]] -def landscape(pagesize: tuple[float, float]) -> tuple[float, float]: ... -def portrait(pagesize: tuple[float, float]) -> tuple[float, float]: ... +def landscape(pagesize: tuple[FloatInt, FloatInt]) -> tuple[float, float]: ... +def portrait(pagesize: tuple[FloatInt, FloatInt]) -> tuple[float, float]: ... diff --git a/stubs/reportlab/reportlab/lib/rl_accel.pyi b/stubs/reportlab/reportlab/lib/rl_accel.pyi index fb6dcc74b0a4..4eeee3101fbc 100644 --- a/stubs/reportlab/reportlab/lib/rl_accel.pyi +++ b/stubs/reportlab/reportlab/lib/rl_accel.pyi @@ -1,10 +1,11 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Literal def fp_str(*a) -> str: ... def unicode2T1(utext, fonts) -> list[tuple[Incomplete, Incomplete]]: ... -def instanceStringWidthT1(self, text: str, size: float, encoding: str = "utf8") -> float: ... -def instanceStringWidthTTF(self, text: str, size: float, encoding: str = "utf8") -> float: ... +def instanceStringWidthT1(self, text: str, size: FloatInt, encoding: str = "utf8") -> float: ... +def instanceStringWidthTTF(self, text: str, size: FloatInt, encoding: str = "utf8") -> float: ... def hex32(i) -> str: ... def add32(x: int, y: int) -> int: ... def calcChecksum(data: str | bytes) -> int: ... diff --git a/stubs/reportlab/reportlab/lib/styles.pyi b/stubs/reportlab/reportlab/lib/styles.pyi index 6e550700e5eb..64090de65889 100644 --- a/stubs/reportlab/reportlab/lib/styles.pyi +++ b/stubs/reportlab/reportlab/lib/styles.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Any, ClassVar, Literal, TypeAlias, TypeVar, overload from typing_extensions import Self @@ -26,45 +27,45 @@ class PropertySet: class ParagraphStyle(PropertySet): # NOTE: We list the attributes this has for sure due to defaults fontName: str - fontSize: float - leading: float - leftIndent: float - rightIndent: float - firstLineIndent: float + fontSize: FloatInt + leading: FloatInt + leftIndent: FloatInt + rightIndent: FloatInt + firstLineIndent: FloatInt alignment: _Alignment - spaceBefore: float - spaceAfter: float + spaceBefore: FloatInt + spaceAfter: FloatInt bulletFontName: str - bulletFontSize: float - bulletIndent: float + bulletFontSize: FloatInt + bulletIndent: FloatInt textColor: Color backColor: Color | None wordWrap: Incomplete | None - borderWidth: float - borderPadding: float + borderWidth: FloatInt + borderPadding: FloatInt borderColor: Color | None - borderRadius: float | None + borderRadius: FloatInt | None allowWidows: Incomplete allowOrphans: Incomplete textTransform: Incomplete | None endDots: Incomplete | None splitLongWords: Incomplete - underlineWidth: float - bulletAnchor: Literal["start", "middle", "end"] | float + underlineWidth: FloatInt + bulletAnchor: Literal["start", "middle", "end"] | FloatInt justifyLastLine: Incomplete justifyBreaks: Incomplete - spaceShrinkage: float - strikeWidth: float - underlineOffset: float - underlineGap: float - strikeOffset: float - strikeGap: float + spaceShrinkage: FloatInt + strikeWidth: FloatInt + underlineOffset: FloatInt + underlineGap: FloatInt + strikeOffset: FloatInt + strikeGap: FloatInt linkUnderline: Incomplete underlineColor: Color | None strikeColor: Color | None hyphenationLang: str embeddedHyphenation: Incomplete - uriWasteReduce: float + uriWasteReduce: FloatInt # NOTE: We redefine __init__ for the same reason def __init__( self, @@ -72,45 +73,45 @@ class ParagraphStyle(PropertySet): parent: PropertySet | None = None, *, fontName: str = ..., - fontSize: float = ..., - leading: float = ..., - leftIndent: float = ..., - rightIndent: float = ..., - firstLineIndent: float = ..., + fontSize: FloatInt = ..., + leading: FloatInt = ..., + leftIndent: FloatInt = ..., + rightIndent: FloatInt = ..., + firstLineIndent: FloatInt = ..., alignment: _Alignment = ..., - spaceBefore: float = ..., - spaceAfter: float = ..., + spaceBefore: FloatInt = ..., + spaceAfter: FloatInt = ..., bulletFontName: str = ..., - bulletFontSize: float = ..., - bulletIndent: float = ..., + bulletFontSize: FloatInt = ..., + bulletIndent: FloatInt = ..., textColor: Color = ..., backColor: Color | None = ..., wordWrap: Incomplete | None = ..., - borderWidth: float = ..., - borderPadding: float = ..., + borderWidth: FloatInt = ..., + borderPadding: FloatInt = ..., borderColor: Color | None = ..., - borderRadius: float | None = ..., + borderRadius: FloatInt | None = ..., allowWidows=..., allowOrphans=..., textTransform: Incomplete | None = ..., endDots: Incomplete | None = ..., splitLongWords=..., - underlineWidth: float = ..., - bulletAnchor: Literal["start", "middle", "end"] | float = ..., + underlineWidth: FloatInt = ..., + bulletAnchor: Literal["start", "middle", "end"] | FloatInt = ..., justifyLastLine=..., justifyBreaks=..., - spaceShrinkage: float = ..., - strikeWidth: float = ..., - underlineOffset: float = ..., - underlineGap: float = ..., - strikeOffset: float = ..., - strikeGap: float = ..., + spaceShrinkage: FloatInt = ..., + strikeWidth: FloatInt = ..., + underlineOffset: FloatInt = ..., + underlineGap: FloatInt = ..., + strikeOffset: FloatInt = ..., + strikeGap: FloatInt = ..., linkUnderline=..., underlineColor: Color | None = ..., strikeColor: Color | None = ..., hyphenationLang: str = ..., embeddedHyphenation=..., - uriWasteReduce: float = ..., + uriWasteReduce: FloatInt = ..., **kw: Any, ) -> None: ... @@ -121,24 +122,24 @@ def str2alignment( class LineStyle(PropertySet): # NOTE: We list the attributes this has for sure due to defaults - width: float + width: FloatInt color: Color def prepareCanvas(self, canvas) -> None: ... # NOTE: We redefine __init__ for the same reason def __init__( - self, name: str, parent: PropertySet | None = None, *, width: float = ..., color: Color = ..., **kw: Any + self, name: str, parent: PropertySet | None = None, *, width: FloatInt = ..., color: Color = ..., **kw: Any ) -> None: ... class ListStyle(PropertySet): # NOTE: We list the attributes this has for sure due to defaults - leftIndent: float - rightIndent: float + leftIndent: FloatInt + rightIndent: FloatInt bulletAlign: _Alignment bulletType: str bulletColor: Color bulletFontName: str - bulletFontSize: float - bulletOffsetY: float + bulletFontSize: FloatInt + bulletOffsetY: FloatInt bulletDedent: Incomplete bulletDir: Incomplete bulletFormat: Incomplete | None @@ -149,14 +150,14 @@ class ListStyle(PropertySet): name: str, parent: PropertySet | None = None, *, - leftIndent: float = ..., - rightIndent: float = ..., + leftIndent: FloatInt = ..., + rightIndent: FloatInt = ..., bulletAlign: _Alignment = ..., bulletType: str = ..., bulletColor: Color = ..., bulletFontName: str = ..., - bulletFontSize: float = ..., - bulletOffsetY: float = ..., + bulletFontSize: FloatInt = ..., + bulletOffsetY: FloatInt = ..., bulletDedent=..., bulletDir=..., bulletFormat: Incomplete | None = ..., diff --git a/stubs/reportlab/reportlab/lib/testutils.pyi b/stubs/reportlab/reportlab/lib/testutils.pyi index 7a55147e3739..7a67f4c465e6 100644 --- a/stubs/reportlab/reportlab/lib/testutils.pyi +++ b/stubs/reportlab/reportlab/lib/testutils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re import unittest from _typeshed import Incomplete, StrPath, Unused @@ -7,7 +8,7 @@ from typing import Final, Literal __version__: Final[str] -def invariantSeed(n: float | str | bytes | bytearray | None) -> None: ... +def invariantSeed(n: FloatInt | str | bytes | bytearray | None) -> None: ... def haveRenderPM() -> ModuleType | Literal[False]: ... DEJAVUSANS: Final = ("DejaVuSans", "DejaVuSans-Bold", "DejaVuSans-Oblique", "DejaVuSans-BoldOblique") @@ -53,7 +54,7 @@ class SecureTestCase(unittest.TestCase): class NearTestCase(unittest.TestCase): @staticmethod - def assertNear(a, b, accuracy: float = 1e-05) -> None: ... + def assertNear(a, b, accuracy: FloatInt = 1e-05) -> None: ... class ScriptThatMakesFileTest(unittest.TestCase): scriptDir: Incomplete diff --git a/stubs/reportlab/reportlab/lib/textsplit.pyi b/stubs/reportlab/reportlab/lib/textsplit.pyi index 8ad3489c99a2..0f9419b4022b 100644 --- a/stubs/reportlab/reportlab/lib/textsplit.pyi +++ b/stubs/reportlab/reportlab/lib/textsplit.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re from _typeshed import Incomplete, ReadableBuffer from collections.abc import Sequence @@ -10,11 +11,11 @@ CANNOT_END_LINE: Final[Sequence[str]] ALL_CANNOT_END: Final[str] def is_multi_byte(ch: str | bytes | bytearray) -> bool: ... -def getCharWidths(word: str, fontName: str, fontSize: float) -> list[float]: ... +def getCharWidths(word: str, fontName: str, fontSize: FloatInt) -> list[float]: ... def wordSplit(word, maxWidths, fontName, fontSize, encoding: str = "utf8") -> list[list[Incomplete]]: ... def dumbSplit(word, widths, maxWidths) -> list[list[Incomplete]]: ... def kinsokuShoriSplit(word, widths, availWidth) -> None: ... rx: re.Pattern[str] -def cjkwrap(text: ReadableBuffer, width: float, encoding: str = "utf8"): ... +def cjkwrap(text: ReadableBuffer, width: FloatInt, encoding: str = "utf8"): ... diff --git a/stubs/reportlab/reportlab/lib/units.pyi b/stubs/reportlab/reportlab/lib/units.pyi index c22f629a211c..5c027c1b0553 100644 --- a/stubs/reportlab/reportlab/lib/units.pyi +++ b/stubs/reportlab/reportlab/lib/units.pyi @@ -1,9 +1,10 @@ +from _typeshed import FloatInt from typing import Final __version__: Final[str] -inch: Final[float] -cm: Final[float] -mm: Final[float] -pica: Final[float] +inch: Final[FloatInt] +cm: Final[FloatInt] +mm: Final[FloatInt] +pica: Final[FloatInt] def toLength(s: str) -> float: ... diff --git a/stubs/reportlab/reportlab/lib/utils.pyi b/stubs/reportlab/reportlab/lib/utils.pyi index 3bf77cd48950..ef8211fa3648 100644 --- a/stubs/reportlab/reportlab/lib/utils.pyi +++ b/stubs/reportlab/reportlab/lib/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime as _datetime import zipimport from _typeshed import Incomplete, SupportsItems @@ -155,7 +156,7 @@ class _FmtSelfDict: class FmtSelfDict: ... -def simpleSplit(text: str | bytes, fontName: str | None, fontSize: float, maxWidth: float | None): ... +def simpleSplit(text: str | bytes, fontName: str | None, fontSize: FloatInt, maxWidth: FloatInt | None): ... @overload def escapeTextOnce(text: None) -> None: ... @@ -179,14 +180,14 @@ class RLString(str): def makeFileName(s): ... class FixedOffsetTZ(_datetime.tzinfo): - def __init__(self, h: float, m: float, name: str | None) -> None: ... + def __init__(self, h: FloatInt, m: FloatInt, name: str | None) -> None: ... def utcoffset(self, dt: _datetime.datetime | None) -> _datetime.timedelta: ... def tzname(self, dt: _datetime.datetime | None) -> str | None: ... def dst(self, dt: _datetime.datetime | None) -> _datetime.timedelta: ... class TimeStamp: tzname: str - t: float + t: FloatInt lt: struct_time | _TimeTuple YMDhms: tuple[int, ...] dhh: int diff --git a/stubs/reportlab/reportlab/pdfbase/acroform.pyi b/stubs/reportlab/reportlab/pdfbase/acroform.pyi index aa8f2288ac84..1674288fe1dc 100644 --- a/stubs/reportlab/reportlab/pdfbase/acroform.pyi +++ b/stubs/reportlab/reportlab/pdfbase/acroform.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from weakref import ReferenceType @@ -64,7 +65,7 @@ class AcroForm(PDFObject): def zdMark(self, c, size, ds, iFontName) -> str: ... def getRef(self, obj): ... def getRefStr(self, obj) -> str: ... - def setDefault(self, name: str, value: Color | float | None) -> None: ... + def setDefault(self, name: str, value: Color | FloatInt | None) -> None: ... def getDefaults( self, textColor, borderColor, fillColor, borderWidth ) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... @@ -336,5 +337,5 @@ class CBMark: ymax: Incomplete points: Incomplete slack: Incomplete - def __init__(self, ops, points, bounds, slack: float = 0.05) -> None: ... + def __init__(self, ops, points, bounds, slack: FloatInt = 0.05) -> None: ... def scaledRender(self, size, ds: int = 0) -> str: ... diff --git a/stubs/reportlab/reportlab/pdfbase/pdfform.pyi b/stubs/reportlab/reportlab/pdfbase/pdfform.pyi index a747030f3d6a..f8d60fd011d0 100644 --- a/stubs/reportlab/reportlab/pdfbase/pdfform.pyi +++ b/stubs/reportlab/reportlab/pdfbase/pdfform.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal from reportlab.pdfbase.pdfdoc import PDFDictionary, PDFObject, PDFStream, PDFString @@ -9,8 +10,8 @@ def textFieldAbsolute( def textFieldRelative( canvas, title, xR, yR, width, height, value: str = "", maxlen: int = 1000000, multiline: bool | Literal[0, 1] = 0 ) -> None: ... -def buttonFieldAbsolute(canvas, title, value, x, y, width: float = 16.7704, height: float = 14.907) -> None: ... -def buttonFieldRelative(canvas, title, value, xR, yR, width: float = 16.7704, height: float = 14.907) -> None: ... +def buttonFieldAbsolute(canvas, title, value, x, y, width: FloatInt = 16.7704, height: FloatInt = 14.907) -> None: ... +def buttonFieldRelative(canvas, title, value, xR, yR, width: FloatInt = 16.7704, height: FloatInt = 14.907) -> None: ... def selectFieldAbsolute(canvas, title, value, options, x, y, width, height) -> None: ... def selectFieldRelative(canvas, title, value, options, xR, yR, width, height) -> None: ... def getForm(canvas) -> AcroForm: ... @@ -22,7 +23,7 @@ class AcroForm(PDFObject): self, canvas, title, xmin, ymin, xmax, ymax, value: str = "", maxlen: int = 1000000, multiline: bool | Literal[0, 1] = 0 ) -> None: ... def selectField(self, canvas, title, value, options, xmin, ymin, xmax, ymax) -> None: ... - def buttonField(self, canvas, title, value, xmin, ymin, width: float = 16.7704, height: float = 14.907) -> None: ... + def buttonField(self, canvas, title, value, xmin, ymin, width: FloatInt = 16.7704, height: FloatInt = 14.907) -> None: ... def format(self, document) -> bytes: ... FormPattern: list[str | list[str] | PDFString | PDFPatternIf] @@ -54,7 +55,7 @@ def TextField( fontsize: int = 9, R: int = 0, G: int = 0, - B: float = 0.627, + B: FloatInt = 0.627, multiline: bool | Literal[0, 1] = 0, ) -> PDFPattern: ... @@ -73,14 +74,14 @@ def SelectField( fontsize: int = 9, R: int = 0, G: int = 0, - B: float = 0.627, + B: FloatInt = 0.627, ) -> PDFPattern: ... SelectFieldPattern: list[str | list[str]] -def ButtonField(title, value, xmin, ymin, page, width: float = 16.7704, height: float = 14.907) -> PDFPattern: ... +def ButtonField(title, value, xmin, ymin, page, width: FloatInt = 16.7704, height: FloatInt = 14.907) -> PDFPattern: ... ButtonFieldPattern: list[str | list[str] | PDFString] -def buttonStreamDictionary(width: float = 16.7704, height: float = 14.907) -> PDFDictionary: ... -def ButtonStream(content, width: float = 16.7704, height: float = 14.907) -> PDFStream: ... +def buttonStreamDictionary(width: FloatInt = 16.7704, height: FloatInt = 14.907) -> PDFDictionary: ... +def ButtonStream(content, width: FloatInt = 16.7704, height: FloatInt = 14.907) -> PDFStream: ... diff --git a/stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi b/stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi index a6eb59a2079d..fe0d96530043 100644 --- a/stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi +++ b/stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, StrOrBytesPath from typing import ClassVar, Final, Literal @@ -58,7 +59,7 @@ class Font: substitutionFonts: Incomplete shapable: bool def __init__(self, name, faceName, encName, substitutionFonts=None) -> None: ... - def stringWidth(self, text: str | bytes, size: float, encoding: str = "utf8") -> float: ... + def stringWidth(self, text: str | bytes, size: FloatInt, encoding: str = "utf8") -> float: ... widths: list[int] def addObjects(self, doc) -> None: ... @@ -85,11 +86,11 @@ def getTypeFace(faceName) -> TypeFace: ... def getEncoding(encName) -> Encoding: ... def findFontAndRegister(fontName: str) -> Font: ... def getFont(fontName: str) -> Font: ... -def getAscentDescent(fontName: str, fontSize: float | None = None) -> tuple[float, float]: ... -def getAscent(fontName: str, fontSize: float | None = None) -> float: ... -def getDescent(fontName: str, fontSize: float | None = None) -> float: ... +def getAscentDescent(fontName: str, fontSize: FloatInt | None = None) -> tuple[float, float]: ... +def getAscent(fontName: str, fontSize: FloatInt | None = None) -> float: ... +def getDescent(fontName: str, fontSize: FloatInt | None = None) -> float: ... def getRegisteredFontNames() -> list[Incomplete]: ... -def stringWidth(text: str | bytes, fontName: str, fontSize: float, encoding: str = "utf8") -> float: ... +def stringWidth(text: str | bytes, fontName: str, fontSize: FloatInt, encoding: str = "utf8") -> float: ... def dumpFontData() -> None: ... def test3widths(texts) -> None: ... diff --git a/stubs/reportlab/reportlab/pdfbase/ttfonts.pyi b/stubs/reportlab/reportlab/pdfbase/ttfonts.pyi index aab282f6c48b..0cfeedf29926 100644 --- a/stubs/reportlab/reportlab/pdfbase/ttfonts.pyi +++ b/stubs/reportlab/reportlab/pdfbase/ttfonts.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, ReadableBuffer, StrOrBytesPath from collections.abc import Sequence from typing import Final, Literal, NamedTuple @@ -161,7 +162,7 @@ class TTFont: def addObjects(self, doc) -> None: ... @property def hbFace(self) -> Incomplete | None: ... - def hbFont(self, fontSize: float = 10): ... + def hbFont(self, fontSize: FloatInt = 10): ... @property def shapable(self) -> bool: ... @@ -175,18 +176,18 @@ class ShapedFragWord(list[Incomplete]): ... class ShapeData(NamedTuple): cluster: int - x_advance: float - y_advance: float - x_offset: float - y_offset: float - width: float + x_advance: FloatInt + y_advance: FloatInt + x_offset: FloatInt + y_offset: FloatInt + width: FloatInt class ShapedStr(str): def __new__(cls, s, shapeData: ShapeData | None = None) -> Self: ... def __add__(self, other) -> ShapedStr: ... def __radd__(self, other) -> ShapedStr: ... -def shapeStr(s: str, fontName: str, fontSize: float, force: bool = False): ... +def shapeStr(s: str, fontName: str, fontSize: FloatInt, force: bool = False): ... def freshTTFont(ttfn, ttfpath, **kwds) -> TTFont: ... def makeShapedFragWord(w, K: list[Incomplete] = [], V: list[Incomplete] = []) -> type[ShapedFragWord]: ... def shapeFragWord(w, features=None, force: bool = False): ... diff --git a/stubs/reportlab/reportlab/pdfgen/canvas.pyi b/stubs/reportlab/reportlab/pdfgen/canvas.pyi index 15b3827a28b7..072f71bd4bfa 100644 --- a/stubs/reportlab/reportlab/pdfgen/canvas.pyi +++ b/stubs/reportlab/reportlab/pdfgen/canvas.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable from typing import IO, Literal @@ -10,13 +11,13 @@ from reportlab.pdfgen.textobject import PDFTextObject, _PDFColorSetter class ShowBoundaryValue: color: _ConvertibleToColor | None - width: float + width: FloatInt dashArray: Incomplete def __init__( self, color: _ConvertibleToColor | None = (0, 0, 0), - width: float = 0.1, - dashArray: list[float] | tuple[float, ...] | None = None, + width: FloatInt = 0.1, + dashArray: list[FloatInt] | tuple[FloatInt, ...] | None = None, ) -> None: ... def __bool__(self) -> bool: ... @@ -27,7 +28,7 @@ class Canvas(_PDFColorSetter): def __init__( self, filename: str | IO[bytes], - pagesize: tuple[float, float] | None = None, + pagesize: tuple[FloatInt, FloatInt] | None = None, bottomup: bool | Literal[0, 1] = 1, pageCompression=None, invariant=None, @@ -36,9 +37,9 @@ class Canvas(_PDFColorSetter): cropMarks=None, pdfVersion=None, enforceColorSpace=None, - initialFontName: float | None = None, - initialFontSize: float | None = None, - initialLeading: float | None = None, + initialFontName: FloatInt | None = None, + initialFontSize: FloatInt | None = None, + initialLeading: FloatInt | None = None, cropBox=None, artBox=None, trimBox=None, @@ -74,10 +75,10 @@ class Canvas(_PDFColorSetter): def drawInlineImage( self, image, - x: float, - y: float, - width: float | None = None, - height: float | None = None, + x: FloatInt, + y: FloatInt, + width: FloatInt | None = None, + height: FloatInt | None = None, preserveAspectRatio: bool = False, anchor: str = "c", anchorAtXY: bool = False, @@ -87,10 +88,10 @@ class Canvas(_PDFColorSetter): def drawImage( self, image, - x: float, - y: float, - width: float | None = None, - height: float | None = None, + x: FloatInt, + y: FloatInt, + width: FloatInt | None = None, + height: FloatInt | None = None, mask=None, preserveAspectRatio: bool = False, anchor: str = "c", @@ -169,115 +170,115 @@ class Canvas(_PDFColorSetter): def getPageNumber(self) -> int: ... def save(self) -> None: ... def getpdfdata(self): ... - def setPageSize(self, size: tuple[float, float]) -> None: ... + def setPageSize(self, size: tuple[FloatInt, FloatInt]) -> None: ... def setCropBox(self, size, name: str = "crop") -> None: ... def setTrimBox(self, size) -> None: ... def setArtBox(self, size) -> None: ... def setBleedBox(self, size) -> None: ... # NOTE: Only accepts right angles - def setPageRotation(self, rot: float) -> None: ... + def setPageRotation(self, rot: FloatInt) -> None: ... def addLiteral(self, s: object, escaped: Literal[0, 1] = 1) -> None: ... def resetTransforms(self) -> None: ... - def transform(self, a: float, b: float, c: float, d: float, e: float, f: float) -> None: ... - def absolutePosition(self, x: float, y: float) -> tuple[float, float]: ... - def translate(self, dx: float, dy: float) -> None: ... - def scale(self, x: float, y: float) -> None: ... - def rotate(self, theta: float) -> None: ... - def skew(self, alpha: float, beta: float) -> None: ... + def transform(self, a: FloatInt, b: FloatInt, c: FloatInt, d: FloatInt, e: FloatInt, f: FloatInt) -> None: ... + def absolutePosition(self, x: FloatInt, y: FloatInt) -> tuple[float, float]: ... + def translate(self, dx: FloatInt, dy: FloatInt) -> None: ... + def scale(self, x: FloatInt, y: FloatInt) -> None: ... + def rotate(self, theta: FloatInt) -> None: ... + def skew(self, alpha: FloatInt, beta: FloatInt) -> None: ... def saveState(self) -> None: ... def restoreState(self) -> None: ... - def line(self, x1: float, y1: float, x2: float, y2: float) -> None: ... + def line(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt) -> None: ... def lines(self, linelist) -> None: ... def cross( self, - x: float, - y: float, - size: float = 5, - gap: float = 1, + x: FloatInt, + y: FloatInt, + size: FloatInt = 5, + gap: FloatInt = 1, text=None, strokeColor=None, - strokeWidth: float | None = None, - fontSize: float = 3, + strokeWidth: FloatInt | None = None, + fontSize: FloatInt = 3, ) -> None: ... def grid(self, xlist, ylist) -> None: ... - def bezier(self, x1: float, y1: float, x2: float, y2: float, x3: float, y3: float, x4: float, y4: float) -> None: ... - def arc(self, x1: float, y1: float, x2: float, y2: float, startAng: float = 0, extent: float = 90) -> None: ... - def rect(self, x: float, y: float, width: float, height: float, stroke: float = 1, fill: float = 0) -> None: ... - def ellipse(self, x1: float, y1: float, x2: float, y2: float, stroke: float = 1, fill: float = 0) -> None: ... + def bezier(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, x3: FloatInt, y3: FloatInt, x4: FloatInt, y4: FloatInt) -> None: ... + def arc(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, startAng: FloatInt = 0, extent: FloatInt = 90) -> None: ... + def rect(self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0) -> None: ... + def ellipse(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0) -> None: ... def wedge( - self, x1: float, y1: float, x2: float, y2: float, startAng: float, extent: float, stroke: float = 1, fill: float = 0 + self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, startAng: FloatInt, extent: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0 ) -> None: ... - def circle(self, x_cen: float, y_cen: float, r: float, stroke: float = 1, fill: float = 0) -> None: ... + def circle(self, x_cen: FloatInt, y_cen: FloatInt, r: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0) -> None: ... def roundRect( - self, x: float, y: float, width: float, height: float, radius: float, stroke: float = 1, fill: float = 0 + self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, radius: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0 ) -> None: ... def shade(self, shading) -> None: ... - def linearGradient(self, x0: float, y0: float, x1: float, y1: float, colors, positions=None, extend: bool = True) -> None: ... - def radialGradient(self, x: float, y: float, radius: float, colors, positions=None, extend: bool = True) -> None: ... + def linearGradient(self, x0: FloatInt, y0: FloatInt, x1: FloatInt, y1: FloatInt, colors, positions=None, extend: bool = True) -> None: ... + def radialGradient(self, x: FloatInt, y: FloatInt, radius: FloatInt, colors, positions=None, extend: bool = True) -> None: ... def drawString( self, - x: float, - y: float, + x: FloatInt, + y: FloatInt, text: str, mode: Literal[0, 1, 2, 3, 4, 5, 6, 7] | None = None, - charSpace: float = 0, + charSpace: FloatInt = 0, direction: Literal["LTR", "RTL"] | None = None, - wordSpace: float | None = None, + wordSpace: FloatInt | None = None, shaping: bool = False, ) -> None: ... def drawRightString( self, - x: float, - y: float, + x: FloatInt, + y: FloatInt, text: str, mode: Literal[0, 1, 2, 3, 4, 5, 6, 7] | None = None, - charSpace: float = 0, + charSpace: FloatInt = 0, direction: Literal["LTR", "RTL"] | None = None, - wordSpace: float | None = None, + wordSpace: FloatInt | None = None, shaping: bool = False, ) -> None: ... def drawCentredString( self, - x: float, - y: float, + x: FloatInt, + y: FloatInt, text: str, mode: Literal[0, 1, 2, 3, 4, 5, 6, 7] | None = None, - charSpace: float = 0, + charSpace: FloatInt = 0, direction: Literal["LTR", "RTL"] | None = None, - wordSpace: float | None = None, + wordSpace: FloatInt | None = None, shaping: bool = False, ) -> None: ... def drawAlignedString( self, - x: float, - y: float, + x: FloatInt, + y: FloatInt, text: str, pivotChar: str = ".", mode: Literal[0, 1, 2, 3, 4, 5, 6, 7] | None = None, - charSpace: float = 0, + charSpace: FloatInt = 0, direction: Literal["LTR", "RTL"] | None = None, - wordSpace: float | None = None, + wordSpace: FloatInt | None = None, shaping: bool = False, ) -> None: ... def getAvailableFonts(self) -> list[Incomplete]: ... def listLoadedFonts0(self) -> list[Incomplete]: ... - def setFont(self, psfontname: str, size: float, leading: float | None = None) -> None: ... - def setFontSize(self, size: float | None = None, leading: float | None = None) -> None: ... - def stringWidth(self, text: str, fontName: str | None = None, fontSize: float | None = None) -> float: ... - def setLineWidth(self, width: float) -> None: ... + def setFont(self, psfontname: str, size: FloatInt, leading: FloatInt | None = None) -> None: ... + def setFontSize(self, size: FloatInt | None = None, leading: FloatInt | None = None) -> None: ... + def stringWidth(self, text: str, fontName: str | None = None, fontSize: FloatInt | None = None) -> float: ... + def setLineWidth(self, width: FloatInt) -> None: ... def setLineCap(self, mode) -> None: ... def setLineJoin(self, mode) -> None: ... def setMiterLimit(self, limit) -> None: ... - def setDash(self, array: list[float] | tuple[float, ...] | float = [], phase: float = 0) -> None: ... + def setDash(self, array: list[FloatInt] | tuple[FloatInt, ...] | FloatInt = [], phase: FloatInt = 0) -> None: ... def beginPath(self) -> PDFPathObject: ... def drawPath(self, aPath, stroke: int = 1, fill: int = 0, fillMode=None) -> None: ... def clipPath(self, aPath, stroke: int = 1, fill: int = 0, fillMode=None) -> None: ... - def beginText(self, x: float = 0, y: float = 0, direction: Literal["LTR", "RTL"] | None = None) -> PDFTextObject: ... + def beginText(self, x: FloatInt = 0, y: FloatInt = 0, direction: Literal["LTR", "RTL"] | None = None) -> PDFTextObject: ... def drawText(self, aTextObject: PDFTextObject) -> None: ... def setPageCompression(self, pageCompression: bool | Literal[0, 1] | None = 1) -> None: ... def setPageDuration(self, duration=None) -> None: ... def setPageTransition( - self, effectname: str | None = None, duration: float = 1, direction: float = 0, dimension: str = "H", motion: str = "I" + self, effectname: str | None = None, duration: FloatInt = 1, direction: FloatInt = 0, dimension: str = "H", motion: str = "I" ) -> None: ... def getCurrentPageContent(self) -> str: ... def setViewerPreference(self, pref, value) -> None: ... @@ -289,7 +290,7 @@ class Canvas(_PDFColorSetter): def addPageLabel(self, pageNum, style=None, start=None, prefix=None) -> None: ... @property def acroForm(self) -> AcroForm: ... - def drawBoundary(self, sb, x1: float, y1: float, width: float, height: float) -> None: ... + def drawBoundary(self, sb, x1: FloatInt, y1: FloatInt, width: FloatInt, height: FloatInt) -> None: ... # Following callbacks are accepted: canvas, kind and label def setNamedCB(self, name: str, cb: Callable[[Canvas, str | None, str], None]) -> None: ... def getNamedCB(self, name: str) -> Callable[[Canvas, str | None, str], None] | None: ... diff --git a/stubs/reportlab/reportlab/pdfgen/textobject.pyi b/stubs/reportlab/reportlab/pdfgen/textobject.pyi index 31edb40dddb9..bd6c9556b259 100644 --- a/stubs/reportlab/reportlab/pdfgen/textobject.pyi +++ b/stubs/reportlab/reportlab/pdfgen/textobject.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, Unused from collections.abc import Callable from typing import Final, Literal, TypeAlias @@ -7,7 +8,7 @@ from reportlab.pdfbase.ttfonts import ShapedStr from reportlab.pdfgen.canvas import Canvas # NOTE: This is slightly different from what toColor accepts and interprets -_Color: TypeAlias = Color | tuple[float, float, float, float] | tuple[float, float, float] | list[float] | str +_Color: TypeAlias = Color | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | list[FloatInt] | str __version__: Final[str] log2vis: Callable[..., str | None] @@ -32,39 +33,39 @@ def bidiWordList( rtlSupport: bool class _PDFColorSetter: - def setFillColorCMYK(self, c: float, m: float, y: float, k: float, alpha: float | None = None) -> None: ... - def setStrokeColorCMYK(self, c: float, m: float, y: float, k: float, alpha: float | None = None) -> None: ... - def setFillColorRGB(self, r: float, g: float, b: float, alpha: float | None = None) -> None: ... - def setStrokeColorRGB(self, r: float, g: float, b: float, alpha: float | None = None) -> None: ... - def setFillColor(self, aColor: _Color, alpha: float | None = None) -> None: ... - def setStrokeColor(self, aColor: _Color, alpha: float | None = None) -> None: ... - def setFillGray(self, gray: float, alpha: float | None = None) -> None: ... - def setStrokeGray(self, gray: float, alpha: float | None = None) -> None: ... - def setStrokeAlpha(self, a: float) -> None: ... - def setFillAlpha(self, a: float) -> None: ... + def setFillColorCMYK(self, c: FloatInt, m: FloatInt, y: FloatInt, k: FloatInt, alpha: FloatInt | None = None) -> None: ... + def setStrokeColorCMYK(self, c: FloatInt, m: FloatInt, y: FloatInt, k: FloatInt, alpha: FloatInt | None = None) -> None: ... + def setFillColorRGB(self, r: FloatInt, g: FloatInt, b: FloatInt, alpha: FloatInt | None = None) -> None: ... + def setStrokeColorRGB(self, r: FloatInt, g: FloatInt, b: FloatInt, alpha: FloatInt | None = None) -> None: ... + def setFillColor(self, aColor: _Color, alpha: FloatInt | None = None) -> None: ... + def setStrokeColor(self, aColor: _Color, alpha: FloatInt | None = None) -> None: ... + def setFillGray(self, gray: FloatInt, alpha: FloatInt | None = None) -> None: ... + def setStrokeGray(self, gray: FloatInt, alpha: FloatInt | None = None) -> None: ... + def setStrokeAlpha(self, a: FloatInt) -> None: ... + def setFillAlpha(self, a: FloatInt) -> None: ... def setStrokeOverprint(self, a) -> None: ... def setFillOverprint(self, a) -> None: ... def setOverprintMask(self, a) -> None: ... class PDFTextObject(_PDFColorSetter): direction: Literal["LTR", "RTL"] - def __init__(self, canvas: Canvas, x: float = 0, y: float = 0, direction: Literal["LTR", "RTL"] | None = None) -> None: ... + def __init__(self, canvas: Canvas, x: FloatInt = 0, y: FloatInt = 0, direction: Literal["LTR", "RTL"] | None = None) -> None: ... def getCode(self) -> str: ... - def setTextOrigin(self, x: float, y: float) -> None: ... - def setTextTransform(self, a: float, b: float, c: float, d: float, e: float, f: float) -> None: ... - def moveCursor(self, dx: float, dy: float) -> None: ... - def setXPos(self, dx: float) -> None: ... + def setTextOrigin(self, x: FloatInt, y: FloatInt) -> None: ... + def setTextTransform(self, a: FloatInt, b: FloatInt, c: FloatInt, d: FloatInt, e: FloatInt, f: FloatInt) -> None: ... + def moveCursor(self, dx: FloatInt, dy: FloatInt) -> None: ... + def setXPos(self, dx: FloatInt) -> None: ... def getCursor(self) -> tuple[float, float]: ... def getStartOfLine(self) -> tuple[float, float]: ... def getX(self) -> float: ... def getY(self) -> float: ... - def setFont(self, psfontname: str, size: float, leading: float | None = None) -> None: ... - def setCharSpace(self, charSpace: float) -> None: ... - def setWordSpace(self, wordSpace: float) -> None: ... - def setHorizScale(self, horizScale: float) -> None: ... - def setLeading(self, leading: float) -> None: ... + def setFont(self, psfontname: str, size: FloatInt, leading: FloatInt | None = None) -> None: ... + def setCharSpace(self, charSpace: FloatInt) -> None: ... + def setWordSpace(self, wordSpace: FloatInt) -> None: ... + def setHorizScale(self, horizScale: FloatInt) -> None: ... + def setLeading(self, leading: FloatInt) -> None: ... def setTextRenderMode(self, mode: Literal[0, 1, 2, 3, 4, 5, 6, 7]) -> None: ... - def setRise(self, rise: float) -> None: ... + def setRise(self, rise: FloatInt) -> None: ... def textOut(self, text: str) -> None: ... def textLine(self, text: str = "") -> None: ... def textLines(self, stuff: list[str] | tuple[str, ...] | str, trim: Literal[0, 1] = 1) -> None: ... diff --git a/stubs/reportlab/reportlab/platypus/doctemplate.pyi b/stubs/reportlab/reportlab/platypus/doctemplate.pyi index ca2ec31b2fe3..fd8a06d661d2 100644 --- a/stubs/reportlab/reportlab/platypus/doctemplate.pyi +++ b/stubs/reportlab/reportlab/platypus/doctemplate.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Callable @@ -111,11 +112,11 @@ class FrameActionFlowable(Flowable): def frameAction(self, frame: Frame) -> None: ... class Indenter(FrameActionFlowable): - width: float - height: float - left: float - right: float - def __init__(self, left: float | str = 0, right: float | str = 0) -> None: ... + width: FloatInt + height: FloatInt + left: FloatInt + right: FloatInt + def __init__(self, left: FloatInt | str = 0, right: FloatInt | str = 0) -> None: ... def frameAction(self, frame: Frame) -> None: ... class NotAtTopPageBreak(FrameActionFlowable): @@ -133,7 +134,7 @@ class PageTemplate: frames: list[Frame] onPage: _PageCallback onPageEnd: _PageCallback - pagesize: tuple[float, float] + pagesize: tuple[FloatInt, FloatInt] autoNextPageTemplate: Incomplete cropBox: Incomplete artBox: Incomplete @@ -145,7 +146,7 @@ class PageTemplate: frames: list[Frame] | Frame = [], onPage: _PageCallback = ..., onPageEnd: _PageCallback = ..., - pagesize: tuple[float, float] | None = None, + pagesize: tuple[FloatInt, FloatInt] | None = None, autoNextPageTemplate=None, cropBox=None, artBox=None, @@ -186,12 +187,12 @@ class _DocTemplateKwargs(TypedDict, total=False): pagesize: Incomplete pageTemplates: list[PageTemplate] showBoundary: Incomplete - width: float - height: float - leftMargin: float - rightMargin: float - topMargin: float - bottomMargin: float + width: FloatInt + height: FloatInt + leftMargin: FloatInt + rightMargin: FloatInt + topMargin: FloatInt + bottomMargin: FloatInt allowSplitting: Incomplete title: Incomplete | None author: Incomplete | None @@ -234,12 +235,12 @@ class BaseDocTemplate: pagesize: Incomplete pageTemplates: list[PageTemplate] showBoundary: Incomplete - width: float - height: float - leftMargin: float - rightMargin: float - topMargin: float - bottomMargin: float + width: FloatInt + height: FloatInt + leftMargin: FloatInt + rightMargin: FloatInt + topMargin: FloatInt + bottomMargin: FloatInt allowSplitting: Incomplete title: Incomplete | None author: Incomplete | None diff --git a/stubs/reportlab/reportlab/platypus/flowables.pyi b/stubs/reportlab/reportlab/platypus/flowables.pyi index c6b57661b996..5b85bfcb9175 100644 --- a/stubs/reportlab/reportlab/platypus/flowables.pyi +++ b/stubs/reportlab/reportlab/platypus/flowables.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsRead, Unused from collections.abc import Callable, Iterable, Sequence from typing import Any, Literal, Protocol, TypeAlias, type_check_only @@ -78,8 +79,8 @@ class TraceInfo: def __init__(self) -> None: ... class Flowable: - width: float - height: float + width: FloatInt + height: FloatInt wrapped: int hAlign: _HAlignment vAlign: _VAlignment @@ -89,8 +90,8 @@ class Flowable: # NOTE: The following attributes will not exist on all flowables, but # they need to be settable on individual instances keepWithNext: Incomplete - spaceAfter: float - spaceBefore: float + spaceAfter: FloatInt + spaceBefore: FloatInt def __init__(self) -> None: ... # NOTE: We pretend the optional internal _sW argument does not exist # since not all flowables support it and we'd have to deal with @@ -98,12 +99,12 @@ class Flowable: # subclasses that rely on the argument existing when called through # super() inside their own implementation, so we can't really # make everyone happy here, sigh... - def drawOn(self, canvas: Canvas, x: float, y: float) -> None: ... - def wrapOn(self, canv: Canvas, aW: float, aH: float) -> tuple[float, float]: ... - def wrap(self, aW: float, aH: float) -> tuple[float, float]: ... + def drawOn(self, canvas: Canvas, x: FloatInt, y: FloatInt) -> None: ... + def wrapOn(self, canv: Canvas, aW: FloatInt, aH: FloatInt) -> tuple[float, float]: ... + def wrap(self, aW: FloatInt, aH: FloatInt) -> tuple[float, float]: ... def minWidth(self) -> float: ... - def splitOn(self, canv: Canvas, aW: float, aH: float) -> list[Flowable]: ... - def split(self, aW: float, aH: float, /) -> list[Flowable]: ... + def splitOn(self, canv: Canvas, aW: FloatInt, aH: FloatInt) -> list[Flowable]: ... + def split(self, aW: FloatInt, aH: FloatInt, /) -> list[Flowable]: ... def getKeepWithNext(self): ... def getSpaceAfter(self) -> float: ... def getSpaceBefore(self) -> float: ... @@ -112,7 +113,7 @@ class Flowable: class XBox(Flowable): text: str - def __init__(self, width: float, height: float, text: str = "A Box") -> None: ... + def __init__(self, width: FloatInt, height: FloatInt, text: str = "A Box") -> None: ... def draw(self) -> None: ... def splitLines(lines, maximum_length, split_characters, new_line_characters): ... @@ -142,8 +143,8 @@ class Image(Flowable): # as soon as these attributes are accessed imageWidth: int imageHeight: int - drawWidth: float - drawHeight: float + drawWidth: FloatInt + drawHeight: FloatInt def __init__( self, # TODO: I think this might also accept a PIL.Image and other @@ -151,8 +152,8 @@ class Image(Flowable): # with reportlab.lib.utils.ImageReader, except for the # potential PIL.Image shortcut filename: str | SupportsRead[bytes] | Incomplete, - width: float | None = None, - height: float | None = None, + width: FloatInt | None = None, + height: FloatInt | None = None, kind: str = "direct", mask: str = "auto", lazy: int = 1, @@ -167,8 +168,8 @@ class NullDraw(Flowable): class Spacer(NullDraw): # NOTE: This may actually be a bug, it seems likely that Spacer is meant # to set spaceBefore in the isGlue case. - spacebefore: float - def __init__(self, width: float, height: float, isGlue: bool = False) -> None: ... + spacebefore: FloatInt + def __init__(self, width: FloatInt, height: FloatInt, isGlue: bool = False) -> None: ... class UseUpSpace(NullDraw): ... @@ -182,7 +183,7 @@ class PageBreakIfNotEmpty(PageBreak): ... class CondPageBreak(Spacer): locChanger: int - def __init__(self, height: float) -> None: ... + def __init__(self, height: FloatInt) -> None: ... class _ContainerSpace: def getSpaceBefore(self) -> float: ... @@ -206,39 +207,39 @@ class Macro(Flowable): class CallerMacro(Flowable): def __init__( self, - drawCallable: Callable[[CallerMacro, float, float], object] | None = None, - wrapCallable: Callable[[CallerMacro, float, float], object] | None = None, + drawCallable: Callable[[CallerMacro, FloatInt, FloatInt], object] | None = None, + wrapCallable: Callable[[CallerMacro, FloatInt, FloatInt], object] | None = None, ) -> None: ... def draw(self) -> None: ... class ParagraphAndImage(Flowable): P: Paragraph I: Image - xpad: float - ypad: float - def __init__(self, P: Paragraph, I: Image, xpad: float = 3, ypad: float = 3, side: str = "right") -> None: ... + xpad: FloatInt + ypad: FloatInt + def __init__(self, P: Paragraph, I: Image, xpad: FloatInt = 3, ypad: FloatInt = 3, side: str = "right") -> None: ... def draw(self) -> None: ... class FailOnWrap(NullDraw): - def wrap(self, aW: float, aH: float) -> Never: ... + def wrap(self, aW: FloatInt, aH: FloatInt) -> Never: ... class FailOnDraw(Flowable): def draw(self) -> Never: ... class HRFlowable(Flowable): - width: float | str # type: ignore[assignment] - lineWidth: float + width: FloatInt | str # type: ignore[assignment] + lineWidth: FloatInt lineCap: str color: _Color dash: Incomplete | None def __init__( self, - width: float | str = "80%", - thickness: float = 1, + width: FloatInt | str = "80%", + thickness: FloatInt = 1, lineCap: str = "round", color: _Color = ..., - spaceBefore: float = 1, - spaceAfter: float = 1, + spaceBefore: FloatInt = 1, + spaceAfter: FloatInt = 1, hAlign: _HAlignment = "CENTER", vAlign: _VAlignment = "BOTTOM", dash=None, @@ -246,7 +247,7 @@ class HRFlowable(Flowable): def draw(self) -> None: ... class _Container(_ContainerSpace): - def drawOn(self, canv: Canvas, x: float, y: float) -> None: ... + def drawOn(self, canv: Canvas, x: FloatInt, y: FloatInt) -> None: ... def copyContent(self, content: _FlowableSublist | None = None) -> None: ... class PTOContainer(_Container, Flowable): # pyrefly: ignore [inconsistent-inheritance] @@ -256,15 +257,15 @@ class PTOContainer(_Container, Flowable): # pyrefly: ignore [inconsistent-inher class KeepInFrame(_Container, Flowable): # pyrefly: ignore [inconsistent-inheritance] name: str - maxWidth: float - maxHeight: float + maxWidth: FloatInt + maxHeight: FloatInt mode: Literal["error", "continue", "shrink", "truncate"] mergespace: Incomplete | None fakeWidth: bool | None def __init__( self, - maxWidth: float, - maxHeight: float, + maxWidth: FloatInt, + maxHeight: FloatInt, content: list[Flowable] = [], mergeSpace: Incomplete | None = 1, mode: Literal["error", "continue", "shrink", "truncate"] = "shrink", @@ -279,8 +280,8 @@ class PlacedStory(Flowable): self, x, y, - maxWidth: float, - maxHeight: float, + maxWidth: FloatInt, + maxHeight: FloatInt, content: list[Flowable] = [], mergeSpace: Incomplete | None = 1, mode: Literal["error", "continue", "shrink", "truncate"] = "shrink", @@ -293,7 +294,7 @@ class PlacedStory(Flowable): origin="page", ) -> None: ... def wrap(self, _aW: Unused, _aH: Unused) -> tuple[Literal[0], Literal[0]]: ... - def drawOn(self, canv: Canvas, lx: float, ly: float, _sW=0) -> None: ... + def drawOn(self, canv: Canvas, lx: FloatInt, ly: FloatInt, _sW=0) -> None: ... class _FindSplitterMixin: ... @@ -303,10 +304,10 @@ class ImageAndFlowables(_Container, _FindSplitterMixin, Flowable): # pyrefly: i self, I: Image, F: _FlowableSublist | None, - imageLeftPadding: float = 0, - imageRightPadding: float = 3, - imageTopPadding: float = 0, - imageBottomPadding: float = 3, + imageLeftPadding: FloatInt = 0, + imageRightPadding: FloatInt = 3, + imageTopPadding: FloatInt = 0, + imageBottomPadding: FloatInt = 3, imageSide: str = "right", imageHref: str | None = None, ) -> None: ... @@ -315,28 +316,28 @@ class ImageAndFlowables(_Container, _FindSplitterMixin, Flowable): # pyrefly: i class BalancedColumns(_FindSplitterMixin, NullDraw): name: str showBoundary: Incomplete | None - endSlack: float + endSlack: FloatInt def __init__( self, F: _FlowableSublist | None, nCols: int = 2, - needed: float = 72, - spaceBefore: float = 0, - spaceAfter: float = 0, + needed: FloatInt = 72, + spaceBefore: FloatInt = 0, + spaceAfter: FloatInt = 0, showBoundary=None, - leftPadding: float | None = None, - innerPadding: float | None = None, - rightPadding: float | None = None, - topPadding: float | None = None, - bottomPadding: float | None = None, + leftPadding: FloatInt | None = None, + innerPadding: FloatInt | None = None, + rightPadding: FloatInt | None = None, + topPadding: FloatInt | None = None, + bottomPadding: FloatInt | None = None, name: str = "", - endSlack: float = 0.1, + endSlack: FloatInt = 0.1, boxStrokeColor: Color | None = None, - boxStrokeWidth: float = 0, + boxStrokeWidth: FloatInt = 0, boxFillColor: Color | None = None, boxMargin: tuple[int, int, int, int] | tuple[int, int, int] | tuple[int, int] | tuple[int] | None = None, vLinesStrokeColor: Color | None = None, - vLinesStrokeWidth: float | None = None, + vLinesStrokeWidth: FloatInt | None = None, ) -> None: ... class AnchorFlowable(Spacer): @@ -344,35 +345,35 @@ class AnchorFlowable(Spacer): class FrameBG(AnchorFlowable): start: bool - left: float - right: float + left: FloatInt + right: FloatInt color: Color - strokeWidth: float + strokeWidth: FloatInt strokeColor: Color - strokeDashArray: list[float] | tuple[float, ...] | None + strokeDashArray: list[FloatInt] | tuple[FloatInt, ...] | None def __init__( self, color: Color | None = None, - left: float | str = 0, - right: float | str = 0, + left: FloatInt | str = 0, + right: FloatInt | str = 0, start: bool = True, - strokeWidth: float | None = None, + strokeWidth: FloatInt | None = None, strokeColor: Color | None = None, - strokeDashArray: list[float] | tuple[float, ...] | None = None, + strokeDashArray: list[FloatInt] | tuple[FloatInt, ...] | None = None, ) -> None: ... class FrameSplitter(NullDraw): nextTemplate: str nextFrames: list[str] - gap: float - required: float + gap: FloatInt + required: FloatInt adjustHeight: bool def __init__( self, nextTemplate: str, nextFrames: list[str] | None = [], - gap: float = 10, - required: float = 72, + gap: FloatInt = 10, + required: FloatInt = 72, adjustHeight: bool = True, ) -> None: ... @@ -391,20 +392,20 @@ class BulletDrawer: bulletDir: str = "ltr", bulletFormat=None, ) -> None: ... - def drawOn(self, indenter: DDIndenter, canv: Canvas, x: float, y: float) -> None: ... + def drawOn(self, indenter: DDIndenter, canv: Canvas, x: FloatInt, y: FloatInt) -> None: ... class DDIndenter(Flowable): - def __init__(self, flowable: Flowable, leftIndent: float = 0, rightIndent: float = 0) -> None: ... + def __init__(self, flowable: Flowable, leftIndent: FloatInt = 0, rightIndent: FloatInt = 0) -> None: ... class LIIndenter(DDIndenter): def __init__( self, flowable: Flowable, - leftIndent: float = 0, - rightIndent: float = 0, + leftIndent: FloatInt = 0, + rightIndent: FloatInt = 0, bullet=None, - spaceBefore: float | None = None, - spaceAfter: float | None = None, + spaceBefore: FloatInt | None = None, + spaceAfter: FloatInt | None = None, ) -> None: ... class ListItem: @@ -429,7 +430,7 @@ class TopPadder(Flowable): class DocAssign(NullDraw): args: tuple[Any, ...] def __init__(self, var: str, expr: object, life: str = "forever") -> None: ... - def funcWrap(self, aW: float, aH: float) -> None: ... + def funcWrap(self, aW: FloatInt, aH: FloatInt) -> None: ... def func(self) -> None: ... class DocExec(DocAssign): @@ -449,10 +450,10 @@ class DocPara(DocAssign): klass: _StyledFlowableFactory | None = None, escape: bool = True, ) -> None: ... - def funcWrap(self, aW: float, aH: float) -> Any: ... + def funcWrap(self, aW: FloatInt, aH: FloatInt) -> Any: ... def func(self) -> Any: ... def add_content(self, *args: Flowable) -> None: ... - def get_value(self, aW: float, aH: float) -> str: ... + def get_value(self, aW: FloatInt, aH: FloatInt) -> str: ... class DocAssert(DocPara): def __init__(self, cond: object, format: str | None = None) -> None: ... diff --git a/stubs/reportlab/reportlab/platypus/frames.pyi b/stubs/reportlab/reportlab/platypus/frames.pyi index f8e832c1b83a..fa6990350244 100644 --- a/stubs/reportlab/reportlab/platypus/frames.pyi +++ b/stubs/reportlab/reportlab/platypus/frames.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal from reportlab.pdfgen.canvas import Canvas @@ -5,25 +6,25 @@ from reportlab.platypus.flowables import Flowable class Frame: id: str | None - x1: float - y1: float - width: float - height: float - leftPadding: float - bottomPadding: float - rightPadding: float - topPadding: float + x1: FloatInt + y1: FloatInt + width: FloatInt + height: FloatInt + leftPadding: FloatInt + bottomPadding: FloatInt + rightPadding: FloatInt + topPadding: FloatInt showBoundary: int def __init__( self, - x1: float, - y1: float, - width: float, - height: float, - leftPadding: float = 6, - bottomPadding: float = 6, - rightPadding: float = 6, - topPadding: float = 6, + x1: FloatInt, + y1: FloatInt, + width: FloatInt, + height: FloatInt, + leftPadding: FloatInt = 6, + bottomPadding: FloatInt = 6, + rightPadding: FloatInt = 6, + topPadding: FloatInt = 6, id: str | None = None, showBoundary: int = 0, overlapAttachedSpace=None, diff --git a/stubs/reportlab/reportlab/platypus/multicol.pyi b/stubs/reportlab/reportlab/platypus/multicol.pyi index 09fe9cdb8e31..d260b888a1bb 100644 --- a/stubs/reportlab/reportlab/platypus/multicol.pyi +++ b/stubs/reportlab/reportlab/platypus/multicol.pyi @@ -1,19 +1,20 @@ +from _typeshed import FloatInt from collections.abc import Sequence from .flowables import Flowable, _Container, _FindSplitterMixin class MultiCol(_Container, _FindSplitterMixin, Flowable): # pyrefly: ignore [inconsistent-inheritance] contents: Sequence[Flowable] - widths: Sequence[float | str] - minHeightNeeded: float + widths: Sequence[FloatInt | str] + minHeightNeeded: FloatInt def __init__( self, contents: Sequence[Flowable], - widths: Sequence[float | str], - minHeightNeeded: float = 36, - spaceBefore: float | None = None, - spaceAfter: float | None = None, + widths: Sequence[FloatInt | str], + minHeightNeeded: FloatInt = 36, + spaceBefore: FloatInt | None = None, + spaceAfter: FloatInt | None = None, ) -> None: ... - def nWidths(self, aW: float) -> list[float]: ... + def nWidths(self, aW: FloatInt) -> list[float]: ... __all__ = ["MultiCol"] diff --git a/stubs/reportlab/reportlab/platypus/para.pyi b/stubs/reportlab/reportlab/platypus/para.pyi index f2205c40992b..692dfa5b5d72 100644 --- a/stubs/reportlab/reportlab/platypus/para.pyi +++ b/stubs/reportlab/reportlab/platypus/para.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, Unused from collections.abc import Callable, Mapping from typing import Any, Final, Literal, Protocol, TypeAlias, TypedDict, TypeVar, overload, type_check_only @@ -11,14 +12,14 @@ from reportlab.platypus.flowables import Flowable _T = TypeVar("_T") _BoolInt: TypeAlias = Literal[0, 1] -_Op: TypeAlias = _SupportsWidthAndExecute | str | float | tuple[str, Unpack[tuple[Any, ...]]] +_Op: TypeAlias = _SupportsWidthAndExecute | str | FloatInt | tuple[str, Unpack[tuple[Any, ...]]] # NOTE: Output from pyRXP xml parser _ParsedText: TypeAlias = tuple[str, dict[str, Any], list[_ParsedText], Any] | list[_ParsedText] | str @type_check_only class _LineOpHandler(Protocol): - def start_at(self, x: float, y: float, para: paragraphEngine, canvas: Canvas, textobject: PDFTextObject) -> None: ... - def end_at(self, x: float, y: float, para: paragraphEngine, canvas: Canvas, textobject: PDFTextObject) -> None: ... + def start_at(self, x: FloatInt, y: FloatInt, para: paragraphEngine, canvas: Canvas, textobject: PDFTextObject) -> None: ... + def end_at(self, x: FloatInt, y: FloatInt, para: paragraphEngine, canvas: Canvas, textobject: PDFTextObject) -> None: ... @type_check_only class _SupportsWidthAndExecute(Protocol): @@ -28,36 +29,36 @@ class _SupportsWidthAndExecute(Protocol): @type_check_only class _SimpleStyleKwargs(TypedDict, total=False): fontName: str - fontSize: float - leading: float - leftIndent: float - rightIndent: float - firstLineIndent: float + fontSize: FloatInt + leading: FloatInt + leftIndent: FloatInt + rightIndent: FloatInt + firstLineIndent: FloatInt alignment: Literal[0, 1, 2, 4] - spaceBefore: float - spaceAfter: float + spaceBefore: FloatInt + spaceAfter: FloatInt bulletFontName: str - bulletFontSize: float - bulletIndent: float + bulletFontSize: FloatInt + bulletIndent: FloatInt textColor: _Color backColor: _Color | None debug: int DUMPPROGRAM: int -TOOSMALLSPACE: float +TOOSMALLSPACE: FloatInt class paragraphEngine: TEXT_STATE_VARIABLES: Final[tuple[str, ...]] lineOpHandlers: list[_LineOpHandler] program: list[_Op] - indent: float - baseindent: float + indent: FloatInt + baseindent: FloatInt fontName: str - fontSize: float - leading: float + fontSize: FloatInt + leading: FloatInt fontColor: _Color - x: float - y: float + x: FloatInt + y: FloatInt alignment: Literal[0, 1, 2, 4] # NOTE: The inner list matches TEXT_STATE_VARIABLES textStateStack: list[list[Any]] @@ -65,23 +66,23 @@ class paragraphEngine: def pushTextState(self) -> list[Any]: ... def popTextState(self) -> None: ... def format( - self, maxwidth: float, maxheight: float, program: list[_Op], leading: float = 0 + self, maxwidth: FloatInt, maxheight: FloatInt, program: list[_Op], leading: FloatInt = 0 ) -> tuple[list[_Op], str, dict[str, Any], float]: ... def getState(self) -> dict[str, Any]: ... def resetState(self, state: dict[str, Any]) -> None: ... def fitLine( - self, program: list[_Op], totalLength: float + self, program: list[_Op], totalLength: FloatInt ) -> tuple[Literal[0, 1], list[_Op], int, float, float, float, Literal[0, 1]]: ... - def centerAlign(self, line: list[_Op], lineLength: float, maxLength: float) -> list[_Op]: ... - def rightAlign(self, line: list[_Op], lineLength: float, maxLength: float) -> list[_Op]: ... - def insertShift(self, line: list[_Op], shift: float) -> list[_Op]: ... - def justifyAlign(self, line: list[_Op], lineLength: float, maxLength: float) -> list[_Op]: ... + def centerAlign(self, line: list[_Op], lineLength: FloatInt, maxLength: FloatInt) -> list[_Op]: ... + def rightAlign(self, line: list[_Op], lineLength: FloatInt, maxLength: FloatInt) -> list[_Op]: ... + def insertShift(self, line: list[_Op], shift: FloatInt) -> list[_Op]: ... + def justifyAlign(self, line: list[_Op], lineLength: FloatInt, maxLength: FloatInt) -> list[_Op]: ... def shrinkWrap(self, line: list[_Op]) -> list[_Op]: ... def cleanProgram(self, line: list[_Op]) -> list[_Op]: ... def runOpCodes(self, program: list[_Op], canvas: Canvas, textobject: PDFTextObject) -> dict[str, Any]: ... -def stringLine(line: list[_Op], length: float) -> list[_Op]: ... -def simpleJustifyAlign(line: list[_Op], currentLength: float, maxLength: float) -> list[_Op]: ... +def stringLine(line: list[_Op], length: FloatInt) -> list[_Op]: ... +def simpleJustifyAlign(line: list[_Op], currentLength: FloatInt, maxLength: FloatInt) -> list[_Op]: ... def readBool(text: str) -> _BoolInt: ... def readAlignment(text: str) -> Literal[0, 1, 2, 4] | None: ... def readLength(text: str) -> float: ... @@ -110,17 +111,17 @@ class StyleAttributeConverters: class SimpleStyle: name: str fontName: str - fontSize: float - leading: float - leftIndent: float - rightIndent: float - firstLineIndent: float + fontSize: FloatInt + leading: FloatInt + leftIndent: FloatInt + rightIndent: FloatInt + firstLineIndent: FloatInt alignment: Literal[0, 1, 2, 4] - spaceBefore: float - spaceAfter: float + spaceBefore: FloatInt + spaceAfter: FloatInt bulletFontName: str - bulletFontSize: float - bulletIndent: float + bulletFontSize: FloatInt + bulletIndent: FloatInt textColor: _Color backColor: _Color | None # NOTE: We are being generous by allowing PropertySet i.e. ParagraphStyle here @@ -143,7 +144,7 @@ def defaultContext() -> dict[str, PropertySet]: ... def buildContext(stylesheet: StyleSheet1 | None = None) -> dict[str, PropertySet]: ... class Para(Flowable): - baseindent: float + baseindent: FloatInt context: dict[str, PropertySet] parsedText: _ParsedText bulletText: str | None @@ -155,7 +156,7 @@ class Para(Flowable): bold: _BoolInt italic: _BoolInt face: str - size: float + size: FloatInt def __init__( self, # NOTE: We are being generous by allowing PropertySet i.e. ParagraphStyle here @@ -165,7 +166,7 @@ class Para(Flowable): bulletText: str | None = None, state: dict[str, Any] | None = None, context: dict[str, PropertySet] | None = None, - baseindent: float = 0, + baseindent: FloatInt = 0, ) -> None: ... def draw(self) -> None: ... def compileProgram(self, parsedText: _ParsedText, program: list[_Op] | None = None) -> list[_Op]: ... @@ -245,11 +246,11 @@ def Paragraph( class UnderLineHandler: color: _Color | None # NOTE: available after start_at - xStart: float - yStart: float + xStart: FloatInt + yStart: FloatInt def __init__(self, color: _Color | None = None) -> None: ... - def start_at(self, x: float, y: float, para: paragraphEngine, canvas: Canvas, textobject: PDFTextObject) -> None: ... - def end_at(self, x: float, y: float, para: paragraphEngine, canvas: Canvas, textobject: PDFTextObject) -> None: ... + def start_at(self, x: FloatInt, y: FloatInt, para: paragraphEngine, canvas: Canvas, textobject: PDFTextObject) -> None: ... + def end_at(self, x: FloatInt, y: FloatInt, para: paragraphEngine, canvas: Canvas, textobject: PDFTextObject) -> None: ... UNDERLINE: Final[UnderLineHandler] diff --git a/stubs/reportlab/reportlab/platypus/paragraph.pyi b/stubs/reportlab/reportlab/platypus/paragraph.pyi index 6f38d99f8ec6..a059a0c87f7c 100644 --- a/stubs/reportlab/reportlab/platypus/paragraph.pyi +++ b/stubs/reportlab/reportlab/platypus/paragraph.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from reportlab.lib.abag import ABag from reportlab.lib.styles import ParagraphStyle, PropertySet from reportlab.pdfgen.textobject import PDFTextObject @@ -28,9 +29,9 @@ class Paragraph(Flowable): ) -> None: ... def minWidth(self) -> float: ... def draw(self) -> None: ... - def breakLines(self, width: float | list[float] | tuple[float, ...]) -> ParaLines | ParaFrag: ... - def breakLinesCJK(self, maxWidths: float | list[float] | tuple[float, ...]) -> ParaLines | ParaFrag: ... - def beginText(self, x: float, y: float) -> PDFTextObject: ... + def breakLines(self, width: FloatInt | list[FloatInt] | tuple[FloatInt, ...]) -> ParaLines | ParaFrag: ... + def breakLinesCJK(self, maxWidths: FloatInt | list[FloatInt] | tuple[FloatInt, ...]) -> ParaLines | ParaFrag: ... + def beginText(self, x: FloatInt, y: FloatInt) -> PDFTextObject: ... def drawPara(self, debug: int = 0) -> None: ... def getPlainText(self, identify: bool | None = None) -> str: ... def getActualLineWidths0(self) -> list[float]: ... diff --git a/stubs/reportlab/reportlab/platypus/tableofcontents.pyi b/stubs/reportlab/reportlab/platypus/tableofcontents.pyi index 0ae40aa5b850..5cf11ed8ac58 100644 --- a/stubs/reportlab/reportlab/platypus/tableofcontents.pyi +++ b/stubs/reportlab/reportlab/platypus/tableofcontents.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Unused from collections.abc import Callable, Iterable, Sequence from typing import Any, Final, Literal, TypeAlias, TypedDict, TypeVar, overload, type_check_only @@ -14,7 +15,7 @@ _SequencerFormat: TypeAlias = Literal["I", "i", "123", "ABC", "abc"] @type_check_only class _TableOfContentsKwargs(TypedDict, total=False): - rightColumnWidth: float + rightColumnWidth: FloatInt levelStyles: list[PropertySet] # should be ParagraphStyle tableStyle: TableStyle dotsMinLevel: int @@ -37,19 +38,19 @@ def drawPageNumbers( canvas: Canvas, style: PropertySet, # should be ParagraphStyle pages: Iterable[tuple[int | str, Unused]], - availWidth: float, - availHeight: float, + availWidth: FloatInt, + availHeight: FloatInt, dot: str = " . ", formatter: Unused | None = None, ) -> None: ... -delta: float -epsilon: float +delta: FloatInt +epsilon: FloatInt defaultLevelStyles: list[ParagraphStyle] defaultTableStyle: TableStyle class TableOfContents(IndexingFlowable): - rightColumnWidth: float + rightColumnWidth: FloatInt levelStyles: list[ParagraphStyle] tableStyle: TableStyle dotsMinLevel: int @@ -77,7 +78,7 @@ class SimpleIndex(IndexingFlowable): headers: bool name: str formatFunc: Callable[[int], str] - offset: float + offset: FloatInt def __init__(self, **kwargs: Unpack[_SimpleIndexKwargs]) -> None: ... def getFormatFunc(self, formatName): ... def setup( @@ -88,7 +89,7 @@ class SimpleIndex(IndexingFlowable): headers: bool = True, name: str | None = None, format: _SequencerFormat = "123", - offset: float = 0, + offset: FloatInt = 0, ) -> None: ... def __call__(self, canv: Canvas, kind: str | None, label: str) -> None: ... def getCanvasMaker(self, canvasmaker: _CanvasMaker = ...) -> _CanvasMaker: ... diff --git a/stubs/reportlab/reportlab/platypus/tables.pyi b/stubs/reportlab/reportlab/platypus/tables.pyi index 2bcee72979e2..377da47c5fe2 100644 --- a/stubs/reportlab/reportlab/platypus/tables.pyi +++ b/stubs/reportlab/reportlab/platypus/tables.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from abc import abstractmethod from collections.abc import Collection, Iterable, Sequence @@ -11,7 +12,7 @@ from reportlab.platypus.flowables import Flowable, _HAlignment, _VAlignment __all__ = ("Table", "TableStyle", "CellStyle", "LongTable") -_Color: TypeAlias = Color | list[float] | tuple[float, float, float, float] | tuple[float, float, float] | str | int +_Color: TypeAlias = Color | list[FloatInt] | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | str | int # TODO: consider creating a tagged union of all the possible commands, although # this would restrict us to passing cmds to TableStyle.__init__ in a tuple # since a list would not be able to be inferred correctly @@ -21,20 +22,20 @@ _Color: TypeAlias = Color | list[float] | tuple[float, float, float, float] | tu # the ROUNDEDCORNERS command which applies to the whole table always. _SpecialRow: TypeAlias = Literal["splitfirst", "splitlast", "inrowsplitstart", "inrowsplitend"] _TableSectionCommand: TypeAlias = tuple[str, tuple[int | _SpecialRow, int], tuple[int, int], Unpack[tuple[Any, ...]]] -_CornerRadii: TypeAlias = tuple[float, float, float, float] | list[float] +_CornerRadii: TypeAlias = tuple[FloatInt, FloatInt, FloatInt, FloatInt] | list[FloatInt] _RoundedCornersTableCommand: TypeAlias = tuple[Literal["ROUNDEDCORNERS"], _CornerRadii | None] _TableCommand: TypeAlias = _TableSectionCommand | _RoundedCornersTableCommand class CellStyle(PropertySet): name: str fontname: str - fontsize: float - leading: float - leftPadding: float - rightPadding: float - topPadding: float - bottomPadding: float - firstLineIndent: float + fontsize: FloatInt + leading: FloatInt + leftPadding: FloatInt + rightPadding: FloatInt + topPadding: FloatInt + bottomPadding: FloatInt + firstLineIndent: FloatInt color: _Color alignment: Literal["LEFT", "CENTER", "CENTRE", "RIGHT", "DECIMAL"] background: _Color @@ -70,15 +71,15 @@ class Table(Flowable): repeatCols: int splitByRow: int splitInRow: int - spaceBefore: float - spaceAfter: float + spaceBefore: FloatInt + spaceAfter: FloatInt def __init__( self, # NOTE: Technically only list or tuple works but lack of covariance # on list makes this too annoying data: Sequence[list[Any] | tuple[Any, ...]], - colWidths: Sequence[float | str | None] | float | str | None = None, - rowHeights: Sequence[float | None] | float | None = None, + colWidths: Sequence[FloatInt | str | None] | FloatInt | str | None = None, + rowHeights: Sequence[FloatInt | None] | FloatInt | None = None, style: TableStyle | Iterable[_TableCommand] | None = None, # docs say list/tuple, but the implementation allows any collection repeatRows: int | Collection[int] = 0, @@ -92,10 +93,10 @@ class Table(Flowable): normalizedData: int = 0, cellStyles: Sequence[Sequence[CellStyle]] | None = None, rowSplitRange: tuple[int, int] | None = None, - spaceBefore: float | None = None, - spaceAfter: float | None = None, + spaceBefore: FloatInt | None = None, + spaceAfter: FloatInt | None = None, longTableOptimize=None, - minRowHeights: Sequence[float] | None = None, + minRowHeights: Sequence[FloatInt] | None = None, cornerRadii: _CornerRadii | _UNSET_ | None = ..., renderCB: TableRenderCB | None = None, shadow: ShadowStyle | None = None, diff --git a/stubs/reportlab/reportlab/platypus/xpreformatted.pyi b/stubs/reportlab/reportlab/platypus/xpreformatted.pyi index c5b5e4c81b4e..6b6ce1c7df86 100644 --- a/stubs/reportlab/reportlab/platypus/xpreformatted.pyi +++ b/stubs/reportlab/reportlab/platypus/xpreformatted.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from reportlab.lib.styles import PropertySet from reportlab.platypus.paragraph import Paragraph, ParaLines from reportlab.platypus.paraparser import ParaFrag @@ -13,7 +14,7 @@ class XPreformatted(Paragraph): caseSensitive: int = 1, dedent: int = 0, ) -> None: ... - def breakLinesCJK(self, width: float | list[float] | tuple[float, ...]) -> ParaLines | ParaFrag: ... + def breakLinesCJK(self, width: FloatInt | list[FloatInt] | tuple[FloatInt, ...]) -> ParaLines | ParaFrag: ... class PythonPreformatted(XPreformatted): formats: dict[str, tuple[str, str]] diff --git a/stubs/reportlab/reportlab/rl_config.pyi b/stubs/reportlab/reportlab/rl_config.pyi index 4a172c552afc..dff99e3c7496 100644 --- a/stubs/reportlab/reportlab/rl_config.pyi +++ b/stubs/reportlab/reportlab/rl_config.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable from typing import Any, Literal @@ -16,7 +17,7 @@ defaultEncoding: str defaultGraphicsFontName: str pageCompression: int useA85: int -defaultPageSize: tuple[float, float] +defaultPageSize: tuple[FloatInt, FloatInt] defaultImageCaching: int warnOnMissingFontGlyphs: int verbose: int @@ -30,7 +31,7 @@ eps_ttf_embed_uid: int overlapAttachedSpace: int longTableOptimize: int autoConvertEncoding: int -_FUZZ: float +_FUZZ: FloatInt wrapA85: int fsEncodings: tuple[Literal["utf8"], Literal["cp1252"], Literal["cp430"]] odbc_driver: str @@ -56,7 +57,7 @@ decimalSymbol: str errorOnDuplicatePageLabelPage: int autoGenerateMissingTTFName: int allowTTFSubsetting: list[str] -spaceShrinkage: float +spaceShrinkage: FloatInt hyphenationLang: str uriWasteReduce: int embeddedHyphenation: int @@ -70,7 +71,7 @@ renderPMBackend: str xmlParser: str textPaths: str toColorCanUse: str -defCWRF: float +defCWRF: FloatInt unShapedFontGlob: list[str] | None std14Embed: bool T1SearchPath: list[str] diff --git a/stubs/reportlab/reportlab/rl_settings.pyi b/stubs/reportlab/reportlab/rl_settings.pyi index 82ed418ff2b6..f290d0f2abbc 100644 --- a/stubs/reportlab/reportlab/rl_settings.pyi +++ b/stubs/reportlab/reportlab/rl_settings.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from typing import Final, Literal @@ -25,7 +26,7 @@ eps_ttf_embed_uid: Final[int] overlapAttachedSpace: Final[int] longTableOptimize: Final[int] autoConvertEncoding: Final[int] -_FUZZ: Final[float] +_FUZZ: Final[FloatInt] wrapA85: Final[int] fsEncodings: Final[tuple[Literal["utf8"], Literal["cp1252"], Literal["cp430"]]] odbc_driver: Final[str] @@ -51,7 +52,7 @@ decimalSymbol: Final[str] errorOnDuplicatePageLabelPage: Final[int] autoGenerateMissingTTFName: Final[int] allowTTFSubsetting: Final[list[str]] -spaceShrinkage: Final[float] +spaceShrinkage: Final[FloatInt] hyphenationLang: Final[str] uriWasteReduce: Final[int] embeddedHyphenation: Final[int] @@ -65,7 +66,7 @@ renderPMBackend: Final[str] xmlParser: Final[str] textPaths: Final[str] toColorCanUse: Final[str] -defCWRF: Final[float] +defCWRF: Final[FloatInt] unShapedFontGlob: list[str] | None std14Embed: Final[bool] T1SearchPath: Final[tuple[str, ...]] diff --git a/stubs/requests/requests/adapters.pyi b/stubs/requests/requests/adapters.pyi index df4f1d401412..430b88bc9d3c 100644 --- a/stubs/requests/requests/adapters.pyi +++ b/stubs/requests/requests/adapters.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Mapping from ssl import SSLContext @@ -56,7 +57,7 @@ class _PoolKwargs(TypedDict): DEFAULT_POOLBLOCK: bool DEFAULT_POOLSIZE: int DEFAULT_RETRIES: int -DEFAULT_POOL_TIMEOUT: float | None +DEFAULT_POOL_TIMEOUT: FloatInt | None class BaseAdapter: def __init__(self) -> None: ... @@ -64,7 +65,7 @@ class BaseAdapter: self, request: PreparedRequest, stream: bool = False, - timeout: float | tuple[float, float] | tuple[float, None] | None = None, + timeout: FloatInt | tuple[FloatInt, FloatInt] | tuple[FloatInt, None] | None = None, verify: bool | str = True, cert: bytes | str | tuple[bytes | str, bytes | str] | None = None, proxies: Mapping[str, str] | None = None, @@ -130,7 +131,7 @@ class HTTPAdapter(BaseAdapter): self, request: PreparedRequest, stream: bool = False, - timeout: float | tuple[float, float] | tuple[float, None] | None = None, + timeout: FloatInt | tuple[FloatInt, FloatInt] | tuple[FloatInt, None] | None = None, verify: bool | str = True, cert: bytes | str | tuple[bytes | str, bytes | str] | None = None, proxies: Mapping[str, str] | None = None, diff --git a/stubs/requests/requests/sessions.pyi b/stubs/requests/requests/sessions.pyi index ee89384d9522..ebf38518fb4c 100644 --- a/stubs/requests/requests/sessions.pyi +++ b/stubs/requests/requests/sessions.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsItems, SupportsRead, Unused from collections.abc import Callable, Iterable, Mapping, MutableMapping from typing import Any, TypeAlias, TypedDict, type_check_only @@ -102,7 +103,7 @@ _Params: TypeAlias = ( ) _TextMapping: TypeAlias = MutableMapping[str, str] _HeadersUpdateMapping: TypeAlias = Mapping[str, str | bytes | None] -_Timeout: TypeAlias = float | tuple[float | None, float | None] +_Timeout: TypeAlias = FloatInt | tuple[FloatInt | None, FloatInt | None] _Verify: TypeAlias = bool | str @type_check_only diff --git a/stubs/resampy/resampy/core.pyi b/stubs/resampy/resampy/core.pyi index f4d29b1b925b..74942e098a3d 100644 --- a/stubs/resampy/resampy/core.pyi +++ b/stubs/resampy/resampy/core.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import Any, TypeAlias, TypeVar @@ -11,19 +12,19 @@ _FilterType: TypeAlias = str | Callable[[int], np.ndarray[tuple[int], np.dtype[n def resample( x: _FloatArray, - sr_orig: float, - sr_new: float, + sr_orig: FloatInt, + sr_new: FloatInt, axis: int = -1, filter: _FilterType = "kaiser_best", parallel: bool = False, *, num_zeros: int = 64, precision: int = 9, - rolloff: float = 0.945, + rolloff: FloatInt = 0.945, ) -> _FloatArray: ... def resample_nu( x: _FloatArray, - sr_orig: float, + sr_orig: FloatInt, t_out: _FloatArray, axis: int = -1, filter: _FilterType = "kaiser_best", @@ -31,5 +32,5 @@ def resample_nu( *, num_zeros: int = 64, precision: int = 9, - rolloff: float = 0.945, + rolloff: FloatInt = 0.945, ) -> _FloatArray: ... diff --git a/stubs/resampy/resampy/filters.pyi b/stubs/resampy/resampy/filters.pyi index 07e85e4e26af..e1d21b5d77eb 100644 --- a/stubs/resampy/resampy/filters.pyi +++ b/stubs/resampy/resampy/filters.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import TypeAlias @@ -6,7 +7,7 @@ import numpy as np __all__ = ["get_filter", "clear_cache", "sinc_window"] # Dictionary to cache loaded filters -FILTER_CACHE: dict[str, tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]] +FILTER_CACHE: dict[str, tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, FloatInt]] # List of filter functions available FILTER_FUNCTIONS: list[str] @@ -17,10 +18,10 @@ def sinc_window( num_zeros: int = 64, precision: int = 9, window: Callable[[int], np.ndarray[tuple[int], np.dtype[np.float64]]] | None = None, - rolloff: float = 0.945, + rolloff: FloatInt = 0.945, ) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... def get_filter( - name_or_function: _FilterType, *, num_zeros: int = 64, precision: int = 9, rolloff: float = 0.945 + name_or_function: _FilterType, *, num_zeros: int = 64, precision: int = 9, rolloff: FloatInt = 0.945 ) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... def load_filter(filter_name: str) -> tuple[np.ndarray[tuple[int], np.dtype[np.float64]], int, float]: ... def clear_cache() -> None: ... diff --git a/stubs/retry/retry/api.pyi b/stubs/retry/retry/api.pyi index e550c1ca2c90..2844b8589ff0 100644 --- a/stubs/retry/retry/api.pyi +++ b/stubs/retry/retry/api.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import IdentityFunction from collections.abc import Callable, Sequence from logging import Logger @@ -13,18 +14,18 @@ def retry_call( fkwargs: dict[str, Any] | None = None, exceptions: type[Exception] | tuple[type[Exception], ...] = ..., tries: int = -1, - delay: float = 0, - max_delay: float | None = None, - backoff: float = 1, - jitter: tuple[float, float] | float = 0, + delay: FloatInt = 0, + max_delay: FloatInt | None = None, + backoff: FloatInt = 1, + jitter: tuple[FloatInt, FloatInt] | FloatInt = 0, logger: Logger | None = ..., ) -> _R: ... def retry( exceptions: type[Exception] | tuple[type[Exception], ...] = ..., tries: int = -1, - delay: float = 0, - max_delay: float | None = None, - backoff: float = 1, - jitter: tuple[float, float] | float = 0, + delay: FloatInt = 0, + max_delay: FloatInt | None = None, + backoff: FloatInt = 1, + jitter: tuple[FloatInt, FloatInt] | FloatInt = 0, logger: Logger | None = ..., ) -> IdentityFunction: ... diff --git a/stubs/scp/scp.pyi b/stubs/scp/scp.pyi index a7b9ae28b963..8bff7f766b13 100644 --- a/stubs/scp/scp.pyi +++ b/stubs/scp/scp.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Iterable from pathlib import PurePath from types import TracebackType @@ -28,7 +29,7 @@ def asunicode_win(s: bytes | str) -> str: ... class SCPClient: transport: Transport buff_size: int - socket_timeout: float | None + socket_timeout: FloatInt | None channel: Channel | None preserve_times: bool sanitize: Callable[[bytes], bytes] @@ -38,7 +39,7 @@ class SCPClient: self, transport: Transport, buff_size: int = 16384, - socket_timeout: float | None = 10.0, + socket_timeout: FloatInt | None = 10.0, progress: Callable[[str | bytes, int, int], None] | None = None, progress4: Callable[[str | bytes, int, int, tuple[str, int]], None] | None = None, sanitize: Callable[[bytes], bytes] | Literal[False] = ..., diff --git a/stubs/seaborn/seaborn/_core/moves.pyi b/stubs/seaborn/seaborn/_core/moves.pyi index ed3f7f5e439a..09ff26c54557 100644 --- a/stubs/seaborn/seaborn/_core/moves.pyi +++ b/stubs/seaborn/seaborn/_core/moves.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable from dataclasses import dataclass @@ -17,15 +18,15 @@ class Move: @dataclass class Jitter(Move): - width: float | Default = ... - x: float = 0 - y: float = 0 + width: FloatInt | Default = ... + x: FloatInt = 0 + y: FloatInt = 0 seed: int | None = None @dataclass class Dodge(Move): empty: str = "keep" - gap: float = 0 + gap: FloatInt = 0 by: list[str] | None = None @dataclass @@ -33,8 +34,8 @@ class Stack(Move): ... @dataclass class Shift(Move): - x: float = 0 - y: float = 0 + x: FloatInt = 0 + y: FloatInt = 0 @dataclass class Norm(Move): diff --git a/stubs/seaborn/seaborn/_core/plot.pyi b/stubs/seaborn/seaborn/_core/plot.pyi index 0bfb8ee129e9..611b28d6ba10 100644 --- a/stubs/seaborn/seaborn/_core/plot.pyi +++ b/stubs/seaborn/seaborn/_core/plot.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import inspect import os from _typeshed import Incomplete, SupportsKeysAndGetItem @@ -57,7 +58,7 @@ class ThemeConfig(mpl.RcParams): class DisplayConfig(TypedDict): format: Literal["png", "svg"] - scaling: float + scaling: FloatInt hidpi: bool class PlotConfig: @@ -101,9 +102,9 @@ class Plot: def layout( self, *, - size: tuple[float, float] | Default = ..., + size: tuple[FloatInt, FloatInt] | Default = ..., engine: str | Default | None = ..., - extent: tuple[float, float, float, float] | Default = ..., + extent: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | Default = ..., ) -> Plot: ... def theme(self, config: dict[str, Any], /) -> Plot: ... # Same signature as Plotter.save @@ -112,13 +113,13 @@ class Plot: loc: str | os.PathLike[Any] | IO[Any], *, transparent: bool | None = None, - dpi: float | None = 96, + dpi: FloatInt | None = 96, facecolor: ColorType | Literal["auto"] | None = ..., edgecolor: ColorType | Literal["auto"] | None = ..., orientation: str = "portrait", format: str | None = None, bbox_inches: Literal["tight"] | Bbox | None = None, - pad_inches: float | None = None, + pad_inches: FloatInt | None = None, bbox_extra_artists: list[Artist] | None = None, backend: str | None = None, **kwargs: Any, @@ -137,13 +138,13 @@ class Plotter: transparent: bool | None = None, # keyword-only arguments below are the same as matplotlib.backend_bases.FigureCanvasBase.print_figure # but with different defaults - dpi: float | None = 96, + dpi: FloatInt | None = 96, facecolor: ColorType | Literal["auto"] | None = ..., edgecolor: ColorType | Literal["auto"] | None = ..., orientation: str = "portrait", format: str | None = None, bbox_inches: Literal["tight"] | Bbox | None = None, - pad_inches: float | None = None, + pad_inches: FloatInt | None = None, bbox_extra_artists: list[Artist] | None = None, backend: str | None = None, # Further **kwargs can truly be anything from an overridden Canvas method that is still passed down diff --git a/stubs/seaborn/seaborn/_core/properties.pyi b/stubs/seaborn/seaborn/_core/properties.pyi index 548cc5a9d3ce..09decb78b31e 100644 --- a/stubs/seaborn/seaborn/_core/properties.pyi +++ b/stubs/seaborn/seaborn/_core/properties.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable from typing import Any, TypeAlias @@ -8,12 +9,12 @@ from numpy.typing import ArrayLike from pandas import Series from seaborn._core.scales import Scale -RGBTuple: TypeAlias = tuple[float, float, float] -RGBATuple: TypeAlias = tuple[float, float, float, float] +RGBTuple: TypeAlias = tuple[FloatInt, FloatInt, FloatInt] +RGBATuple: TypeAlias = tuple[FloatInt, FloatInt, FloatInt, FloatInt] ColorSpec: TypeAlias = RGBTuple | RGBATuple | str -DashPattern: TypeAlias = tuple[float, ...] -DashPatternWithOffset: TypeAlias = tuple[float, DashPattern | None] -MarkerPattern: TypeAlias = float | str | tuple[int, int, float] | list[tuple[float, float]] | Path | MarkerStyle +DashPattern: TypeAlias = tuple[FloatInt, ...] +DashPatternWithOffset: TypeAlias = tuple[FloatInt, DashPattern | None] +MarkerPattern: TypeAlias = FloatInt | str | tuple[int, int, FloatInt] | list[tuple[FloatInt, FloatInt]] | Path | MarkerStyle Mapping: TypeAlias = Callable[[ArrayLike], ArrayLike] class Property: diff --git a/stubs/seaborn/seaborn/_core/scales.pyi b/stubs/seaborn/seaborn/_core/scales.pyi index d9783cae9cc5..07fbdc16163e 100644 --- a/stubs/seaborn/seaborn/_core/scales.pyi +++ b/stubs/seaborn/seaborn/_core/scales.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Sequence from dataclasses import dataclass @@ -54,18 +55,18 @@ class Continuous(ContinuousBase): self, locator: Locator | None = None, *, - at: Sequence[float] | None = None, + at: Sequence[FloatInt] | None = None, upto: int | None = None, count: int | None = None, - every: float | None = None, - between: tuple[float, float] | None = None, + every: FloatInt | None = None, + between: tuple[FloatInt, FloatInt] | None = None, minor: int | None = None, ) -> Self: ... def label( self, formatter: Formatter | None = None, *, - like: str | Callable[[float], str] | None = None, + like: str | Callable[[FloatInt], str] | None = None, base: int | Default | None = ..., unit: str | None = None, ) -> Self: ... @@ -84,9 +85,9 @@ class PseudoAxis: major: Ticker minor: Ticker def __init__(self, scale: ScaleBase) -> None: ... - def set_view_interval(self, vmin: float, vmax: float) -> None: ... + def set_view_interval(self, vmin: FloatInt, vmax: FloatInt) -> None: ... def get_view_interval(self) -> tuple[float, float]: ... - def set_data_interval(self, vmin: float, vmax: float) -> None: ... + def set_data_interval(self, vmin: FloatInt, vmax: FloatInt) -> None: ... def get_data_interval(self) -> tuple[float, float]: ... def get_tick_space(self) -> int: ... def set_major_locator(self, locator: Locator) -> None: ... diff --git a/stubs/seaborn/seaborn/_core/typing.pyi b/stubs/seaborn/seaborn/_core/typing.pyi index c1fefb365b75..2e9bb350b00e 100644 --- a/stubs/seaborn/seaborn/_core/typing.pyi +++ b/stubs/seaborn/seaborn/_core/typing.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Iterable, Mapping from datetime import date, datetime, timedelta @@ -17,10 +18,10 @@ VariableSpec: TypeAlias = ColumnName | Vector | None VariableSpecList: TypeAlias = list[VariableSpec] | Index[Any] | None DataSource: TypeAlias = DataFrame | SupportsDataFrame | Mapping[Any, Incomplete] | None OrderSpec: TypeAlias = Iterable[str] | None -NormSpec: TypeAlias = tuple[float | None, float | None] | Normalize | None +NormSpec: TypeAlias = tuple[FloatInt | None, FloatInt | None] | Normalize | None PaletteSpec: TypeAlias = str | list[Incomplete] | dict[Incomplete, Incomplete] | Colormap | None DiscreteValueSpec: TypeAlias = dict[Incomplete, Incomplete] | list[Incomplete] | None -ContinuousValueSpec: TypeAlias = tuple[float, float] | list[float] | dict[Any, float] | None +ContinuousValueSpec: TypeAlias = tuple[FloatInt, FloatInt] | list[FloatInt] | dict[Any, FloatInt] | None class Default: ... class Deprecated: ... diff --git a/stubs/seaborn/seaborn/_marks/base.pyi b/stubs/seaborn/seaborn/_marks/base.pyi index 80989c2f4274..8e7ecbc427f0 100644 --- a/stubs/seaborn/seaborn/_marks/base.pyi +++ b/stubs/seaborn/seaborn/_marks/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from dataclasses import dataclass from typing import Any, TypeAlias, TypeVar @@ -22,7 +23,7 @@ class Mappable: MappableBool: TypeAlias = bool | Mappable MappableString: TypeAlias = str | Mappable -MappableFloat: TypeAlias = float | Mappable +MappableFloat: TypeAlias = FloatInt | Mappable MappableColor: TypeAlias = str | tuple[Incomplete, ...] | Mappable MappableStyle: TypeAlias = str | DashPattern | DashPatternWithOffset | Mappable diff --git a/stubs/seaborn/seaborn/_stats/aggregation.pyi b/stubs/seaborn/seaborn/_stats/aggregation.pyi index cf30b12a2dc4..aee483a61719 100644 --- a/stubs/seaborn/seaborn/_stats/aggregation.pyi +++ b/stubs/seaborn/seaborn/_stats/aggregation.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from dataclasses import dataclass @@ -11,7 +12,7 @@ class Agg(Stat): @dataclass class Est(Stat): func: str | Callable[[Vector], float] = "mean" - errorbar: str | tuple[str, float] = ("ci", 95) + errorbar: str | tuple[str, FloatInt] = ("ci", 95) n_boot: int = 1000 seed: int | None = None diff --git a/stubs/seaborn/seaborn/_stats/counting.pyi b/stubs/seaborn/seaborn/_stats/counting.pyi index b6283af97cdd..9f2acab6bfad 100644 --- a/stubs/seaborn/seaborn/_stats/counting.pyi +++ b/stubs/seaborn/seaborn/_stats/counting.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from dataclasses import dataclass from numpy.typing import ArrayLike @@ -10,8 +11,8 @@ class Count(Stat): ... class Hist(Stat): stat: str = "count" bins: str | int | ArrayLike = "auto" - binwidth: float | None = None - binrange: tuple[float, float] | None = None + binwidth: FloatInt | None = None + binrange: tuple[FloatInt, FloatInt] | None = None common_norm: bool | list[str] = True common_bins: bool | list[str] = True cumulative: bool = False diff --git a/stubs/seaborn/seaborn/_stats/density.pyi b/stubs/seaborn/seaborn/_stats/density.pyi index 386424ccbcd3..df6dab065297 100644 --- a/stubs/seaborn/seaborn/_stats/density.pyi +++ b/stubs/seaborn/seaborn/_stats/density.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from dataclasses import dataclass from seaborn._stats.base import Stat @@ -5,11 +6,11 @@ from seaborn.external.kde import _BwMethodType @dataclass class KDE(Stat): - bw_adjust: float = 1 + bw_adjust: FloatInt = 1 bw_method: _BwMethodType = "scott" common_norm: bool | list[str] = True common_grid: bool | list[str] = True gridsize: int | None = 200 - cut: float = 3 + cut: FloatInt = 3 cumulative: bool = False def __post_init__(self) -> None: ... diff --git a/stubs/seaborn/seaborn/_stats/order.pyi b/stubs/seaborn/seaborn/_stats/order.pyi index 8950dc411d36..bf4787a807d1 100644 --- a/stubs/seaborn/seaborn/_stats/order.pyi +++ b/stubs/seaborn/seaborn/_stats/order.pyi @@ -1,8 +1,9 @@ +from _typeshed import FloatInt from dataclasses import dataclass from seaborn._stats.base import Stat @dataclass class Perc(Stat): - k: int | list[float] = 5 + k: int | list[FloatInt] = 5 method: str = "linear" diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 80014f241ea7..4611933427fe 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import os from _typeshed import Incomplete from collections.abc import Callable, Generator, Iterable, Mapping @@ -40,17 +41,17 @@ class _BaseGrid: *, # Keywords follow `matplotlib.axes.Axes.set`. Each keyword corresponds to a `set_` method adjustable: Literal["box", "datalim"] = ..., - agg_filter: Callable[[ArrayLike, float], tuple[NDArray[np.floating[Any]], float, float]] | None = ..., - alpha: float | None = ..., - anchor: str | tuple[float, float] = ..., + agg_filter: Callable[[ArrayLike, FloatInt], tuple[NDArray[np.floating[Any]], float, float]] | None = ..., + alpha: FloatInt | None = ..., + anchor: str | tuple[FloatInt, FloatInt] = ..., animated: bool = ..., - aspect: float | Literal["auto", "equal"] = ..., + aspect: FloatInt | Literal["auto", "equal"] = ..., autoscale_on: bool = ..., autoscalex_on: bool = ..., autoscaley_on: bool = ..., axes_locator: Callable[[Axes, RendererBase], Bbox] = ..., axisbelow: bool | Literal["line"] = ..., - box_aspect: float | None = ..., + box_aspect: FloatInt | None = ..., clip_box: BboxBase | None = ..., clip_on: bool = ..., clip_path: Patch | mpl_Path | TransformedPath | None = ..., @@ -62,33 +63,33 @@ class _BaseGrid: mouseover: bool = ..., navigate: bool = ..., path_effects: list[AbstractPathEffect] = ..., - picker: bool | float | Callable[[Artist, MouseEvent], tuple[bool, dict[Any, Any]]] | None = ..., - position: Bbox | tuple[float, float, float, float] = ..., + picker: bool | FloatInt | Callable[[Artist, MouseEvent], tuple[bool, dict[Any, Any]]] | None = ..., + position: Bbox | tuple[FloatInt, FloatInt, FloatInt, FloatInt] = ..., prop_cycle=..., # TODO: use cycler.Cycler when cycler gets typed - rasterization_zorder: float | None = ..., + rasterization_zorder: FloatInt | None = ..., rasterized: bool = ..., - sketch_params: float | None = ..., + sketch_params: FloatInt | None = ..., snap: bool | None = ..., subplotspec: SubplotSpec = ..., title: str = ..., transform: Transform | None = ..., url: str | None = ..., visible: bool = ..., - xbound: float | tuple[float | None, float | None] | None = ..., + xbound: FloatInt | tuple[FloatInt | None, FloatInt | None] | None = ..., xlabel: str = ..., - xlim: float | tuple[float | None, float | None] | None = ..., - xmargin: float = ..., + xlim: FloatInt | tuple[FloatInt | None, FloatInt | None] | None = ..., + xmargin: FloatInt = ..., xscale: str | ScaleBase = ..., xticklabels: Iterable[str | Text] = ..., xticks: ArrayLike = ..., - ybound: float | tuple[float | None, float | None] | None = ..., + ybound: FloatInt | tuple[FloatInt | None, FloatInt | None] | None = ..., ylabel: str = ..., - ylim: float | tuple[float | None, float | None] | None = ..., - ymargin: float = ..., + ylim: FloatInt | tuple[FloatInt | None, FloatInt | None] | None = ..., + ymargin: FloatInt = ..., yscale: str | ScaleBase = ..., yticklabels: Iterable[str | Text] = ..., yticks: ArrayLike = ..., - zorder: float = ..., + zorder: FloatInt = ..., **kwargs: Any, ) -> Self: ... @property @@ -104,13 +105,13 @@ class _BaseGrid: fname: str | os.PathLike[Any] | IO[Any], *, transparent: bool | None = None, - dpi: float | Literal["figure"] | None = 96, + dpi: FloatInt | Literal["figure"] | None = 96, facecolor: ColorType | Literal["auto"] | None = "auto", edgecolor: ColorType | Literal["auto"] | None = "auto", orientation: Literal["landscape", "portrait"] = "portrait", format: str | None = None, bbox_inches: Literal["tight"] | Bbox | None = "tight", - pad_inches: float | Literal["layout"] | None = None, + pad_inches: FloatInt | Literal["layout"] | None = None, backend: str | None = None, **kwargs: Any, ) -> None: ... @@ -121,10 +122,10 @@ class Grid(_BaseGrid): self, *, # Keywords follow `matplotlib.figure.Figure.tight_layout` - pad: float = 1.08, - h_pad: float | None = None, - w_pad: float | None = None, - rect: tuple[float, float, float, float] | None = None, + pad: FloatInt = 1.08, + h_pad: FloatInt | None = None, + w_pad: FloatInt | None = None, + rect: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, ) -> Self: ... def add_legend( self, @@ -135,32 +136,32 @@ class Grid(_BaseGrid): adjust_subtitles: bool = False, *, # Keywords follow `matplotlib.legend.Legend` - loc: str | int | tuple[float, float] | None = None, + loc: str | int | tuple[FloatInt, FloatInt] | None = None, numpoints: int | None = None, - markerscale: float | None = None, + markerscale: FloatInt | None = None, markerfirst: bool = True, reverse: bool = False, scatterpoints: int | None = None, - scatteryoffsets: Iterable[float] | None = None, + scatteryoffsets: Iterable[FloatInt] | None = None, prop: FontProperties | dict[str, Any] | None = None, fontsize: int | _LiteralFont | None = None, labelcolor: str | Iterable[str] | None = None, - borderpad: float | None = None, - labelspacing: float | None = None, - handlelength: float | None = None, - handleheight: float | None = None, - handletextpad: float | None = None, - borderaxespad: float | None = None, - columnspacing: float | None = None, + borderpad: FloatInt | None = None, + labelspacing: FloatInt | None = None, + handlelength: FloatInt | None = None, + handleheight: FloatInt | None = None, + handletextpad: FloatInt | None = None, + borderaxespad: FloatInt | None = None, + columnspacing: FloatInt | None = None, ncols: int = 1, mode: Literal["expand"] | None = None, fancybox: bool | None = None, - shadow: bool | dict[str, int] | dict[str, float] | None = None, + shadow: bool | dict[str, int] | dict[str, FloatInt] | None = None, title_fontsize: int | _LiteralFont | None = None, - framealpha: float | None = None, + framealpha: FloatInt | None = None, edgecolor: ColorType | None = None, facecolor: ColorType | None = None, - bbox_to_anchor: BboxBase | tuple[float, float] | tuple[float, float, float, float] | None = None, + bbox_to_anchor: BboxBase | tuple[FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, bbox_transform: Transform | None = None, frameon: bool | None = None, handler_map: None = None, @@ -179,15 +180,15 @@ class Grid(_BaseGrid): which: Literal["major", "minor", "both"] = "major", reset: bool = False, direction: Literal["in", "out", "inout"] = ..., - length: float = ..., - width: float = ..., + length: FloatInt = ..., + width: FloatInt = ..., color: ColorType = ..., - pad: float = ..., - labelsize: float | str = ..., + pad: FloatInt = ..., + labelsize: FloatInt | str = ..., labelcolor: ColorType = ..., labelfontfamily: str = ..., colors: ColorType = ..., - zorder: float = ..., + zorder: FloatInt = ..., bottom: bool = ..., top: bool = ..., left: bool = ..., @@ -196,10 +197,10 @@ class Grid(_BaseGrid): labeltop: bool = ..., labelleft: bool = ..., labelright: bool = ..., - labelrotation: float = ..., + labelrotation: FloatInt = ..., grid_color: ColorType = ..., - grid_alpha: float = ..., - grid_linewidth: float = ..., + grid_alpha: FloatInt = ..., + grid_linewidth: FloatInt = ..., grid_linestyle: str = ..., **kwargs: Any, ) -> Self: ... @@ -220,8 +221,8 @@ class FacetGrid(Grid): col_wrap: int | None = None, sharex: bool | Literal["col", "row"] = True, sharey: bool | Literal["col", "row"] = True, - height: float = 3, - aspect: float = 1, + height: FloatInt = 3, + aspect: FloatInt = 1, palette: _Palette | None = None, row_order: Iterable[Any] | None = None, col_order: Iterable[Any] | None = None, @@ -231,8 +232,8 @@ class FacetGrid(Grid): legend_out: bool = True, despine: bool = True, margin_titles: bool = False, - xlim: tuple[float, float] | None = None, - ylim: tuple[float, float] | None = None, + xlim: tuple[FloatInt, FloatInt] | None = None, + ylim: tuple[FloatInt, FloatInt] | None = None, subplot_kws: dict[str, Any] | None = None, gridspec_kws: dict[str, Any] | None = None, ) -> None: ... @@ -265,8 +266,8 @@ class FacetGrid(Grid): def refline( self, *, - x: float | None = None, - y: float | None = None, + x: FloatInt | None = None, + y: FloatInt | None = None, color: ColorType = ".5", linestyle: LineStyleType = "--", **line_kws: Any, @@ -304,9 +305,9 @@ class PairGrid(Grid): hue_kws: dict[str, Any] | None = None, corner: bool = False, diag_sharey: bool = True, - height: float = 2.5, - aspect: float = 1, - layout_pad: float = 0.5, + height: FloatInt = 2.5, + aspect: FloatInt = 1, + layout_pad: FloatInt = 0.5, despine: bool = True, dropna: bool = False, ) -> None: ... @@ -330,15 +331,15 @@ class JointGrid(_BaseGrid): x: ColumnName | _Vector | None = None, y: ColumnName | _Vector | None = None, hue: ColumnName | _Vector | None = None, - height: float = 6, - ratio: float = 5, - space: float = 0.2, + height: FloatInt = 6, + ratio: FloatInt = 5, + space: FloatInt = 0.2, palette: _Palette | Colormap | None = None, hue_order: Iterable[ColumnName] | None = None, hue_norm: NormSpec = None, dropna: bool = False, - xlim: float | tuple[float, float] | None = None, - ylim: float | tuple[float, float] | None = None, + xlim: FloatInt | tuple[FloatInt, FloatInt] | None = None, + ylim: FloatInt | tuple[FloatInt, FloatInt] | None = None, marginal_ticks: bool = False, ) -> None: ... def plot(self, joint_func: Callable[..., object], marginal_func: Callable[..., object], **kwargs: Any) -> Self: ... @@ -347,8 +348,8 @@ class JointGrid(_BaseGrid): def refline( self, *, - x: float | None = None, - y: float | None = None, + x: FloatInt | None = None, + y: FloatInt | None = None, joint: bool = True, marginal: bool = True, color: ColorType = ".5", @@ -369,14 +370,14 @@ def pairplot( kind: Literal["scatter", "kde", "hist", "reg"] = "scatter", diag_kind: Literal["auto", "hist", "kde"] | None = "auto", markers: MarkerType | list[MarkerType] | None = None, - height: float = 2.5, - aspect: float = 1, + height: FloatInt = 2.5, + aspect: FloatInt = 1, corner: bool = False, dropna: bool = False, plot_kws: dict[str, Any] | None = None, diag_kws: dict[str, Any] | None = None, grid_kws: dict[str, Any] | None = None, - size: float | None = None, # deprecated + size: FloatInt | None = None, # deprecated ) -> PairGrid: ... def jointplot( data: DataSource | _DataSourceWideForm | None = None, @@ -385,12 +386,12 @@ def jointplot( y: ColumnName | _Vector | None = None, hue: ColumnName | _Vector | None = None, kind: Literal["scatter", "kde", "hist", "hex", "reg", "resid"] = "scatter", - height: float = 6, - ratio: float = 5, - space: float = 0.2, + height: FloatInt = 6, + ratio: FloatInt = 5, + space: FloatInt = 0.2, dropna: bool = False, - xlim: float | tuple[float, float] | None = None, - ylim: float | tuple[float, float] | None = None, + xlim: FloatInt | tuple[FloatInt, FloatInt] | None = None, + ylim: FloatInt | tuple[FloatInt, FloatInt] | None = None, color: ColorType | None = None, palette: _Palette | Colormap | None = None, hue_order: Iterable[ColumnName] | None = None, diff --git a/stubs/seaborn/seaborn/categorical.pyi b/stubs/seaborn/seaborn/categorical.pyi index eed93a807628..5e19ac69d9c6 100644 --- a/stubs/seaborn/seaborn/categorical.pyi +++ b/stubs/seaborn/seaborn/categorical.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Iterable from typing import Any, Literal @@ -22,15 +23,15 @@ def boxplot( orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, - saturation: float = 0.75, + saturation: FloatInt = 0.75, fill: bool = True, dodge: bool | Literal["auto"] = "auto", - width: float = 0.8, - gap: float = 0, - whis: float | tuple[float, float] = 1.5, + width: FloatInt = 0.8, + gap: FloatInt = 0, + whis: FloatInt | tuple[FloatInt, FloatInt] = 1.5, linecolor: ColorType = "auto", - linewidth: float | None = None, - fliersize: float | None = None, + linewidth: FloatInt | None = None, + fliersize: FloatInt | None = None, hue_norm: NormSpec = None, native_scale: bool = False, log_scale: _LogScale | None = None, @@ -50,19 +51,19 @@ def violinplot( orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, - saturation: float = 0.75, + saturation: FloatInt = 0.75, fill: bool = True, inner: str | None = "box", split: bool = False, - width: float = 0.8, + width: FloatInt = 0.8, dodge: bool | Literal["auto"] = "auto", - gap: float = 0, - linewidth: float | None = None, + gap: FloatInt = 0, + linewidth: FloatInt | None = None, linecolor: ColorType = "auto", - cut: float = 2, + cut: FloatInt = 2, gridsize: int = 100, bw_method: _BwMethodType = "scott", - bw_adjust: float = 1, + bw_adjust: FloatInt = 1, density_norm: Literal["area", "count", "width"] = "area", common_norm: bool | None = False, hue_norm: NormSpec = None, @@ -88,17 +89,17 @@ def boxenplot( orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, - saturation: float = 0.75, + saturation: FloatInt = 0.75, fill: bool = True, dodge: bool | Literal["auto"] = "auto", - width: float = 0.8, - gap: float = 0, - linewidth: float | None = None, + width: FloatInt = 0.8, + gap: FloatInt = 0, + linewidth: FloatInt | None = None, linecolor: ColorType | None = None, width_method: Literal["exponential", "linear", "area"] = "exponential", k_depth: Literal["tukey", "proportion", "trustworthy", "full"] | int = "tukey", - outlier_prop: float = 0.007, - trust_alpha: float = 0.05, + outlier_prop: FloatInt = 0.007, + trust_alpha: FloatInt = 0.05, showfliers: bool = True, hue_norm: NormSpec = None, log_scale: _LogScale | None = None, @@ -120,14 +121,14 @@ def stripplot( hue: ColumnName | _Vector | None = None, order: Iterable[ColumnName] | None = None, hue_order: Iterable[ColumnName] | None = None, - jitter: float | Literal[True] = True, + jitter: FloatInt | Literal[True] = True, dodge: bool = False, orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, - size: float = 5, + size: FloatInt = 5, edgecolor: ColorType | Default = ..., - linewidth: float = 0, + linewidth: FloatInt = 0, hue_norm: NormSpec = None, log_scale: _LogScale | None = None, native_scale: bool = False, @@ -148,15 +149,15 @@ def swarmplot( orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, - size: float = 5, + size: FloatInt = 5, edgecolor: ColorType | None = None, - linewidth: float = 0, + linewidth: FloatInt = 0, hue_norm: NormSpec = None, log_scale: _LogScale | None = None, native_scale: bool = False, formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", - warn_thresh: float = 0.05, + warn_thresh: FloatInt = 0.05, ax: Axes | None = None, **kwargs: Any, ) -> Axes: ... @@ -177,17 +178,17 @@ def barplot( orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, - saturation: float = 0.75, + saturation: FloatInt = 0.75, fill: bool = True, hue_norm: NormSpec = None, - width: float = 0.8, + width: FloatInt = 0.8, dodge: bool | Literal["auto"] = "auto", - gap: float = 0, + gap: FloatInt = 0, log_scale: _LogScale | None = None, native_scale: bool = False, formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", - capsize: float = 0, + capsize: FloatInt = 0, err_kws: dict[str, Any] | None = None, ci=..., # deprecated errcolor=..., # deprecated @@ -218,7 +219,7 @@ def pointplot( log_scale: _LogScale | None = None, native_scale: bool = False, orient: Literal["v", "h", "x", "y"] | None = None, - capsize: float = 0, + capsize: FloatInt = 0, formatter: Callable[[Any], str] | None = None, legend: _Legend = "auto", err_kws: dict[str, Any] | None = None, @@ -240,13 +241,13 @@ def countplot( orient: Literal["v", "h", "x", "y"] | None = None, color: ColorType | None = None, palette: _Palette | None = None, - saturation: float = 0.75, + saturation: FloatInt = 0.75, fill: bool = True, hue_norm: NormSpec = None, stat: Literal["count", "percent", "proportion", "probability"] = "count", - width: float = 0.8, + width: FloatInt = 0.8, dodge: bool | Literal["auto"] = "auto", - gap: float = 0, + gap: FloatInt = 0, log_scale: _LogScale | None = None, native_scale: bool = False, formatter: Callable[[Any], str] | None = None, @@ -274,8 +275,8 @@ def catplot( row_order: Iterable[ColumnName] | None = None, col_order: Iterable[ColumnName] | None = None, col_wrap: int | None = None, - height: float = 5, - aspect: float = 1, + height: FloatInt = 5, + aspect: FloatInt = 1, log_scale: _LogScale | None = None, native_scale: bool = False, formatter: Callable[[Any], str] | None = None, diff --git a/stubs/seaborn/seaborn/distributions.pyi b/stubs/seaborn/seaborn/distributions.pyi index 036a0d9d4e43..fda174eef463 100644 --- a/stubs/seaborn/seaborn/distributions.pyi +++ b/stubs/seaborn/seaborn/distributions.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import Any, Literal, Protocol, TypeAlias, TypeVar, type_check_only from typing_extensions import deprecated @@ -31,8 +32,8 @@ def histplot( weights: ColumnName | _Vector | None = None, stat: str = "count", bins: _OneOrPair[str | int | ArrayLike] = "auto", - binwidth: float | tuple[float, float] | None = None, - binrange: _OneOrPair[tuple[float, float]] | None = None, + binwidth: FloatInt | tuple[FloatInt, FloatInt] | None = None, + binrange: _OneOrPair[tuple[FloatInt, FloatInt]] | None = None, discrete: bool | None = None, cumulative: bool = False, common_bins: bool = True, @@ -40,13 +41,13 @@ def histplot( multiple: Literal["layer", "dodge", "stack", "fill"] = "layer", element: Literal["bars", "step", "poly"] = "bars", fill: bool = True, - shrink: float = 1, + shrink: FloatInt = 1, kde: bool = False, kde_kws: dict[str, Any] | None = None, line_kws: dict[str, Any] | None = None, - thresh: float | None = 0, - pthresh: float | None = None, - pmax: float | None = None, + thresh: FloatInt | None = 0, + pthresh: FloatInt | None = None, + pmax: FloatInt | None = None, cbar: bool = False, cbar_ax: Axes | None = None, cbar_kws: dict[str, Any] | None = None, @@ -76,14 +77,14 @@ def kdeplot( common_grid: bool = False, cumulative: bool = False, bw_method: _BwMethodType = "scott", - bw_adjust: float = 1, + bw_adjust: FloatInt = 1, warn_singular: bool = True, log_scale: _LogScale | None = None, - levels: int | Iterable[float] = 10, - thresh: float = 0.05, + levels: int | Iterable[FloatInt] = 10, + thresh: FloatInt = 0.05, gridsize: int = 200, - cut: float = 3, - clip: _OneOrPair[tuple[float | None, float | None]] | None = None, + cut: FloatInt = 3, + clip: _OneOrPair[tuple[FloatInt | None, FloatInt | None]] | None = None, legend: bool = True, cbar: bool = False, cbar_ax: Axes | None = None, @@ -114,7 +115,7 @@ def rugplot( x: ColumnName | _Vector | None = None, y: ColumnName | _Vector | None = None, hue: ColumnName | _Vector | None = None, - height: float = 0.025, + height: FloatInt = 0.025, expand_margins: bool = True, palette: _Palette | Colormap | None = None, hue_order: Iterable[ColumnName] | None = None, @@ -144,8 +145,8 @@ def displot( col_wrap: int | None = None, row_order: Iterable[ColumnName] | None = None, col_order: Iterable[ColumnName] | None = None, - height: float = 5, - aspect: float = 1, + height: FloatInt = 5, + aspect: FloatInt = 1, facet_kws: dict[str, Any] | None = None, **kwargs: Any, ) -> FacetGrid: ... diff --git a/stubs/seaborn/seaborn/external/husl.pyi b/stubs/seaborn/seaborn/external/husl.pyi index f76e09c84764..433f4706cf0c 100644 --- a/stubs/seaborn/seaborn/external/husl.pyi +++ b/stubs/seaborn/seaborn/external/husl.pyi @@ -1,42 +1,43 @@ +from _typeshed import FloatInt from collections.abc import Iterable -m: list[list[float]] -m_inv: list[list[float]] -refX: float -refY: float -refZ: float -refU: float -refV: float -lab_e: float -lab_k: float +m: list[list[FloatInt]] +m_inv: list[list[FloatInt]] +refX: FloatInt +refY: FloatInt +refZ: FloatInt +refU: FloatInt +refV: FloatInt +lab_e: FloatInt +lab_k: FloatInt -def husl_to_rgb(h: float, s: float, l: float) -> list[float]: ... -def husl_to_hex(h: float, s: float, l: float) -> str: ... -def rgb_to_husl(r: float, g: float, b: float) -> list[float]: ... +def husl_to_rgb(h: FloatInt, s: FloatInt, l: FloatInt) -> list[float]: ... +def husl_to_hex(h: FloatInt, s: FloatInt, l: FloatInt) -> str: ... +def rgb_to_husl(r: FloatInt, g: FloatInt, b: FloatInt) -> list[float]: ... def hex_to_husl(hex: str) -> list[float]: ... -def huslp_to_rgb(h: float, s: float, l: float) -> list[float]: ... -def huslp_to_hex(h: float, s: float, l: float) -> str: ... -def rgb_to_huslp(r: float, g: float, b: float) -> list[float]: ... +def huslp_to_rgb(h: FloatInt, s: FloatInt, l: FloatInt) -> list[float]: ... +def huslp_to_hex(h: FloatInt, s: FloatInt, l: FloatInt) -> str: ... +def rgb_to_huslp(r: FloatInt, g: FloatInt, b: FloatInt) -> list[float]: ... def hex_to_huslp(hex: str) -> list[float]: ... -def lch_to_rgb(l: float, c: float, h: float) -> list[float]: ... -def rgb_to_lch(r: float, g: float, b: float) -> list[float]: ... -def max_chroma(L: float, H: float) -> float: ... -def max_chroma_pastel(L: float) -> float: ... -def dot_product(a: Iterable[float], b: Iterable[float]) -> float: ... -def f(t: float) -> float: ... -def f_inv(t: float) -> float: ... -def from_linear(c: float) -> float: ... -def to_linear(c: float) -> float: ... -def rgb_prepare(triple: Iterable[float]) -> list[int]: ... +def lch_to_rgb(l: FloatInt, c: FloatInt, h: FloatInt) -> list[float]: ... +def rgb_to_lch(r: FloatInt, g: FloatInt, b: FloatInt) -> list[float]: ... +def max_chroma(L: FloatInt, H: FloatInt) -> float: ... +def max_chroma_pastel(L: FloatInt) -> float: ... +def dot_product(a: Iterable[FloatInt], b: Iterable[FloatInt]) -> float: ... +def f(t: FloatInt) -> float: ... +def f_inv(t: FloatInt) -> float: ... +def from_linear(c: FloatInt) -> float: ... +def to_linear(c: FloatInt) -> float: ... +def rgb_prepare(triple: Iterable[FloatInt]) -> list[int]: ... def hex_to_rgb(hex: str) -> list[float]: ... -def rgb_to_hex(triple: Iterable[float]) -> str: ... -def xyz_to_rgb(triple: Iterable[float]) -> list[float]: ... -def rgb_to_xyz(triple: Iterable[float]) -> list[float]: ... -def xyz_to_luv(triple: Iterable[float]) -> list[float]: ... -def luv_to_xyz(triple: Iterable[float]) -> list[float]: ... -def luv_to_lch(triple: Iterable[float]) -> list[float]: ... -def lch_to_luv(triple: Iterable[float]) -> list[float]: ... -def husl_to_lch(triple: Iterable[float]) -> list[float]: ... -def lch_to_husl(triple: Iterable[float]) -> list[float]: ... -def huslp_to_lch(triple: Iterable[float]) -> list[float]: ... -def lch_to_huslp(triple: Iterable[float]) -> list[float]: ... +def rgb_to_hex(triple: Iterable[FloatInt]) -> str: ... +def xyz_to_rgb(triple: Iterable[FloatInt]) -> list[float]: ... +def rgb_to_xyz(triple: Iterable[FloatInt]) -> list[float]: ... +def xyz_to_luv(triple: Iterable[FloatInt]) -> list[float]: ... +def luv_to_xyz(triple: Iterable[FloatInt]) -> list[float]: ... +def luv_to_lch(triple: Iterable[FloatInt]) -> list[float]: ... +def lch_to_luv(triple: Iterable[FloatInt]) -> list[float]: ... +def husl_to_lch(triple: Iterable[FloatInt]) -> list[float]: ... +def lch_to_husl(triple: Iterable[FloatInt]) -> list[float]: ... +def huslp_to_lch(triple: Iterable[FloatInt]) -> list[float]: ... +def lch_to_huslp(triple: Iterable[FloatInt]) -> list[float]: ... diff --git a/stubs/seaborn/seaborn/external/kde.pyi b/stubs/seaborn/seaborn/external/kde.pyi index 76769a3fd5f8..c942865e44d7 100644 --- a/stubs/seaborn/seaborn/external/kde.pyi +++ b/stubs/seaborn/seaborn/external/kde.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import Any, Literal, Protocol, TypeAlias, type_check_only @@ -24,7 +25,7 @@ class _GaussianKDELike(Protocol): @property def neff(self) -> NDArray[Any]: ... -_Scalar: TypeAlias = float | np.number[Any] +_Scalar: TypeAlias = FloatInt | np.number[Any] _BwMethodType: TypeAlias = Literal["scott", "silverman"] | Callable[[_GaussianKDELike], _Scalar] | _Scalar | None class gaussian_kde: diff --git a/stubs/seaborn/seaborn/matrix.pyi b/stubs/seaborn/seaborn/matrix.pyi index 50214ffaaae3..de97ec62e78d 100644 --- a/stubs/seaborn/seaborn/matrix.pyi +++ b/stubs/seaborn/seaborn/matrix.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Hashable, Iterable, Mapping, Sequence from typing import Literal, TypeAlias, TypedDict, type_check_only @@ -37,15 +38,15 @@ __all__ = ["heatmap", "clustermap"] def heatmap( data: pd.DataFrame | ArrayLike, *, - vmin: float | None = None, - vmax: float | None = None, + vmin: FloatInt | None = None, + vmax: FloatInt | None = None, cmap: str | list[ColorType] | Colormap | None = None, - center: float | None = None, + center: FloatInt | None = None, robust: bool = False, annot: bool | ArrayLike | None = None, fmt: str = ".2g", annot_kws: dict[str, Incomplete] | None = None, - linewidths: float = 0, + linewidths: FloatInt = 0, linecolor: ColorType = "white", cbar: bool = True, cbar_kws: dict[str, Incomplete] | None = None, @@ -56,7 +57,7 @@ def heatmap( mask: NDArray[np.bool_] | pd.DataFrame | None = None, ax: Axes | None = None, # Kwargs below passed to matplotlib.axes.Axes.pcolormesh - alpha: float | None = None, + alpha: FloatInt | None = None, norm: str | Normalize | None = None, shading: Literal["flat", "nearest", "gouraud", "auto"] | None = None, antialiased: bool = False, @@ -65,8 +66,8 @@ def heatmap( @type_check_only class _Dendogram(TypedDict): - icoord: list[list[float]] - dcoord: list[list[float]] + icoord: list[list[FloatInt]] + dcoord: list[list[FloatInt]] ivl: list[str] leaves: list[int] color_list: list[str] @@ -83,14 +84,14 @@ class _DendrogramPlotter: rotate: bool linkage: NDArray[np.floating] dendrogram: _Dendogram - xticks: list[float] | NDArray[np.floating] - yticks: list[float] | NDArray[np.floating] + xticks: list[FloatInt] | NDArray[np.floating] + yticks: list[FloatInt] | NDArray[np.floating] xticklabels: list[str] yticklabels: list[str] ylabel: str xlabel: str - dependent_coord: list[list[float]] - independent_coord: list[list[float]] + dependent_coord: list[list[FloatInt]] + independent_coord: list[list[FloatInt]] def __init__( self, data: pd.DataFrame, @@ -125,9 +126,9 @@ class ClusterGrid(Grid): data: pd.DataFrame data2d: pd.DataFrame mask: pd.DataFrame - row_colors: list[list[tuple[float, float, float]]] | None + row_colors: list[list[tuple[FloatInt, FloatInt, FloatInt]]] | None row_color_labels: list[str] | None - col_colors: list[list[tuple[float, float, float]]] | None + col_colors: list[list[tuple[FloatInt, FloatInt, FloatInt]]] | None col_color_labels: list[str] | None gs: GridSpec ax_row_dendrogram: Axes @@ -137,7 +138,7 @@ class ClusterGrid(Grid): ax_heatmap: Axes ax_cbar: Axes | None cax: Axes | None - cbar_pos: tuple[float, float, float, float] | None + cbar_pos: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None dendrogram_row: _DendrogramPlotter | None dendrogram_col: _DendrogramPlotter | None def __init__( @@ -146,13 +147,13 @@ class ClusterGrid(Grid): pivot_kws: Mapping[str, Incomplete] | None = None, z_score: int | None = None, standard_scale: int | None = None, - figsize: tuple[float, float] | None = None, + figsize: tuple[FloatInt, FloatInt] | None = None, row_colors: _FlatOrNestedSequenceOfColors | None = None, col_colors: _FlatOrNestedSequenceOfColors | None = None, mask: NDArray[np.bool_] | pd.DataFrame | None = None, - dendrogram_ratio: float | tuple[float, float] | None = None, - colors_ratio: float | tuple[float, float] | None = None, - cbar_pos: tuple[float, float, float, float] | None = None, + dendrogram_ratio: FloatInt | tuple[FloatInt, FloatInt] | None = None, + colors_ratio: FloatInt | tuple[FloatInt, FloatInt] | None = None, + cbar_pos: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = None, ) -> None: ... def format_data( self, @@ -165,7 +166,7 @@ class ClusterGrid(Grid): def z_score(data2d: pd.DataFrame, axis: int = 1) -> pd.DataFrame: ... @staticmethod def standard_scale(data2d: pd.DataFrame, axis: int = 1) -> pd.DataFrame: ... - def dim_ratios(self, colors: ArrayLike | None, dendrogram_ratio: float, colors_ratio: float) -> list[float]: ... + def dim_ratios(self, colors: ArrayLike | None, dendrogram_ratio: FloatInt, colors_ratio: FloatInt) -> list[float]: ... @staticmethod def color_list_to_matrix_and_cmap( colors: _FlatOrNestedSequenceOfColors, ind: _ArrayLikeInt_co, axis: int = 0 @@ -203,7 +204,7 @@ def clustermap( metric: str = "euclidean", z_score: int | None = None, standard_scale: int | None = None, - figsize: tuple[float, float] | None = (10, 10), + figsize: tuple[FloatInt, FloatInt] | None = (10, 10), cbar_kws: dict[str, Incomplete] | None = None, row_cluster: bool = True, col_cluster: bool = True, @@ -212,9 +213,9 @@ def clustermap( row_colors: _FlatOrNestedSequenceOfColors | None = None, col_colors: _FlatOrNestedSequenceOfColors | None = None, mask: NDArray[np.bool_] | pd.DataFrame | None = None, - dendrogram_ratio: float | tuple[float, float] = 0.2, - colors_ratio: float | tuple[float, float] = 0.03, - cbar_pos: tuple[float, float, float, float] | None = (0.02, 0.8, 0.05, 0.18), + dendrogram_ratio: FloatInt | tuple[FloatInt, FloatInt] = 0.2, + colors_ratio: FloatInt | tuple[FloatInt, FloatInt] = 0.03, + cbar_pos: tuple[FloatInt, FloatInt, FloatInt, FloatInt] | None = (0.02, 0.8, 0.05, 0.18), tree_kws: dict[str, Incomplete] | None = None, **kwargs, ) -> ClusterGrid: ... diff --git a/stubs/seaborn/seaborn/palettes.pyi b/stubs/seaborn/seaborn/palettes.pyi index c64d4d1234fe..968df4c6df8a 100644 --- a/stubs/seaborn/seaborn/palettes.pyi +++ b/stubs/seaborn/seaborn/palettes.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Sequence from typing import Literal, TypeAlias, TypeVar, overload from typing_extensions import Self @@ -32,43 +33,43 @@ class _ColorPalette(list[_ColorT]): def __exit__(self, *args: object) -> None: ... def as_hex(self) -> _ColorPalette[str]: ... -_RGBColorPalette: TypeAlias = _ColorPalette[tuple[float, float, float]] +_RGBColorPalette: TypeAlias = _ColorPalette[tuple[FloatInt, FloatInt, FloatInt]] _SeabornPaletteName: TypeAlias = Literal[ "deep", "deep6", "muted", "muted6", "pastel", "pastel6", "bright", "bright6", "dark", "dark6", "colorblind", "colorblind6" ] @overload def color_palette( # type: ignore[overload-overlap] - palette: _SeabornPaletteName | None = None, n_colors: int | None = None, desat: float | None = None, *, as_cmap: Literal[True] + palette: _SeabornPaletteName | None = None, n_colors: int | None = None, desat: FloatInt | None = None, *, as_cmap: Literal[True] ) -> list[str]: ... # this might be a bug in seaborn because we expect the return type to be a Colormap instance @overload def color_palette( - palette: str | Sequence[ColorType], n_colors: int | None = None, desat: float | None = None, *, as_cmap: Literal[True] + palette: str | Sequence[ColorType], n_colors: int | None = None, desat: FloatInt | None = None, *, as_cmap: Literal[True] ) -> Colormap: ... @overload def color_palette( palette: str | Sequence[ColorType] | None = None, n_colors: int | None = None, - desat: float | None = None, + desat: FloatInt | None = None, as_cmap: Literal[False] = False, ) -> _RGBColorPalette: ... @overload def hls_palette( - n_colors: int = 6, h: float = 0.01, l: float = 0.6, s: float = 0.65, *, as_cmap: Literal[True] + n_colors: int = 6, h: FloatInt = 0.01, l: FloatInt = 0.6, s: FloatInt = 0.65, *, as_cmap: Literal[True] ) -> ListedColormap: ... @overload def hls_palette( - n_colors: int = 6, h: float = 0.01, l: float = 0.6, s: float = 0.65, as_cmap: Literal[False] = False + n_colors: int = 6, h: FloatInt = 0.01, l: FloatInt = 0.6, s: FloatInt = 0.65, as_cmap: Literal[False] = False ) -> _RGBColorPalette: ... @overload def husl_palette( - n_colors: int = 6, h: float = 0.01, s: float = 0.9, l: float = 0.65, *, as_cmap: Literal[True] + n_colors: int = 6, h: FloatInt = 0.01, s: FloatInt = 0.9, l: FloatInt = 0.65, *, as_cmap: Literal[True] ) -> ListedColormap: ... @overload def husl_palette( - n_colors: int = 6, h: float = 0.01, s: float = 0.9, l: float = 0.65, as_cmap: Literal[False] = False + n_colors: int = 6, h: FloatInt = 0.01, s: FloatInt = 0.9, l: FloatInt = 0.65, as_cmap: Literal[False] = False ) -> _RGBColorPalette: ... @overload @@ -96,10 +97,10 @@ def light_palette( @overload def diverging_palette( - h_neg: float, - h_pos: float, - s: float = 75, - l: float = 50, + h_neg: FloatInt, + h_pos: FloatInt, + s: FloatInt = 75, + l: FloatInt = 50, sep: int = 1, n: int = 6, center: Literal["light", "dark"] = "light", @@ -108,10 +109,10 @@ def diverging_palette( ) -> LinearSegmentedColormap: ... @overload def diverging_palette( - h_neg: float, - h_pos: float, - s: float = 75, - l: float = 50, + h_neg: FloatInt, + h_pos: FloatInt, + s: FloatInt = 75, + l: FloatInt = 50, sep: int = 1, n: int = 6, center: Literal["light", "dark"] = "light", @@ -133,12 +134,12 @@ def crayon_palette(colors: Iterable[str]) -> _RGBColorPalette: ... @overload def cubehelix_palette( n_colors: int = 6, - start: float = 0, - rot: float = 0.4, - gamma: float = 1.0, - hue: float = 0.8, - light: float = 0.85, - dark: float = 0.15, + start: FloatInt = 0, + rot: FloatInt = 0.4, + gamma: FloatInt = 1.0, + hue: FloatInt = 0.8, + light: FloatInt = 0.85, + dark: FloatInt = 0.15, reverse: bool = False, *, as_cmap: Literal[True], @@ -146,12 +147,12 @@ def cubehelix_palette( @overload def cubehelix_palette( n_colors: int = 6, - start: float = 0, - rot: float = 0.4, - gamma: float = 1.0, - hue: float = 0.8, - light: float = 0.85, - dark: float = 0.15, + start: FloatInt = 0, + rot: FloatInt = 0.4, + gamma: FloatInt = 1.0, + hue: FloatInt = 0.8, + light: FloatInt = 0.85, + dark: FloatInt = 0.15, reverse: bool = False, as_cmap: Literal[False] = False, ) -> _RGBColorPalette: ... diff --git a/stubs/seaborn/seaborn/rcmod.pyi b/stubs/seaborn/seaborn/rcmod.pyi index 04c669d74f0e..6dff65954317 100644 --- a/stubs/seaborn/seaborn/rcmod.pyi +++ b/stubs/seaborn/seaborn/rcmod.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Unused from collections.abc import Callable, Sequence from typing import Any, Literal, TypeVar @@ -26,7 +27,7 @@ def set_theme( style: Literal["white", "dark", "whitegrid", "darkgrid", "ticks"] | dict[str, Any] = "darkgrid", palette: str | Sequence[ColorType] | None = "deep", font: str = "sans-serif", - font_scale: float = 1, + font_scale: FloatInt = 1, color_codes: bool = True, rc: dict[str, Any] | None = None, ) -> None: ... @@ -36,7 +37,7 @@ def set( style: Literal["white", "dark", "whitegrid", "darkgrid", "ticks"] | dict[str, Any] = "darkgrid", palette: str | Sequence[ColorType] | None = "deep", font: str = "sans-serif", - font_scale: float = 1, + font_scale: FloatInt = 1, color_codes: bool = True, rc: dict[str, Any] | None = None, ) -> None: ... @@ -52,12 +53,12 @@ def set_style( ) -> None: ... def plotting_context( context: Literal["paper", "notebook", "talk", "poster"] | dict[str, Any] | None = None, - font_scale: float = 1, + font_scale: FloatInt = 1, rc: dict[str, Any] | None = None, ) -> _PlottingContext[str, Any]: ... def set_context( context: Literal["paper", "notebook", "talk", "poster"] | dict[str, Any] | None = None, - font_scale: float = 1, + font_scale: FloatInt = 1, rc: dict[str, Any] | None = None, ) -> None: ... @@ -70,5 +71,5 @@ class _AxesStyle(_RCAesthetics[_KT, _VT]): ... class _PlottingContext(_RCAesthetics[_KT, _VT]): ... def set_palette( - palette: str | Sequence[ColorType] | None, n_colors: int | None = None, desat: float | None = None, color_codes: bool = False + palette: str | Sequence[ColorType] | None, n_colors: int | None = None, desat: FloatInt | None = None, color_codes: bool = False ) -> None: ... diff --git a/stubs/seaborn/seaborn/regression.pyi b/stubs/seaborn/seaborn/regression.pyi index 615035fa1206..d6c9d7deace6 100644 --- a/stubs/seaborn/seaborn/regression.pyi +++ b/stubs/seaborn/seaborn/regression.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Iterable from typing import Any, Literal, TypeAlias, overload @@ -24,8 +25,8 @@ def lmplot( row: str | None = None, palette: _Palette | None = None, col_wrap: int | None = None, - height: float = 5, - aspect: float = 1, + height: FloatInt = 5, + aspect: FloatInt = 1, markers: str = "o", sharex: bool | Literal["col", "row"] | None = None, # deprecated sharey: bool | Literal["col", "row"] | None = None, # deprecated @@ -51,8 +52,8 @@ def lmplot( x_partial: str | None = None, y_partial: str | None = None, truncate: bool = True, - x_jitter: float | None = None, - y_jitter: float | None = None, + x_jitter: FloatInt | None = None, + y_jitter: FloatInt | None = None, scatter_kws: dict[str, Any] | None = None, line_kws: dict[str, Any] | None = None, facet_kws: dict[str, Any] | None = None, @@ -82,8 +83,8 @@ def regplot( y_partial: _Vector | None = None, truncate: bool = True, dropna: bool = True, - x_jitter: float | None = None, - y_jitter: float | None = None, + x_jitter: FloatInt | None = None, + y_jitter: FloatInt | None = None, label: str | None = None, color: ColorType | None = None, marker: str = "o", @@ -115,8 +116,8 @@ def regplot( y_partial: str | _Vector | None = None, truncate: bool = True, dropna: bool = True, - x_jitter: float | None = None, - y_jitter: float | None = None, + x_jitter: FloatInt | None = None, + y_jitter: FloatInt | None = None, label: str | None = None, color: ColorType | None = None, marker: str = "o", diff --git a/stubs/seaborn/seaborn/relational.pyi b/stubs/seaborn/seaborn/relational.pyi index 7b4ebc48bf2c..580475871700 100644 --- a/stubs/seaborn/seaborn/relational.pyi +++ b/stubs/seaborn/seaborn/relational.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Mapping, Sequence from typing import Any, Literal, TypeAlias @@ -11,8 +12,8 @@ from .utils import _DataSourceWideForm, _ErrorBar, _Estimator, _Legend, _Palette __all__ = ["relplot", "scatterplot", "lineplot"] -_Sizes: TypeAlias = list[int] | list[float] | dict[str, int] | dict[str, float] | tuple[float, float] -_DashType: TypeAlias = tuple[None, None] | Sequence[float] # See matplotlib.lines.Line2D.set_dashes +_Sizes: TypeAlias = list[int] | list[FloatInt] | dict[str, int] | dict[str, FloatInt] | tuple[FloatInt, FloatInt] +_DashType: TypeAlias = tuple[None, None] | Sequence[FloatInt] # See matplotlib.lines.Line2D.set_dashes # "dashes" and "markers" require dict but we use mapping to avoid long unions because dict is invariant in its value type _Dashes: TypeAlias = bool | Sequence[_DashType] | Mapping[Any, _DashType] _Markers: TypeAlias = bool | Sequence[MarkerType] | Mapping[Any, MarkerType] @@ -95,8 +96,8 @@ def relplot( style_order: Iterable[ColumnName] | None = None, legend: _Legend = "auto", kind: Literal["scatter", "line"] = "scatter", - height: float = 5, - aspect: float = 1, + height: FloatInt = 5, + aspect: FloatInt = 1, facet_kws: dict[str, Any] | None = None, **kwargs: Any, ) -> FacetGrid: ... diff --git a/stubs/seaborn/seaborn/utils.pyi b/stubs/seaborn/seaborn/utils.pyi index 5a0345f1088c..a2389a6cd981 100644 --- a/stubs/seaborn/seaborn/utils.pyi +++ b/stubs/seaborn/seaborn/utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime as dt from _typeshed import Incomplete, SupportsGetItem from collections.abc import Callable, Iterable, Mapping, Sequence @@ -31,10 +32,10 @@ __all__ = [ _VectorT = TypeVar("_VectorT", bound=SupportsGetItem[Any, Any]) # Type aliases used heavily throughout seaborn -_ErrorBar: TypeAlias = str | tuple[str, float] | Callable[[Iterable[float]], tuple[float, float]] # noqa: Y047 +_ErrorBar: TypeAlias = str | tuple[str, FloatInt] | Callable[[Iterable[FloatInt]], tuple[float, float]] # noqa: Y047 _Estimator: TypeAlias = str | Callable[..., Incomplete] # noqa: Y047 _Legend: TypeAlias = Literal["auto", "brief", "full"] | bool # noqa: Y047 -_LogScale: TypeAlias = bool | float | tuple[bool | float, bool | float] # noqa: Y047 +_LogScale: TypeAlias = bool | FloatInt | tuple[bool | FloatInt, bool | FloatInt] # noqa: Y047 # `palette` requires dict but we use mapping to avoid a very long union because dict is invariant in its value type _Palette: TypeAlias = str | Sequence[ColorType] | Mapping[Any, ColorType] # noqa: Y047 _Seed: TypeAlias = int | np.random.Generator | np.random.RandomState # noqa: Y047 @@ -73,10 +74,10 @@ DATASET_SOURCE: str DATASET_NAMES_URL: str def ci_to_errsize(cis: ArrayLike, heights: ArrayLike) -> NDArray[np.float64]: ... -def desaturate(color: ColorType, prop: float) -> tuple[float, float, float]: ... +def desaturate(color: ColorType, prop: FloatInt) -> tuple[float, float, float]: ... def saturate(color: ColorType) -> tuple[float, float, float]: ... def set_hls_values( - color: ColorType, h: float | None = None, l: float | None = None, s: float | None = None + color: ColorType, h: FloatInt | None = None, l: FloatInt | None = None, s: FloatInt | None = None ) -> tuple[float, float, float]: ... @deprecated("Function `axlabel` is deprecated and will be removed in a future version") def axlabel(xlabel: str, ylabel: str, **kwargs: Any) -> None: ... @@ -96,14 +97,14 @@ def despine( ) -> None: ... def move_legend(obj: Grid | Axes | Figure, loc: str | int, **kwargs: Any) -> None: ... def ci( - a: float | ArrayLike, which: float | ArrayLike = 95, axis: SupportsIndex | Sequence[SupportsIndex] | None = None + a: FloatInt | ArrayLike, which: FloatInt | ArrayLike = 95, axis: SupportsIndex | Sequence[SupportsIndex] | None = None ) -> NDArray[np.float64]: ... def get_dataset_names() -> list[str]: ... def get_data_home(data_home: str | None = None) -> str: ... def load_dataset(name: str, cache: bool = True, data_home: str | None = None, **kws: Any) -> DataFrame: ... def axis_ticklabels_overlap(labels: Iterable[Text]) -> bool: ... def axes_ticklabels_overlap(ax: Axes) -> tuple[bool, bool]: ... -def locator_to_legend_entries(locator: Locator, limits: Iterable[float], dtype) -> tuple[list[Incomplete], list[str]]: ... +def locator_to_legend_entries(locator: Locator, limits: Iterable[FloatInt], dtype) -> tuple[list[Incomplete], list[str]]: ... @overload def relative_luminance(color: ColorType) -> float: ... # type: ignore[overload-overlap] diff --git a/stubs/setuptools/setuptools/msvc.pyi b/stubs/setuptools/setuptools/msvc.pyi index 433b0b161fd2..df9a67cb7345 100644 --- a/stubs/setuptools/setuptools/msvc.pyi +++ b/stubs/setuptools/setuptools/msvc.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from typing import Final, TypedDict, overload from typing_extensions import LiteralString, NotRequired @@ -70,11 +71,11 @@ class SystemInfo: ri: RegistryInfo pi: PlatformInfo - known_vs_paths: dict[float, str] - vs_ver: float - vc_ver: float + known_vs_paths: dict[FloatInt, str] + vs_ver: FloatInt + vc_ver: FloatInt - def __init__(self, registry_info: RegistryInfo, vc_ver: float | None = None) -> None: ... + def __init__(self, registry_info: RegistryInfo, vc_ver: FloatInt | None = None) -> None: ... def find_reg_vs_vers(self) -> list[float]: ... def find_programdata_vs_vers(self) -> dict[float, str]: ... @property @@ -120,7 +121,7 @@ class EnvironmentInfo: ri: RegistryInfo si: SystemInfo - def __init__(self, arch: str, vc_ver: float | None = None, vc_min_ver: float = 0) -> None: ... + def __init__(self, arch: str, vc_ver: FloatInt | None = None, vc_min_ver: FloatInt = 0) -> None: ... @property def vs_ver(self) -> float: ... @property diff --git a/stubs/shapely/shapely/_coverage.pyi b/stubs/shapely/shapely/_coverage.pyi index fefc40e02d48..8ae731e108b5 100644 --- a/stubs/shapely/shapely/_coverage.pyi +++ b/stubs/shapely/shapely/_coverage.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import overload import numpy as np @@ -7,10 +8,10 @@ from .geometry import Polygon __all__ = ["coverage_invalid_edges", "coverage_is_valid", "coverage_simplify"] -def coverage_is_valid(geometry: OptGeoArrayLike, gap_width: float = 0.0, **kwargs) -> np.bool_: ... -def coverage_invalid_edges(geometry: OptGeoArrayLike, gap_width: float = 0.0, **kwargs) -> GeoArray: ... +def coverage_is_valid(geometry: OptGeoArrayLike, gap_width: FloatInt = 0.0, **kwargs) -> np.bool_: ... +def coverage_invalid_edges(geometry: OptGeoArrayLike, gap_width: FloatInt = 0.0, **kwargs) -> GeoArray: ... @overload -def coverage_simplify(geometry: Polygon, tolerance: ArrayLike[float], *, simplify_boundary: bool = True) -> Polygon: ... +def coverage_simplify(geometry: Polygon, tolerance: ArrayLike[FloatInt], *, simplify_boundary: bool = True) -> Polygon: ... @overload -def coverage_simplify(geometry: GeoArrayLikeSeq, tolerance: ArrayLike[float], *, simplify_boundary: bool = True) -> GeoArray: ... +def coverage_simplify(geometry: GeoArrayLikeSeq, tolerance: ArrayLike[FloatInt], *, simplify_boundary: bool = True) -> GeoArray: ... diff --git a/stubs/shapely/shapely/_geometry.pyi b/stubs/shapely/shapely/_geometry.pyi index a72fae12865f..52af53ea25e7 100644 --- a/stubs/shapely/shapely/_geometry.pyi +++ b/stubs/shapely/shapely/_geometry.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import MaybeNone from enum import IntEnum from typing import Literal, SupportsIndex, TypeAlias, overload @@ -191,10 +192,10 @@ class SetPrecisionMode(ParamEnum): keep_collapsed = 2 @overload -def set_precision(geometry: OptGeoT, grid_size: float, mode: _PrecisionMode = "valid_output", **kwargs) -> OptGeoT: ... +def set_precision(geometry: OptGeoT, grid_size: FloatInt, mode: _PrecisionMode = "valid_output", **kwargs) -> OptGeoT: ... @overload def set_precision( - geometry: OptGeoArrayLikeSeq, grid_size: float, mode: _PrecisionMode = "valid_output", **kwargs + geometry: OptGeoArrayLikeSeq, grid_size: FloatInt, mode: _PrecisionMode = "valid_output", **kwargs ) -> GeoArray: ... @overload @@ -203,8 +204,8 @@ def force_2d(geometry: OptGeoT, **kwargs) -> OptGeoT: ... def force_2d(geometry: OptGeoArrayLikeSeq, **kwargs) -> GeoArray: ... @overload -def force_3d(geometry: OptGeoT, z: float = 0.0, **kwargs) -> OptGeoT: ... +def force_3d(geometry: OptGeoT, z: FloatInt = 0.0, **kwargs) -> OptGeoT: ... @overload -def force_3d(geometry: OptGeoArrayLikeSeq, z: ArrayLike[float] = 0.0, **kwargs) -> GeoArray: ... +def force_3d(geometry: OptGeoArrayLikeSeq, z: ArrayLike[FloatInt] = 0.0, **kwargs) -> GeoArray: ... @overload -def force_3d(geometry: OptGeoArrayLike, z: ArrayLikeSeq[float], **kwargs) -> GeoArray: ... +def force_3d(geometry: OptGeoArrayLike, z: ArrayLikeSeq[FloatInt], **kwargs) -> GeoArray: ... diff --git a/stubs/shapely/shapely/_ragged_array.pyi b/stubs/shapely/shapely/_ragged_array.pyi index a0822d55e5c6..de7bfa1c6423 100644 --- a/stubs/shapely/shapely/_ragged_array.pyi +++ b/stubs/shapely/shapely/_ragged_array.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import numpy as np from numpy.typing import NDArray @@ -8,7 +9,7 @@ def to_ragged_array( geometries: OptGeoArrayLikeSeq, include_z: bool | None = None, include_m: bool | None = None ) -> tuple[GeometryType, NDArray[np.float64], tuple[NDArray[np.int32], ...]]: ... def from_ragged_array( - geometry_type: GeometryType, coords: ArrayLike[float], offsets: ArrayLikeSeq[int] | None = None + geometry_type: GeometryType, coords: ArrayLike[FloatInt], offsets: ArrayLikeSeq[int] | None = None ) -> GeoArray: ... __all__ = ["to_ragged_array", "from_ragged_array"] diff --git a/stubs/shapely/shapely/affinity.pyi b/stubs/shapely/shapely/affinity.pyi index d5e230db085f..7f68eb068469 100644 --- a/stubs/shapely/shapely/affinity.pyi +++ b/stubs/shapely/shapely/affinity.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection from typing import Literal, TypeAlias, overload @@ -7,9 +8,9 @@ from .lib import Geometry __all__ = ["affine_transform", "rotate", "scale", "skew", "translate"] -_Origin: TypeAlias = Literal["center", "centroid"] | Point | tuple[float, float] | tuple[float, float, float] +_Origin: TypeAlias = Literal["center", "centroid"] | Point | tuple[FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] -def affine_transform(geom: GeoT, matrix: Collection[float]) -> GeoT: ... +def affine_transform(geom: GeoT, matrix: Collection[FloatInt]) -> GeoT: ... @overload def interpret_origin(geom: Geometry, origin: _Origin, ndim: Literal[2]) -> tuple[float, float]: ... @@ -18,7 +19,7 @@ def interpret_origin(geom: Geometry, origin: _Origin, ndim: Literal[3]) -> tuple @overload def interpret_origin(geom: Geometry, origin: _Origin, ndim: int) -> tuple[float, float] | tuple[float, float, float]: ... -def rotate(geom: GeoT, angle: float, origin: _Origin = "center", use_radians: bool = False) -> GeoT: ... -def scale(geom: GeoT, xfact: float = 1.0, yfact: float = 1.0, zfact: float = 1.0, origin: _Origin = "center") -> GeoT: ... -def skew(geom: GeoT, xs: float = 0.0, ys: float = 0.0, origin: _Origin = "center", use_radians: bool = False) -> GeoT: ... -def translate(geom: GeoT, xoff: float = 0.0, yoff: float = 0.0, zoff: float = 0.0) -> GeoT: ... +def rotate(geom: GeoT, angle: FloatInt, origin: _Origin = "center", use_radians: bool = False) -> GeoT: ... +def scale(geom: GeoT, xfact: FloatInt = 1.0, yfact: FloatInt = 1.0, zfact: FloatInt = 1.0, origin: _Origin = "center") -> GeoT: ... +def skew(geom: GeoT, xs: FloatInt = 0.0, ys: FloatInt = 0.0, origin: _Origin = "center", use_radians: bool = False) -> GeoT: ... +def translate(geom: GeoT, xoff: FloatInt = 0.0, yoff: FloatInt = 0.0, zoff: FloatInt = 0.0) -> GeoT: ... diff --git a/stubs/shapely/shapely/algorithms/polylabel.pyi b/stubs/shapely/shapely/algorithms/polylabel.pyi index 5d9777c30eab..36ec7a8e6fa1 100644 --- a/stubs/shapely/shapely/algorithms/polylabel.pyi +++ b/stubs/shapely/shapely/algorithms/polylabel.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from ..geometry import Point, Polygon -def polylabel(polygon: Polygon, tolerance: float = 1.0) -> Point: ... +def polylabel(polygon: Polygon, tolerance: FloatInt = 1.0) -> Point: ... diff --git a/stubs/shapely/shapely/constructive.pyi b/stubs/shapely/shapely/constructive.pyi index db28acd35b30..8926cb261117 100644 --- a/stubs/shapely/shapely/constructive.pyi +++ b/stubs/shapely/shapely/constructive.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import MaybeNone from collections.abc import Sequence from typing import Literal, SupportsIndex, overload @@ -70,55 +71,55 @@ def boundary(geometry: OptGeoArrayLikeSeq, **kwargs: Unpack[UFuncKwargs]) -> Geo @overload def buffer( geometry: Geometry, - distance: float, + distance: FloatInt, quad_segs: int = 8, cap_style: BufferJoinStyle | Literal["round", "square", "flat"] = "round", join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, single_sided: bool = False, **kwargs: Unpack[UFuncKwargs], ) -> Polygon: ... @overload def buffer( geometry: None, - distance: float, + distance: FloatInt, quad_segs: int = 8, cap_style: BufferJoinStyle | Literal["round", "square", "flat"] = "round", join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, single_sided: bool = False, **kwargs: Unpack[UFuncKwargs], ) -> None: ... @overload def buffer( geometry: Geometry | None, - distance: float, + distance: FloatInt, quad_segs: int = 8, cap_style: BufferJoinStyle | Literal["round", "square", "flat"] = "round", join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, single_sided: bool = False, **kwargs: Unpack[UFuncKwargs], ) -> Polygon | None: ... @overload def buffer( geometry: OptGeoArrayLike, - distance: ArrayLikeSeq[float], + distance: ArrayLikeSeq[FloatInt], quad_segs: int = 8, cap_style: BufferJoinStyle | Literal["round", "square", "flat"] = "round", join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, single_sided: bool = False, **kwargs: Unpack[UFuncKwargs], ) -> GeoArray: ... @overload def buffer( geometry: OptGeoArrayLikeSeq, - distance: ArrayLike[float], + distance: ArrayLike[FloatInt], quad_segs: int = 8, cap_style: BufferJoinStyle | Literal["round", "square", "flat"] = "round", join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, single_sided: bool = False, **kwargs: Unpack[UFuncKwargs], ) -> GeoArray: ... @@ -126,46 +127,46 @@ def buffer( @overload def offset_curve( geometry: Geometry, - distance: float, + distance: FloatInt, quad_segs: SupportsIndex = 8, join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, **kwargs: Unpack[UFuncKwargs], ) -> LineString | MultiLineString: ... @overload def offset_curve( geometry: None, - distance: float, + distance: FloatInt, quad_segs: SupportsIndex = 8, join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, **kwargs: Unpack[UFuncKwargs], ) -> None: ... @overload def offset_curve( geometry: Geometry | None, - distance: float, + distance: FloatInt, quad_segs: SupportsIndex = 8, join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, **kwargs: Unpack[UFuncKwargs], ) -> LineString | MultiLineString | None: ... @overload def offset_curve( geometry: OptGeoArrayLike, - distance: ArrayLikeSeq[float], + distance: ArrayLikeSeq[FloatInt], quad_segs: SupportsIndex = 8, join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, **kwargs: Unpack[UFuncKwargs], ) -> GeoArray: ... @overload def offset_curve( geometry: OptGeoArrayLikeSeq, - distance: ArrayLike[float], + distance: ArrayLike[FloatInt], quad_segs: SupportsIndex = 8, join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, **kwargs: Unpack[UFuncKwargs], ) -> GeoArray: ... @@ -180,32 +181,32 @@ def centroid(geometry: OptGeoArrayLikeSeq, **kwargs: Unpack[UFuncKwargs]) -> Geo @overload def clip_by_rect( - geometry: Geometry, xmin: float, ymin: float, xmax: float, ymax: float, **kwargs: Unpack[UFuncKwargs] + geometry: Geometry, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry: ... @overload -def clip_by_rect(geometry: None, xmin: float, ymin: float, xmax: float, ymax: float, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def clip_by_rect(geometry: None, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload def clip_by_rect( - geometry: Geometry | None, xmin: float, ymin: float, xmax: float, ymax: float, **kwargs: Unpack[UFuncKwargs] + geometry: Geometry | None, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry | None: ... @overload def clip_by_rect( - geometry: OptGeoArrayLikeSeq, xmin: float, ymin: float, xmax: float, ymax: float, **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLikeSeq, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def concave_hull( - geometry: Geometry, ratio: float = 0.0, allow_holes: bool = False, **kwargs: Unpack[UFuncKwargs] + geometry: Geometry, ratio: FloatInt = 0.0, allow_holes: bool = False, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry: ... @overload -def concave_hull(geometry: None, ratio: float = 0.0, allow_holes: bool = False, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def concave_hull(geometry: None, ratio: FloatInt = 0.0, allow_holes: bool = False, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload def concave_hull( - geometry: Geometry | None, ratio: float = 0.0, allow_holes: bool = False, **kwargs: Unpack[UFuncKwargs] + geometry: Geometry | None, ratio: FloatInt = 0.0, allow_holes: bool = False, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry | None: ... @overload def concave_hull( - geometry: OptGeoArrayLikeSeq, ratio: float = 0.0, allow_holes: bool = False, **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLikeSeq, ratio: FloatInt = 0.0, allow_holes: bool = False, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload @@ -219,44 +220,44 @@ def convex_hull(geometry: OptGeoArrayLikeSeq, **kwargs: Unpack[UFuncKwargs]) -> @overload def delaunay_triangles( - geometry: Geometry, tolerance: float = 0.0, only_edges: Literal[False] = False, **kwargs: Unpack[UFuncKwargs] + geometry: Geometry, tolerance: FloatInt = 0.0, only_edges: Literal[False] = False, **kwargs: Unpack[UFuncKwargs] ) -> GeometryCollection: ... @overload def delaunay_triangles( - geometry: Geometry, tolerance: float, only_edges: Literal[True], **kwargs: Unpack[UFuncKwargs] + geometry: Geometry, tolerance: FloatInt, only_edges: Literal[True], **kwargs: Unpack[UFuncKwargs] ) -> MultiLineString: ... @overload def delaunay_triangles( - geometry: Geometry, tolerance: float = 0.0, *, only_edges: Literal[True], **kwargs: Unpack[UFuncKwargs] + geometry: Geometry, tolerance: FloatInt = 0.0, *, only_edges: Literal[True], **kwargs: Unpack[UFuncKwargs] ) -> MultiLineString: ... @overload def delaunay_triangles( - geometry: Geometry, tolerance: float = 0.0, only_edges: bool = False, **kwargs: Unpack[UFuncKwargs] + geometry: Geometry, tolerance: FloatInt = 0.0, only_edges: bool = False, **kwargs: Unpack[UFuncKwargs] ) -> GeometryCollection | MultiLineString: ... @overload def delaunay_triangles( - geometry: None, tolerance: float = 0.0, only_edges: bool = False, **kwargs: Unpack[UFuncKwargs] + geometry: None, tolerance: FloatInt = 0.0, only_edges: bool = False, **kwargs: Unpack[UFuncKwargs] ) -> None: ... @overload def delaunay_triangles( - geometry: Geometry | None, tolerance: float = 0.0, only_edges: bool = False, **kwargs: Unpack[UFuncKwargs] + geometry: Geometry | None, tolerance: FloatInt = 0.0, only_edges: bool = False, **kwargs: Unpack[UFuncKwargs] ) -> GeometryCollection | MultiLineString | None: ... @overload def delaunay_triangles( - geometry: OptGeoArrayLike, tolerance: ArrayLike[float], only_edges: ArrayLikeSeq[bool], **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, tolerance: ArrayLike[FloatInt], only_edges: ArrayLikeSeq[bool], **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def delaunay_triangles( - geometry: OptGeoArrayLike, tolerance: ArrayLike[float] = 0.0, *, only_edges: ArrayLikeSeq[bool], **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, tolerance: ArrayLike[FloatInt] = 0.0, *, only_edges: ArrayLikeSeq[bool], **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def delaunay_triangles( - geometry: OptGeoArrayLike, tolerance: ArrayLikeSeq[float], only_edges: ArrayLike[bool] = False, **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, tolerance: ArrayLikeSeq[FloatInt], only_edges: ArrayLike[bool] = False, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def delaunay_triangles( geometry: OptGeoArrayLikeSeq, - tolerance: ArrayLike[float] = 0.0, + tolerance: ArrayLike[FloatInt] = 0.0, only_edges: ArrayLike[bool] = False, **kwargs: Unpack[UFuncKwargs], ) -> GeoArray: ... @@ -409,9 +410,9 @@ def polygonize_full( ): ... @overload -def remove_repeated_points(geometry: OptGeoT, tolerance: float = 0.0, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... +def remove_repeated_points(geometry: OptGeoT, tolerance: FloatInt = 0.0, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... @overload -def remove_repeated_points(geometry: OptGeoArrayLikeSeq, tolerance: float = 0.0, **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... +def remove_repeated_points(geometry: OptGeoArrayLikeSeq, tolerance: FloatInt = 0.0, **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... @overload def reverse(geometry: OptGeoT, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... @@ -419,44 +420,44 @@ def reverse(geometry: OptGeoT, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... def reverse(geometry: OptGeoArrayLikeSeq, **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... @overload -def segmentize(geometry: OptGeoT, max_segment_length: float, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... +def segmentize(geometry: OptGeoT, max_segment_length: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... @overload -def segmentize(geometry: OptGeoArrayLike, max_segment_length: ArrayLikeSeq[float], **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... +def segmentize(geometry: OptGeoArrayLike, max_segment_length: ArrayLikeSeq[FloatInt], **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... @overload -def segmentize(geometry: OptGeoArrayLikeSeq, max_segment_length: ArrayLike[float], **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... +def segmentize(geometry: OptGeoArrayLikeSeq, max_segment_length: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... @overload -def simplify(geometry: OptGeoT, tolerance: float, preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... +def simplify(geometry: OptGeoT, tolerance: FloatInt, preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... @overload def simplify( - geometry: OptGeoArrayLike, tolerance: ArrayLikeSeq[float], preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, tolerance: ArrayLikeSeq[FloatInt], preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def simplify( - geometry: OptGeoArrayLikeSeq, tolerance: ArrayLike[float], preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLikeSeq, tolerance: ArrayLike[FloatInt], preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload -def snap(geometry: OptGeoT, reference: Geometry, tolerance: float, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... +def snap(geometry: OptGeoT, reference: Geometry, tolerance: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... @overload -def snap(geometry: Geometry | None, reference: None, tolerance: float, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def snap(geometry: Geometry | None, reference: None, tolerance: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload def snap( - geometry: OptGeoArrayLikeSeq, reference: OptGeoArrayLike, tolerance: ArrayLike[float], **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLikeSeq, reference: OptGeoArrayLike, tolerance: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def snap( - geometry: OptGeoArrayLike, reference: OptGeoArrayLikeSeq, tolerance: ArrayLike[float], **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, reference: OptGeoArrayLikeSeq, tolerance: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def snap( - geometry: OptGeoArrayLike, reference: OptGeoArrayLike, tolerance: ArrayLikeSeq[float], **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, reference: OptGeoArrayLike, tolerance: ArrayLikeSeq[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def voronoi_polygons( geometry: Geometry, - tolerance: float = 0.0, + tolerance: FloatInt = 0.0, extend_to: Geometry | None = None, only_edges: Literal[False] = False, ordered: bool = False, @@ -465,7 +466,7 @@ def voronoi_polygons( @overload def voronoi_polygons( geometry: Geometry, - tolerance: float, + tolerance: FloatInt, extend_to: Geometry | None, only_edges: Literal[True], ordered: bool = False, @@ -474,7 +475,7 @@ def voronoi_polygons( @overload def voronoi_polygons( geometry: Geometry, - tolerance: float = 0.0, + tolerance: FloatInt = 0.0, extend_to: Geometry | None = None, *, only_edges: Literal[True], @@ -484,7 +485,7 @@ def voronoi_polygons( @overload def voronoi_polygons( geometry: Geometry, - tolerance: float = 0.0, + tolerance: FloatInt = 0.0, extend_to: Geometry | None = None, only_edges: bool = False, ordered: bool = False, @@ -493,7 +494,7 @@ def voronoi_polygons( @overload def voronoi_polygons( geometry: None, - tolerance: float = 0.0, + tolerance: FloatInt = 0.0, extend_to: Geometry | None = None, only_edges: bool = False, ordered: bool = False, @@ -502,7 +503,7 @@ def voronoi_polygons( @overload def voronoi_polygons( geometry: Geometry | None, - tolerance: float = 0.0, + tolerance: FloatInt = 0.0, extend_to: Geometry | None = None, only_edges: bool = False, ordered: bool = False, @@ -511,7 +512,7 @@ def voronoi_polygons( @overload # `geometry` as sequence-like def voronoi_polygons( geometry: OptGeoArrayLikeSeq, - tolerance: ArrayLike[float] = 0.0, + tolerance: ArrayLike[FloatInt] = 0.0, extend_to: OptGeoArrayLike = None, only_edges: ArrayLike[bool] = False, ordered: ArrayLike[bool] = False, @@ -520,7 +521,7 @@ def voronoi_polygons( @overload # `tolerance` as sequence-like def voronoi_polygons( geometry: OptGeoArrayLike, - tolerance: ArrayLikeSeq[float], + tolerance: ArrayLikeSeq[FloatInt], extend_to: OptGeoArrayLike = None, only_edges: ArrayLike[bool] = False, ordered: ArrayLike[bool] = False, @@ -529,7 +530,7 @@ def voronoi_polygons( @overload def voronoi_polygons( # `extend_to` as positional sequence-like geometry: OptGeoArrayLike, - tolerance: ArrayLike[float], + tolerance: ArrayLike[FloatInt], extend_to: OptGeoArrayLikeSeq, only_edges: ArrayLike[bool] = False, ordered: ArrayLike[bool] = False, @@ -538,7 +539,7 @@ def voronoi_polygons( # `extend_to` as positional sequence-like @overload # `extend_to` as keyword sequence-like def voronoi_polygons( geometry: OptGeoArrayLike, - tolerance: ArrayLike[float] = 0.0, + tolerance: ArrayLike[FloatInt] = 0.0, *, extend_to: OptGeoArrayLikeSeq, only_edges: ArrayLike[bool] = False, @@ -548,7 +549,7 @@ def voronoi_polygons( @overload def voronoi_polygons( # `only_edges` as positional sequence-like geometry: OptGeoArrayLike, - tolerance: ArrayLike[float], + tolerance: ArrayLike[FloatInt], extend_to: OptGeoArrayLike, only_edges: ArrayLikeSeq[bool], ordered: ArrayLike[bool] = False, @@ -557,7 +558,7 @@ def voronoi_polygons( # `only_edges` as positional sequence-like @overload def voronoi_polygons( # `only_edges` as keyword sequence-like geometry: OptGeoArrayLike, - tolerance: ArrayLike[float] = 0.0, + tolerance: ArrayLike[FloatInt] = 0.0, extend_to: OptGeoArrayLike = None, *, only_edges: ArrayLikeSeq[bool], @@ -567,7 +568,7 @@ def voronoi_polygons( # `only_edges` as keyword sequence-like @overload # `ordered` as positional sequence-like def voronoi_polygons( geometry: OptGeoArrayLike, - tolerance: ArrayLike[float], + tolerance: ArrayLike[FloatInt], extend_to: OptGeoArrayLike, only_edges: ArrayLike[bool], ordered: ArrayLikeSeq[bool], @@ -576,7 +577,7 @@ def voronoi_polygons( @overload # `ordered` as keyword sequence-like def voronoi_polygons( geometry: OptGeoArrayLike, - tolerance: ArrayLike[float] = 0.0, + tolerance: ArrayLike[FloatInt] = 0.0, extend_to: OptGeoArrayLike = None, *, only_edges: ArrayLike[bool] = False, @@ -612,21 +613,21 @@ def minimum_bounding_circle(geometry: OptGeoArrayLikeSeq, **kwargs: Unpack[UFunc @overload def maximum_inscribed_circle( - geometry: Polygon | MultiPolygon, tolerance: float | None = None, **kwargs: Unpack[UFuncKwargs] + geometry: Polygon | MultiPolygon, tolerance: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> LineString: ... @overload -def maximum_inscribed_circle(geometry: None, tolerance: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def maximum_inscribed_circle(geometry: None, tolerance: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload def maximum_inscribed_circle( - geometry: Polygon | MultiPolygon | None, tolerance: float | None = None, **kwargs: Unpack[UFuncKwargs] + geometry: Polygon | MultiPolygon | None, tolerance: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> LineString | None: ... @overload def maximum_inscribed_circle( - geometry: OptGeoArrayLikeSeq, tolerance: ArrayLike[float] | None = None, **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLikeSeq, tolerance: ArrayLike[FloatInt] | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def maximum_inscribed_circle( - geometry: OptGeoArrayLike, tolerance: ArrayLikeSeq[float], **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, tolerance: ArrayLikeSeq[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload diff --git a/stubs/shapely/shapely/coordinates.pyi b/stubs/shapely/shapely/coordinates.pyi index fd3d1284c10f..49c88a745ef8 100644 --- a/stubs/shapely/shapely/coordinates.pyi +++ b/stubs/shapely/shapely/coordinates.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import Literal, overload @@ -49,6 +50,6 @@ def get_coordinates( ) -> NDArray[np.float64] | tuple[NDArray[np.float64], NDArray[np.int64]]: ... @overload -def set_coordinates(geometry: GeoT, coordinates: ArrayLikeSeq[float]) -> GeoT: ... +def set_coordinates(geometry: GeoT, coordinates: ArrayLikeSeq[FloatInt]) -> GeoT: ... @overload -def set_coordinates(geometry: OptGeoArrayLikeSeq, coordinates: ArrayLikeSeq[float]) -> GeoArray: ... +def set_coordinates(geometry: OptGeoArrayLikeSeq, coordinates: ArrayLikeSeq[FloatInt]) -> GeoArray: ... diff --git a/stubs/shapely/shapely/creation.pyi b/stubs/shapely/shapely/creation.pyi index a51ff551071d..c872c1eb61c8 100644 --- a/stubs/shapely/shapely/creation.pyi +++ b/stubs/shapely/shapely/creation.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from typing import Literal, SupportsIndex, TypeAlias, overload from typing_extensions import Unpack @@ -35,9 +36,9 @@ _HandleNaN: TypeAlias = Literal["allow", "skip", "error"] | HandleNaN @overload def points( - coords: float, - y: float, - z: float | None = None, + coords: FloatInt, + y: FloatInt, + z: FloatInt | None = None, indices: None = None, *, handle_nan: _HandleNaN = ..., @@ -46,7 +47,7 @@ def points( ) -> Point: ... @overload def points( - coords: Sequence[float], + coords: Sequence[FloatInt], y: None = None, z: None = None, indices: None = None, @@ -57,9 +58,9 @@ def points( ) -> Point: ... @overload def points( - coords: Sequence[float], # acts as (x1, x2, ...) - y: Sequence[float], # must be (y1, y2, ...) - z: Sequence[float] | None = None, + coords: Sequence[FloatInt], # acts as (x1, x2, ...) + y: Sequence[FloatInt], # must be (y1, y2, ...) + z: Sequence[FloatInt] | None = None, indices: ArrayLikeSeq[int] | None = None, *, handle_nan: _HandleNaN = ..., @@ -68,7 +69,7 @@ def points( ) -> GeoArray: ... @overload def points( - coords: Sequence[Sequence[float]], # acts as (x1, x2, ...), (y1, y2, ...)[, (z1, z2, ...)] + coords: Sequence[Sequence[FloatInt]], # acts as (x1, x2, ...), (y1, y2, ...)[, (z1, z2, ...)] y: None = None, z: None = None, indices: ArrayLikeSeq[int] | None = None, @@ -79,9 +80,9 @@ def points( ) -> GeoArray: ... @overload def points( - coords: ArrayLike[float], - y: ArrayLike[float], - z: ArrayLike[float] | None = None, + coords: ArrayLike[FloatInt], + y: ArrayLike[FloatInt], + z: ArrayLike[FloatInt] | None = None, indices: ArrayLikeSeq[int] | None = None, *, handle_nan: _HandleNaN = ..., @@ -90,9 +91,9 @@ def points( ) -> Point | GeoArray: ... @overload def points( - coords: ArrayLikeSeq[float], - y: ArrayLike[float] | None = None, - z: ArrayLike[float] | None = None, + coords: ArrayLikeSeq[FloatInt], + y: ArrayLike[FloatInt] | None = None, + z: ArrayLike[FloatInt] | None = None, indices: ArrayLikeSeq[int] | None = None, *, handle_nan: _HandleNaN = ..., @@ -102,9 +103,9 @@ def points( @overload def linestrings( - coords: Sequence[float], # acts as (x1, x2, ...) - y: Sequence[float], - z: Sequence[float] | None = None, + coords: Sequence[FloatInt], # acts as (x1, x2, ...) + y: Sequence[FloatInt], + z: Sequence[FloatInt] | None = None, indices: None = None, *, handle_nan: _HandleNaN = ..., @@ -113,7 +114,7 @@ def linestrings( ) -> LineString: ... @overload def linestrings( - coords: Sequence[Sequence[float]], # acts as (x1, y1[, z1]), (x2, y2[, z2]), ... + coords: Sequence[Sequence[FloatInt]], # acts as (x1, y1[, z1]), (x2, y2[, z2]), ... y: None = None, z: None = None, indices: None = None, @@ -124,7 +125,7 @@ def linestrings( ) -> LineString: ... @overload def linestrings( - coords: Sequence[Sequence[Sequence[float]]], # acts as seq of (x1, y1[, z1]), (x2, y2[, z2]), ... + coords: Sequence[Sequence[Sequence[FloatInt]]], # acts as seq of (x1, y1[, z1]), (x2, y2[, z2]), ... y: None = None, z: None = None, indices: ArrayLikeSeq[int] | None = None, @@ -135,9 +136,9 @@ def linestrings( ) -> GeoArray: ... @overload def linestrings( - coords: ArrayLikeSeq[float], - y: ArrayLikeSeq[float] | None = None, - z: ArrayLikeSeq[float] | None = None, + coords: ArrayLikeSeq[FloatInt], + y: ArrayLikeSeq[FloatInt] | None = None, + z: ArrayLikeSeq[FloatInt] | None = None, indices: ArrayLikeSeq[int] | None = None, *, handle_nan: _HandleNaN = ..., @@ -147,9 +148,9 @@ def linestrings( @overload def linearrings( - coords: Sequence[float], # acts as (x1, x2, ...) - y: Sequence[float], - z: Sequence[float] | None = None, + coords: Sequence[FloatInt], # acts as (x1, x2, ...) + y: Sequence[FloatInt], + z: Sequence[FloatInt] | None = None, indices: None = None, *, handle_nan: _HandleNaN = ..., @@ -158,7 +159,7 @@ def linearrings( ) -> LinearRing: ... @overload def linearrings( - coords: Sequence[Sequence[float]], # acts as (x1, y1[, z1]), (x2, y2[, z2]), ... + coords: Sequence[Sequence[FloatInt]], # acts as (x1, y1[, z1]), (x2, y2[, z2]), ... y: None = None, z: None = None, indices: None = None, @@ -169,7 +170,7 @@ def linearrings( ) -> LinearRing: ... @overload def linearrings( - coords: Sequence[Sequence[Sequence[float]]], # acts as seq of (x1, y1[, z1]), (x2, y2[, z2]), ... + coords: Sequence[Sequence[Sequence[FloatInt]]], # acts as seq of (x1, y1[, z1]), (x2, y2[, z2]), ... y: None = None, z: None = None, indices: ArrayLikeSeq[int] | None = None, @@ -180,9 +181,9 @@ def linearrings( ) -> GeoArray: ... @overload def linearrings( - coords: ArrayLikeSeq[float], - y: ArrayLikeSeq[float] | None = None, - z: ArrayLikeSeq[float] | None = None, + coords: ArrayLikeSeq[FloatInt], + y: ArrayLikeSeq[FloatInt] | None = None, + z: ArrayLikeSeq[FloatInt] | None = None, indices: ArrayLikeSeq[int] | None = None, *, handle_nan: _HandleNaN = ..., @@ -192,8 +193,8 @@ def linearrings( @overload def polygons( - geometries: LinearRing | Sequence[Sequence[float]] | None, - holes: ArrayLikeSeq[float] | OptGeoArrayLikeSeq | None = None, + geometries: LinearRing | Sequence[Sequence[FloatInt]] | None, + holes: ArrayLikeSeq[FloatInt] | OptGeoArrayLikeSeq | None = None, indices: None = None, *, out: None = None, @@ -201,8 +202,8 @@ def polygons( ) -> Polygon: ... @overload def polygons( - geometries: Sequence[LinearRing | Sequence[Sequence[float]] | None], - holes: ArrayLikeSeq[float] | OptGeoArrayLikeSeq | None = None, + geometries: Sequence[LinearRing | Sequence[Sequence[FloatInt]] | None], + holes: ArrayLikeSeq[FloatInt] | OptGeoArrayLikeSeq | None = None, indices: ArrayLikeSeq[int] | None = None, *, out: NDArray[np.object_] | None = None, @@ -210,8 +211,8 @@ def polygons( ) -> GeoArray: ... @overload def polygons( - geometries: ArrayLikeSeq[float] | OptGeoArrayLikeSeq, - holes: ArrayLikeSeq[float] | OptGeoArrayLikeSeq | None = None, + geometries: ArrayLikeSeq[FloatInt] | OptGeoArrayLikeSeq, + holes: ArrayLikeSeq[FloatInt] | OptGeoArrayLikeSeq | None = None, indices: ArrayLikeSeq[int] | None = None, *, out: NDArray[np.object_] | None = None, @@ -219,20 +220,20 @@ def polygons( ) -> Polygon | GeoArray: ... @overload -def box(xmin: float, ymin: float, xmax: float, ymax: float, ccw: bool = True, **kwargs: Unpack[UFuncKwargsNoOut]) -> Polygon: ... +def box(xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, ccw: bool = True, **kwargs: Unpack[UFuncKwargsNoOut]) -> Polygon: ... @overload def box( - xmin: ArrayLikeSeq[float], - ymin: ArrayLikeSeq[float], - xmax: ArrayLikeSeq[float], - ymax: ArrayLikeSeq[float], + xmin: ArrayLikeSeq[FloatInt], + ymin: ArrayLikeSeq[FloatInt], + xmax: ArrayLikeSeq[FloatInt], + ymax: ArrayLikeSeq[FloatInt], ccw: bool = True, **kwargs: Unpack[UFuncKwargsNoOut], ) -> GeoArray: ... @overload def multipoints( - geometries: Sequence[Point | Sequence[float] | None], + geometries: Sequence[Point | Sequence[FloatInt] | None], indices: None = None, *, out: None = None, @@ -240,7 +241,7 @@ def multipoints( ) -> MultiPoint: ... @overload def multipoints( - geometries: Sequence[Sequence[Point | Sequence[float] | None]], + geometries: Sequence[Sequence[Point | Sequence[FloatInt] | None]], indices: ArrayLikeSeq[int] | None = None, *, out: NDArray[np.object_] | None = None, @@ -257,7 +258,7 @@ def multipoints( @overload def multilinestrings( - geometries: Sequence[LineString | Sequence[Sequence[float]] | None], + geometries: Sequence[LineString | Sequence[Sequence[FloatInt]] | None], indices: None = None, *, out: None = None, @@ -265,7 +266,7 @@ def multilinestrings( ) -> MultiLineString: ... @overload def multilinestrings( - geometries: Sequence[Sequence[LineString | Sequence[Sequence[float]] | None]], + geometries: Sequence[Sequence[LineString | Sequence[Sequence[FloatInt]] | None]], indices: ArrayLikeSeq[int] | None = None, *, out: NDArray[np.object_] | None = None, @@ -282,7 +283,7 @@ def multilinestrings( @overload def multipolygons( - geometries: Sequence[Polygon | Sequence[Sequence[float]] | None], + geometries: Sequence[Polygon | Sequence[Sequence[FloatInt]] | None], indices: None = None, *, out: None = None, @@ -290,7 +291,7 @@ def multipolygons( ) -> MultiPolygon: ... @overload def multipolygons( - geometries: Sequence[Sequence[Polygon | Sequence[Sequence[float]] | None]], + geometries: Sequence[Sequence[Polygon | Sequence[Sequence[FloatInt]] | None]], indices: ArrayLikeSeq[int] | None = None, *, out: NDArray[np.object_] | None = None, diff --git a/stubs/shapely/shapely/geometry/base.pyi b/stubs/shapely/shapely/geometry/base.pyi index 379c911c9428..29489e134bfc 100644 --- a/stubs/shapely/shapely/geometry/base.pyi +++ b/stubs/shapely/shapely/geometry/base.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import MaybeNone from array import array from collections.abc import Iterator @@ -90,7 +91,7 @@ class BaseGeometry(Geometry): def wkb(self) -> bytes: ... @property def wkb_hex(self) -> str: ... - def svg(self, scale_factor: float = 1.0, **kwargs) -> str: ... + def svg(self, scale_factor: FloatInt = 1.0, **kwargs) -> str: ... def _repr_svg_(self) -> str: ... @property def geom_type(self) -> str: ... @@ -129,46 +130,46 @@ class BaseGeometry(Geometry): def minimum_rotated_rectangle(self) -> BaseGeometry: ... def buffer( self, - distance: float, + distance: FloatInt, quad_segs: int = 16, cap_style: BufferCapStyle | Literal["round", "square", "flat"] = "round", join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = "round", - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, single_sided: bool = False, *, quadsegs: int | None = None, # deprecated resolution: int | None = None, # deprecated ) -> Polygon: ... - def simplify(self, tolerance: float, preserve_topology: bool = True) -> BaseGeometry: ... + def simplify(self, tolerance: FloatInt, preserve_topology: bool = True) -> BaseGeometry: ... def normalize(self) -> BaseGeometry: ... @overload - def difference(self, other: Geometry, grid_size: float | None = None) -> BaseGeometry: ... + def difference(self, other: Geometry, grid_size: FloatInt | None = None) -> BaseGeometry: ... @overload - def difference(self, other: OptGeoArrayLikeSeq, grid_size: float | None = None) -> GeoArray: ... + def difference(self, other: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None) -> GeoArray: ... @overload - def difference(self, other: None, grid_size: float | None = None) -> None: ... + def difference(self, other: None, grid_size: FloatInt | None = None) -> None: ... @overload - def intersection(self, other: Geometry, grid_size: float | None = None) -> BaseGeometry: ... + def intersection(self, other: Geometry, grid_size: FloatInt | None = None) -> BaseGeometry: ... @overload - def intersection(self, other: OptGeoArrayLikeSeq, grid_size: float | None = None) -> GeoArray: ... + def intersection(self, other: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None) -> GeoArray: ... @overload - def intersection(self, other: None, grid_size: float | None = None) -> None: ... + def intersection(self, other: None, grid_size: FloatInt | None = None) -> None: ... @overload - def symmetric_difference(self, other: Geometry, grid_size: float | None = None) -> BaseGeometry: ... + def symmetric_difference(self, other: Geometry, grid_size: FloatInt | None = None) -> BaseGeometry: ... @overload - def symmetric_difference(self, other: OptGeoArrayLikeSeq, grid_size: float | None = None) -> GeoArray: ... + def symmetric_difference(self, other: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None) -> GeoArray: ... @overload - def symmetric_difference(self, other: None, grid_size: float | None = None) -> None: ... + def symmetric_difference(self, other: None, grid_size: FloatInt | None = None) -> None: ... @overload - def union(self, other: Geometry, grid_size: float | None = None) -> BaseGeometry: ... + def union(self, other: Geometry, grid_size: FloatInt | None = None) -> BaseGeometry: ... @overload - def union(self, other: OptGeoArrayLikeSeq, grid_size: float | None = None) -> GeoArray: ... + def union(self, other: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None) -> GeoArray: ... @overload - def union(self, other: None, grid_size: float | None = None) -> None: ... + def union(self, other: None, grid_size: FloatInt | None = None) -> None: ... @property def has_z(self) -> bool: ... @@ -248,21 +249,21 @@ class BaseGeometry(Geometry): def within(self, other: OptGeoArrayLikeSeq) -> NDArray[np.bool_]: ... @overload - def dwithin(self, other: Geometry | None, distance: float) -> bool: ... + def dwithin(self, other: Geometry | None, distance: FloatInt) -> bool: ... @overload - def dwithin(self, other: OptGeoArrayLikeSeq, distance: float) -> NDArray[np.bool_]: ... + def dwithin(self, other: OptGeoArrayLikeSeq, distance: FloatInt) -> NDArray[np.bool_]: ... @overload - def dwithin(self, other: OptGeoArrayLike, distance: ArrayLikeSeq[float]) -> NDArray[np.bool_]: ... + def dwithin(self, other: OptGeoArrayLike, distance: ArrayLikeSeq[FloatInt]) -> NDArray[np.bool_]: ... @overload - def equals_exact(self, other: Geometry | None, tolerance: float = 0.0, *, normalize: bool = False) -> bool: ... + def equals_exact(self, other: Geometry | None, tolerance: FloatInt = 0.0, *, normalize: bool = False) -> bool: ... @overload def equals_exact( - self, other: OptGeoArrayLikeSeq, tolerance: float = 0.0, *, normalize: bool = False + self, other: OptGeoArrayLikeSeq, tolerance: FloatInt = 0.0, *, normalize: bool = False ) -> NDArray[np.bool_]: ... @overload def equals_exact( - self, other: OptGeoArrayLike, tolerance: ArrayLikeSeq[float], *, normalize: bool = False + self, other: OptGeoArrayLike, tolerance: ArrayLikeSeq[FloatInt], *, normalize: bool = False ) -> NDArray[np.bool_]: ... @overload @@ -281,19 +282,19 @@ class BaseGeometry(Geometry): def project(self, other: OptGeoArrayLikeSeq, normalized: bool = False) -> NDArray[np.float64]: ... @overload - def line_interpolate_point(self, distance: float, normalized: bool = False) -> Point: ... + def line_interpolate_point(self, distance: FloatInt, normalized: bool = False) -> Point: ... @overload - def line_interpolate_point(self, distance: ArrayLikeSeq[float], normalized: bool = False) -> GeoArray: ... + def line_interpolate_point(self, distance: ArrayLikeSeq[FloatInt], normalized: bool = False) -> GeoArray: ... @overload - def interpolate(self, distance: float, normalized: bool = False) -> Point: ... + def interpolate(self, distance: FloatInt, normalized: bool = False) -> Point: ... @overload - def interpolate(self, distance: ArrayLikeSeq[float], normalized: bool = False) -> GeoArray: ... + def interpolate(self, distance: ArrayLikeSeq[FloatInt], normalized: bool = False) -> GeoArray: ... @overload - def segmentize(self, max_segment_length: float) -> Self: ... + def segmentize(self, max_segment_length: FloatInt) -> Self: ... @overload - def segmentize(self, max_segment_length: ArrayLikeSeq[float]) -> GeoArray: ... + def segmentize(self, max_segment_length: ArrayLikeSeq[FloatInt]) -> GeoArray: ... def reverse(self) -> Self: ... @@ -305,7 +306,7 @@ class BaseMultipartGeometry(BaseGeometry, Generic[_GeoT_co]): def coords(self) -> Never: ... @property def geoms(self) -> GeometrySequence[Self]: ... - def svg(self, scale_factor: float = 1.0, color: str | None = None) -> str: ... # type: ignore[override] + def svg(self, scale_factor: FloatInt = 1.0, color: str | None = None) -> str: ... # type: ignore[override] _P_co = TypeVar("_P_co", covariant=True, bound=BaseMultipartGeometry[Geometry]) diff --git a/stubs/shapely/shapely/geometry/geo.pyi b/stubs/shapely/shapely/geometry/geo.pyi index ac1c48664f48..8b5c2735668c 100644 --- a/stubs/shapely/shapely/geometry/geo.pyi +++ b/stubs/shapely/shapely/geometry/geo.pyi @@ -1,9 +1,10 @@ +from _typeshed import FloatInt from typing import Any from .._typing import SupportsGeoInterface from .base import BaseGeometry from .polygon import Polygon -def box(minx: float, miny: float, maxx: float, maxy: float, ccw: bool = True) -> Polygon: ... +def box(minx: FloatInt, miny: FloatInt, maxx: FloatInt, maxy: FloatInt, ccw: bool = True) -> Polygon: ... def shape(context: dict[str, Any] | SupportsGeoInterface) -> BaseGeometry: ... def mapping(ob: SupportsGeoInterface) -> dict[str, Any]: ... diff --git a/stubs/shapely/shapely/geometry/linestring.pyi b/stubs/shapely/shapely/geometry/linestring.pyi index 54649d1e6963..e0653b4e8e40 100644 --- a/stubs/shapely/shapely/geometry/linestring.pyi +++ b/stubs/shapely/shapely/geometry/linestring.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import Literal, SupportsFloat, SupportsIndex, TypeAlias from typing_extensions import Self @@ -12,26 +13,26 @@ from .polygon import Polygon __all__ = ["LineString"] -_ConvertibleToLineString: TypeAlias = LineString | ArrayLikeSeq[float] | Iterable[Point | Iterable[SupportsFloat]] +_ConvertibleToLineString: TypeAlias = LineString | ArrayLikeSeq[FloatInt] | Iterable[Point | Iterable[SupportsFloat]] class LineString(BaseGeometry): __slots__: list[str] = [] def __new__(self, coordinates: _ConvertibleToLineString | None = None) -> Self: ... - def svg(self, scale_factor: float = 1.0, stroke_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] + def svg(self, scale_factor: FloatInt = 1.0, stroke_color: str | None = None, opacity: FloatInt | None = None) -> str: ... # type: ignore[override] def offset_curve( self, - distance: float, + distance: FloatInt, quad_segs: SupportsIndex = 16, join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = ..., - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, ) -> LineString | MultiLineString: ... def parallel_offset( # to be deprecated self, - distance: float, + distance: FloatInt, side: str = "right", resolution: SupportsIndex = 16, join_style: BufferJoinStyle | Literal["round", "mitre", "bevel"] = ..., - mitre_limit: float = 5.0, + mitre_limit: FloatInt = 5.0, ) -> LineString | MultiLineString: ... # more precise base overrides @property diff --git a/stubs/shapely/shapely/geometry/multilinestring.pyi b/stubs/shapely/shapely/geometry/multilinestring.pyi index ec0f6c53857c..df38d725c6bd 100644 --- a/stubs/shapely/shapely/geometry/multilinestring.pyi +++ b/stubs/shapely/shapely/geometry/multilinestring.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection from typing import Literal from typing_extensions import Self @@ -11,7 +12,7 @@ __all__ = ["MultiLineString"] class MultiLineString(BaseMultipartGeometry[LineString]): __slots__: list[str] = [] def __new__(self, lines: BaseMultipartGeometry | Collection[_ConvertibleToLineString] | None = None) -> Self: ... - def svg(self, scale_factor: float = 1.0, stroke_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] + def svg(self, scale_factor: FloatInt = 1.0, stroke_color: str | None = None, opacity: FloatInt | None = None) -> str: ... # type: ignore[override] # more precise base overrides @property def geom_type(self) -> Literal["MultiLineString"]: ... diff --git a/stubs/shapely/shapely/geometry/multipoint.pyi b/stubs/shapely/shapely/geometry/multipoint.pyi index c931c474d165..23798917f6ae 100644 --- a/stubs/shapely/shapely/geometry/multipoint.pyi +++ b/stubs/shapely/shapely/geometry/multipoint.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection from typing import Literal from typing_extensions import Self @@ -16,7 +17,7 @@ class MultiPoint(BaseMultipartGeometry[Point]): # I went with Collection as false negatives seem better to me than false positives in this case __slots__: list[str] = [] def __new__(self, points: MultiPoint | Collection[_PointLike] | None = None) -> Self: ... - def svg(self, scale_factor: float = 1.0, fill_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] + def svg(self, scale_factor: FloatInt = 1.0, fill_color: str | None = None, opacity: FloatInt | None = None) -> str: ... # type: ignore[override] # more precise base overrides @property def geom_type(self) -> Literal["MultiPoint"]: ... diff --git a/stubs/shapely/shapely/geometry/multipolygon.pyi b/stubs/shapely/shapely/geometry/multipolygon.pyi index 0c60c5fa7da9..9146c5f6bac8 100644 --- a/stubs/shapely/shapely/geometry/multipolygon.pyi +++ b/stubs/shapely/shapely/geometry/multipolygon.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection from typing import Literal from typing_extensions import Self @@ -18,7 +19,7 @@ class MultiPolygon(BaseMultipartGeometry[Polygon]): | None ) = None, ) -> Self: ... - def svg(self, scale_factor: float = 1.0, fill_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] + def svg(self, scale_factor: FloatInt = 1.0, fill_color: str | None = None, opacity: FloatInt | None = None) -> str: ... # type: ignore[override] # more precise base overrides @property def geom_type(self) -> Literal["MultiPolygon"]: ... diff --git a/stubs/shapely/shapely/geometry/point.pyi b/stubs/shapely/shapely/geometry/point.pyi index 5f37e65a7b93..3eb6806b1e44 100644 --- a/stubs/shapely/shapely/geometry/point.pyi +++ b/stubs/shapely/shapely/geometry/point.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import Literal, TypeAlias, overload from typing_extensions import Self @@ -8,7 +9,7 @@ from .collection import GeometryCollection __all__ = ["Point"] -_PointLike: TypeAlias = Point | Iterable[float] | ArrayLikeSeq[float] +_PointLike: TypeAlias = Point | Iterable[FloatInt] | ArrayLikeSeq[FloatInt] class Point(BaseGeometry): __slots__: list[str] = [] @@ -18,9 +19,9 @@ class Point(BaseGeometry): @overload # one arg: (x, y[, z]) tuple or a Point instance def __new__(self, coords: _PointLike, /) -> Self: ... @overload # two args: (x, y) tuple - def __new__(self, x: float, y: float, /) -> Self: ... + def __new__(self, x: FloatInt, y: FloatInt, /) -> Self: ... @overload # three args: (x, y, z) tuple - def __new__(self, x: float, y: float, z: float, /) -> Self: ... + def __new__(self, x: FloatInt, y: FloatInt, z: FloatInt, /) -> Self: ... @property def x(self) -> float: ... @@ -30,7 +31,7 @@ class Point(BaseGeometry): def z(self) -> float: ... @property def m(self) -> float: ... - def svg(self, scale_factor: float = 1.0, fill_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] + def svg(self, scale_factor: FloatInt = 1.0, fill_color: str | None = None, opacity: FloatInt | None = None) -> str: ... # type: ignore[override] # more precise base overrides @property def geom_type(self) -> Literal["Point"]: ... diff --git a/stubs/shapely/shapely/geometry/polygon.pyi b/stubs/shapely/shapely/geometry/polygon.pyi index e52857a88946..180cc9b99dfc 100644 --- a/stubs/shapely/shapely/geometry/polygon.pyi +++ b/stubs/shapely/shapely/geometry/polygon.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Collection from typing import Literal, TypeAlias, overload from typing_extensions import Never, Self @@ -40,13 +41,13 @@ class Polygon(BaseGeometry): def interiors(self) -> list[LinearRing] | InteriorRingSequence: ... @property def coords(self) -> Never: ... - def svg(self, scale_factor: float = 1.0, fill_color: str | None = None, opacity: float | None = None) -> str: ... # type: ignore[override] + def svg(self, scale_factor: FloatInt = 1.0, fill_color: str | None = None, opacity: FloatInt | None = None) -> str: ... # type: ignore[override] @classmethod - def from_bounds(cls, xmin: float, ymin: float, xmax: float, ymax: float) -> Self: ... + def from_bounds(cls, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt) -> Self: ... # more precise base overrides @property def geom_type(self) -> Literal["Polygon"]: ... @property def boundary(self) -> MultiLineString: ... -def orient(polygon: Polygon, sign: float = 1.0) -> Polygon: ... +def orient(polygon: Polygon, sign: FloatInt = 1.0) -> Polygon: ... diff --git a/stubs/shapely/shapely/lib.pyi b/stubs/shapely/shapely/lib.pyi index ea224928eab6..248efc7b793b 100644 --- a/stubs/shapely/shapely/lib.pyi +++ b/stubs/shapely/shapely/lib.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal, SupportsIndex, final, overload from typing_extensions import Never, Self, disjoint_base @@ -160,7 +161,7 @@ class STRtree: def nearest(self, geoms: NDArray[np.object_], /) -> NDArray[np.int64]: ... def query(self, geoms: NDArray[np.object_], predicate: SupportsIndex, /) -> NDArray[np.int64]: ... def query_nearest( - self, geoms: NDArray[np.object_], max_distance: float, exclusive: SupportsIndex, all_matches: SupportsIndex, / + self, geoms: NDArray[np.object_], max_distance: FloatInt, exclusive: SupportsIndex, all_matches: SupportsIndex, / ) -> tuple[NDArray[np.int64], NDArray[np.float64]]: ... class ShapelyError(Exception): ... diff --git a/stubs/shapely/shapely/linear.pyi b/stubs/shapely/shapely/linear.pyi index 904a00ce1f95..a99204ae4622 100644 --- a/stubs/shapely/shapely/linear.pyi +++ b/stubs/shapely/shapely/linear.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import overload import numpy as np @@ -10,22 +11,22 @@ from .lib import Geometry __all__ = ["line_interpolate_point", "line_locate_point", "line_merge", "shared_paths", "shortest_line"] @overload -def line_interpolate_point(line: None, distance: float, normalized: bool = False, **kwargs) -> None: ... +def line_interpolate_point(line: None, distance: FloatInt, normalized: bool = False, **kwargs) -> None: ... @overload def line_interpolate_point( - line: None, distance: ArrayLikeSeq[float], normalized: bool = False, **kwargs + line: None, distance: ArrayLikeSeq[FloatInt], normalized: bool = False, **kwargs ) -> NDArray[np.object_]: ... # Array of None @overload def line_interpolate_point( - line: LineString | MultiLineString | GeometryCollection, distance: float, normalized: bool = False, **kwargs + line: LineString | MultiLineString | GeometryCollection, distance: FloatInt, normalized: bool = False, **kwargs ) -> Point: ... @overload def line_interpolate_point( - line: LineString | MultiLineString | GeometryCollection, distance: ArrayLikeSeq[float], normalized: bool = False, **kwargs + line: LineString | MultiLineString | GeometryCollection, distance: ArrayLikeSeq[FloatInt], normalized: bool = False, **kwargs ) -> GeoArray: ... @overload def line_interpolate_point( - line: OptGeoArrayLikeSeq, distance: ArrayLike[float], normalized: bool = False, **kwargs + line: OptGeoArrayLikeSeq, distance: ArrayLike[FloatInt], normalized: bool = False, **kwargs ) -> GeoArray: ... @overload diff --git a/stubs/shapely/shapely/measurement.pyi b/stubs/shapely/shapely/measurement.pyi index b0291b92f633..0263f6b3123a 100644 --- a/stubs/shapely/shapely/measurement.pyi +++ b/stubs/shapely/shapely/measurement.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import overload import numpy as np @@ -39,29 +40,29 @@ def length(geometry: Geometry | None, **kwargs) -> np.float64: ... def length(geometry: OptGeoArrayLikeSeq, **kwargs) -> NDArray[np.float64]: ... @overload -def hausdorff_distance(a: Geometry | None, b: Geometry | None, densify: float | None = None, **kwargs) -> np.float64: ... +def hausdorff_distance(a: Geometry | None, b: Geometry | None, densify: FloatInt | None = None, **kwargs) -> np.float64: ... @overload -def hausdorff_distance(a: OptGeoArrayLike, b: OptGeoArrayLike, densify: ArrayLikeSeq[float], **kwargs) -> NDArray[np.float64]: ... +def hausdorff_distance(a: OptGeoArrayLike, b: OptGeoArrayLike, densify: ArrayLikeSeq[FloatInt], **kwargs) -> NDArray[np.float64]: ... @overload def hausdorff_distance( - a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, densify: ArrayLike[float] | None = None, **kwargs + a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, densify: ArrayLike[FloatInt] | None = None, **kwargs ) -> NDArray[np.float64]: ... @overload def hausdorff_distance( - a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, densify: ArrayLike[float] | None = None, **kwargs + a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, densify: ArrayLike[FloatInt] | None = None, **kwargs ) -> NDArray[np.float64]: ... @overload -def frechet_distance(a: Geometry | None, b: Geometry | None, densify: float | None = None, **kwargs) -> np.float64: ... +def frechet_distance(a: Geometry | None, b: Geometry | None, densify: FloatInt | None = None, **kwargs) -> np.float64: ... @overload -def frechet_distance(a: OptGeoArrayLike, b: OptGeoArrayLike, densify: ArrayLikeSeq[float], **kwargs) -> NDArray[np.float64]: ... +def frechet_distance(a: OptGeoArrayLike, b: OptGeoArrayLike, densify: ArrayLikeSeq[FloatInt], **kwargs) -> NDArray[np.float64]: ... @overload def frechet_distance( - a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, densify: ArrayLike[float] | None = None, **kwargs + a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, densify: ArrayLike[FloatInt] | None = None, **kwargs ) -> NDArray[np.float64]: ... @overload def frechet_distance( - a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, densify: ArrayLike[float] | None = None, **kwargs + a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, densify: ArrayLike[FloatInt] | None = None, **kwargs ) -> NDArray[np.float64]: ... @overload diff --git a/stubs/shapely/shapely/ops.pyi b/stubs/shapely/shapely/ops.pyi index 206f91861b3e..221bc6b218d2 100644 --- a/stubs/shapely/shapely/ops.pyi +++ b/stubs/shapely/shapely/ops.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Iterable from typing import Any, Literal, overload @@ -56,29 +57,29 @@ unary_union = operator.unary_union # This is also an alias to operator method but we want to mark it as deprecated @overload # edges false -def triangulate(geom: Geometry, tolerance: float = 0.0, edges: Literal[False] = False) -> list[Polygon]: ... +def triangulate(geom: Geometry, tolerance: FloatInt = 0.0, edges: Literal[False] = False) -> list[Polygon]: ... @overload # edges true (keyword) -def triangulate(geom: Geometry, tolerance: float = 0.0, *, edges: Literal[True]) -> list[LineString]: ... +def triangulate(geom: Geometry, tolerance: FloatInt = 0.0, *, edges: Literal[True]) -> list[LineString]: ... @overload # edges true (positional) -def triangulate(geom: Geometry, tolerance: float, edges: Literal[True]) -> list[LineString]: ... +def triangulate(geom: Geometry, tolerance: FloatInt, edges: Literal[True]) -> list[LineString]: ... @overload # fallback -def triangulate(geom: Geometry, tolerance: float = 0.0, edges: bool = False) -> list[Polygon] | list[LineString]: ... +def triangulate(geom: Geometry, tolerance: FloatInt = 0.0, edges: bool = False) -> list[Polygon] | list[LineString]: ... @overload def voronoi_diagram( - geom: Geometry, envelope: Geometry | None = None, tolerance: float = 0.0, edges: Literal[False] = False + geom: Geometry, envelope: Geometry | None = None, tolerance: FloatInt = 0.0, edges: Literal[False] = False ) -> GeometryCollection[Polygon]: ... @overload def voronoi_diagram( - geom: Geometry, envelope: Geometry | None, tolerance: float, edges: Literal[True] + geom: Geometry, envelope: Geometry | None, tolerance: FloatInt, edges: Literal[True] ) -> GeometryCollection[LineString | MultiLineString]: ... @overload def voronoi_diagram( - geom: Geometry, envelope: Geometry | None = None, tolerance: float = 0.0, *, edges: Literal[True] + geom: Geometry, envelope: Geometry | None = None, tolerance: FloatInt = 0.0, *, edges: Literal[True] ) -> GeometryCollection[LineString | MultiLineString]: ... @overload def voronoi_diagram( - geom: Geometry, envelope: Geometry | None = None, tolerance: float = 0.0, edges: bool = False + geom: Geometry, envelope: Geometry | None = None, tolerance: FloatInt = 0.0, edges: bool = False ) -> GeometryCollection[Polygon | LineString | MultiLineString]: ... @overload @@ -88,9 +89,9 @@ def validate(geom: Geometry) -> str: ... @overload def validate(geom: Geometry | None) -> str | None: ... -def transform(func: Callable[[float, float, float | None], tuple[float, ...]], geom: GeoT) -> GeoT: ... +def transform(func: Callable[[FloatInt, FloatInt, FloatInt | None], tuple[float, ...]], geom: GeoT) -> GeoT: ... def nearest_points(g1: Geometry, g2: Geometry) -> tuple[Point, Point]: ... -def snap(g1: GeoT, g2: Geometry, tolerance: float) -> GeoT: ... +def snap(g1: GeoT, g2: Geometry, tolerance: FloatInt) -> GeoT: ... def shared_paths(g1: LineString, g2: LineString) -> GeometryCollection[MultiLineString]: ... class SplitOp: @@ -99,6 +100,6 @@ class SplitOp: split = SplitOp.split -def substring(geom: LineString, start_dist: float, end_dist: float, normalized: bool = False) -> Point | LineString: ... -def clip_by_rect(geom: Geometry, xmin: float, ymin: float, xmax: float, ymax: float) -> BaseGeometry: ... -def orient(geom: GeoT, sign: float = 1.0) -> GeoT: ... +def substring(geom: LineString, start_dist: FloatInt, end_dist: FloatInt, normalized: bool = False) -> Point | LineString: ... +def clip_by_rect(geom: Geometry, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt) -> BaseGeometry: ... +def orient(geom: GeoT, sign: FloatInt = 1.0) -> GeoT: ... diff --git a/stubs/shapely/shapely/plotting.pyi b/stubs/shapely/shapely/plotting.pyi index 5afa968029c4..ac3ddc55e566 100644 --- a/stubs/shapely/shapely/plotting.pyi +++ b/stubs/shapely/shapely/plotting.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any, Literal, overload from matplotlib.axes import Axes # type: ignore[import-not-found] @@ -18,7 +19,7 @@ def plot_polygon( color: ColorType | None = None, facecolor: ColorType | None = None, edgecolor: ColorType | None = None, - linewidth: float | None = None, + linewidth: FloatInt | None = None, **kwargs: Any, ) -> tuple[PathPatch, Line2D]: ... @overload @@ -30,7 +31,7 @@ def plot_polygon( color: ColorType | None = None, facecolor: ColorType | None = None, edgecolor: ColorType | None = None, - linewidth: float | None = None, + linewidth: FloatInt | None = None, **kwargs: Any, ) -> PathPatch: ... @overload @@ -41,7 +42,7 @@ def plot_polygon( color: ColorType | None = None, facecolor: ColorType | None = None, edgecolor: ColorType | None = None, - linewidth: float | None = None, + linewidth: FloatInt | None = None, **kwargs: Any, ) -> PathPatch: ... @@ -51,7 +52,7 @@ def plot_line( ax: Axes | None = None, add_points: Literal[True] = True, color: ColorType | None = None, - linewidth: float = 2, + linewidth: FloatInt = 2, **kwargs: Any, ) -> tuple[PathPatch, Line2D]: ... @overload @@ -61,7 +62,7 @@ def plot_line( *, add_points: Literal[False], color: ColorType | None = None, - linewidth: float = 2, + linewidth: FloatInt = 2, **kwargs: Any, ) -> PathPatch: ... @overload @@ -70,7 +71,7 @@ def plot_line( ax: Axes | None, add_points: Literal[False], color: ColorType | None = None, - linewidth: float = 2, + linewidth: FloatInt = 2, **kwargs: Any, ) -> PathPatch: ... diff --git a/stubs/shapely/shapely/predicates.pyi b/stubs/shapely/shapely/predicates.pyi index 03e2a2fd4b50..74bfa85be852 100644 --- a/stubs/shapely/shapely/predicates.pyi +++ b/stubs/shapely/shapely/predicates.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Any, Literal, TypeGuard, overload from typing_extensions import Unpack @@ -198,13 +199,13 @@ def within(a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, **kwargs: Unpack[UFuncKwar @overload def equals_exact( - a: Geometry | None, b: Geometry | None, tolerance: float = 0.0, *, normalize: bool = False, **kwargs: Unpack[UFuncKwargs] + a: Geometry | None, b: Geometry | None, tolerance: FloatInt = 0.0, *, normalize: bool = False, **kwargs: Unpack[UFuncKwargs] ) -> np.bool_: ... @overload def equals_exact( a: OptGeoArrayLike, b: OptGeoArrayLike, - tolerance: ArrayLikeSeq[float], + tolerance: ArrayLikeSeq[FloatInt], *, normalize: bool = False, **kwargs: Unpack[UFuncKwargs], @@ -213,7 +214,7 @@ def equals_exact( def equals_exact( a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, - tolerance: ArrayLike[float] = 0.0, + tolerance: ArrayLike[FloatInt] = 0.0, *, normalize: bool = False, **kwargs: Unpack[UFuncKwargs], @@ -222,7 +223,7 @@ def equals_exact( def equals_exact( a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, - tolerance: ArrayLike[float] = 0.0, + tolerance: ArrayLike[FloatInt] = 0.0, *, normalize: bool = False, **kwargs: Unpack[UFuncKwargs], @@ -258,46 +259,46 @@ def relate_pattern( ) -> NDArray[np.bool_]: ... @overload -def dwithin(a: Geometry | None, b: Geometry | None, distance: float, **kwargs: Unpack[UFuncKwargs]) -> np.bool_: ... +def dwithin(a: Geometry | None, b: Geometry | None, distance: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> np.bool_: ... @overload -def dwithin(a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, distance: float, **kwargs: Unpack[UFuncKwargs]) -> NDArray[np.bool_]: ... +def dwithin(a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, distance: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> NDArray[np.bool_]: ... @overload -def dwithin(a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, distance: float, **kwargs: Unpack[UFuncKwargs]) -> NDArray[np.bool_]: ... +def dwithin(a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, distance: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> NDArray[np.bool_]: ... @overload -def contains_xy(geom: Geometry | None, x: float, y: float, **kwargs: Unpack[UFuncKwargs]) -> np.bool_: ... +def contains_xy(geom: Geometry | None, x: FloatInt, y: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> np.bool_: ... @overload def contains_xy( - geom: OptGeoArrayLike, x: ArrayLikeSeq[float], y: None = None, **kwargs: Unpack[UFuncKwargs] + geom: OptGeoArrayLike, x: ArrayLikeSeq[FloatInt], y: None = None, **kwargs: Unpack[UFuncKwargs] ) -> NDArray[np.bool_]: ... @overload def contains_xy( - geom: Geometry | None, x: ArrayLike[float], y: ArrayLikeSeq[float], **kwargs: Unpack[UFuncKwargs] + geom: Geometry | None, x: ArrayLike[FloatInt], y: ArrayLikeSeq[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> NDArray[np.bool_]: ... @overload def contains_xy( - geom: Geometry | None, x: ArrayLikeSeq[float], y: ArrayLike[float], **kwargs: Unpack[UFuncKwargs] + geom: Geometry | None, x: ArrayLikeSeq[FloatInt], y: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> NDArray[np.bool_]: ... @overload def contains_xy( - geom: OptGeoArrayLikeSeq, x: ArrayLike[float], y: ArrayLike[float], **kwargs: Unpack[UFuncKwargs] + geom: OptGeoArrayLikeSeq, x: ArrayLike[FloatInt], y: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> NDArray[np.bool_]: ... @overload -def intersects_xy(geom: Geometry | None, x: float, y: float, **kwargs: Unpack[UFuncKwargs]) -> np.bool_: ... +def intersects_xy(geom: Geometry | None, x: FloatInt, y: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> np.bool_: ... @overload def intersects_xy( - geom: OptGeoArrayLike, x: ArrayLikeSeq[float], y: None = None, **kwargs: Unpack[UFuncKwargs] + geom: OptGeoArrayLike, x: ArrayLikeSeq[FloatInt], y: None = None, **kwargs: Unpack[UFuncKwargs] ) -> NDArray[np.bool_]: ... @overload def intersects_xy( - geom: Geometry | None, x: ArrayLike[float], y: ArrayLikeSeq[float], **kwargs: Unpack[UFuncKwargs] + geom: Geometry | None, x: ArrayLike[FloatInt], y: ArrayLikeSeq[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> NDArray[np.bool_]: ... @overload def intersects_xy( - geom: Geometry | None, x: ArrayLikeSeq[float], y: ArrayLike[float], **kwargs: Unpack[UFuncKwargs] + geom: Geometry | None, x: ArrayLikeSeq[FloatInt], y: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> NDArray[np.bool_]: ... @overload def intersects_xy( - geom: OptGeoArrayLikeSeq, x: ArrayLike[float], y: ArrayLike[float], **kwargs: Unpack[UFuncKwargs] + geom: OptGeoArrayLikeSeq, x: ArrayLike[FloatInt], y: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs] ) -> NDArray[np.bool_]: ... diff --git a/stubs/shapely/shapely/set_operations.pyi b/stubs/shapely/shapely/set_operations.pyi index f1972a624d7f..4572f72b13e6 100644 --- a/stubs/shapely/shapely/set_operations.pyi +++ b/stubs/shapely/shapely/set_operations.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import overload from typing_extensions import Unpack, deprecated @@ -21,33 +22,33 @@ __all__ = [ ] @overload -def difference(a: Geometry, b: Geometry, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> BaseGeometry: ... +def difference(a: Geometry, b: Geometry, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> BaseGeometry: ... @overload -def difference(a: None, b: Geometry | None, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def difference(a: None, b: Geometry | None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload -def difference(a: Geometry | None, b: None, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def difference(a: Geometry | None, b: None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload def difference( - a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def difference( - a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload -def intersection(a: Geometry, b: Geometry, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> BaseGeometry: ... +def intersection(a: Geometry, b: Geometry, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> BaseGeometry: ... @overload -def intersection(a: None, b: Geometry | None, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def intersection(a: None, b: Geometry | None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload -def intersection(a: Geometry | None, b: None, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def intersection(a: Geometry | None, b: None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload def intersection( - a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def intersection( - a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload @@ -57,19 +58,19 @@ def intersection_all(geometries: OptGeoArrayLikeSeq, axis: int, **kwargs: Unpack @overload def symmetric_difference( - a: Geometry, b: Geometry, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: Geometry, b: Geometry, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry: ... @overload -def symmetric_difference(a: None, b: Geometry | None, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def symmetric_difference(a: None, b: Geometry | None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload -def symmetric_difference(a: Geometry | None, b: None, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def symmetric_difference(a: Geometry | None, b: None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload def symmetric_difference( - a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def symmetric_difference( - a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload @@ -82,31 +83,31 @@ def symmetric_difference_all( ) -> BaseGeometry | GeoArray: ... @overload -def union(a: Geometry, b: Geometry, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> BaseGeometry: ... +def union(a: Geometry, b: Geometry, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> BaseGeometry: ... @overload -def union(a: None, b: Geometry | None, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def union(a: None, b: Geometry | None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload -def union(a: Geometry | None, b: None, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def union(a: Geometry | None, b: None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... @overload def union( - a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def union( - a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, grid_size: float | None = None, **kwargs: Unpack[UFuncKwargs] + a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> GeoArray: ... @overload def union_all( - geometries: OptGeoArrayLike, grid_size: float | None = None, axis: None = None, **kwargs: Unpack[UFuncKwargs] + geometries: OptGeoArrayLike, grid_size: FloatInt | None = None, axis: None = None, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry: ... @overload def union_all( - geometries: OptGeoArrayLikeSeq, grid_size: float | None = None, *, axis: int, **kwargs: Unpack[UFuncKwargs] + geometries: OptGeoArrayLikeSeq, grid_size: FloatInt | None = None, *, axis: int, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry | GeoArray: ... @overload def union_all( - geometries: OptGeoArrayLikeSeq, grid_size: float | None, axis: int, **kwargs: Unpack[UFuncKwargs] + geometries: OptGeoArrayLikeSeq, grid_size: FloatInt | None, axis: int, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry | GeoArray: ... unary_union = union_all diff --git a/stubs/shapely/shapely/strtree.pyi b/stubs/shapely/shapely/strtree.pyi index 0dede9dbcedf..2ce943d49a59 100644 --- a/stubs/shapely/shapely/strtree.pyi +++ b/stubs/shapely/shapely/strtree.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import MaybeNone from typing import Literal, SupportsIndex, TypeAlias, overload @@ -33,7 +34,7 @@ class STRtree: @overload def query( - self, geometry: OptGeoArrayLike, predicate: Literal["dwithin"], distance: ArrayLike[float] + self, geometry: OptGeoArrayLike, predicate: Literal["dwithin"], distance: ArrayLike[FloatInt] ) -> NDArray[np.int64]: ... @overload def query( @@ -50,7 +51,7 @@ class STRtree: def query_nearest( self, geometry: OptGeoArrayLike, - max_distance: float | None = None, + max_distance: FloatInt | None = None, return_distance: Literal[False] = False, exclusive: bool = False, all_matches: bool = True, @@ -59,7 +60,7 @@ class STRtree: def query_nearest( self, geometry: OptGeoArrayLike, - max_distance: float | None = None, + max_distance: FloatInt | None = None, *, return_distance: Literal[True], exclusive: bool = False, @@ -69,7 +70,7 @@ class STRtree: def query_nearest( self, geometry: OptGeoArrayLike, - max_distance: float | None, + max_distance: FloatInt | None, return_distance: Literal[True], exclusive: bool = False, all_matches: bool = True, @@ -78,7 +79,7 @@ class STRtree: def query_nearest( self, geometry: OptGeoArrayLike, - max_distance: float | None = None, + max_distance: FloatInt | None = None, return_distance: bool = False, exclusive: bool = False, all_matches: bool = True, diff --git a/stubs/shapely/shapely/testing.pyi b/stubs/shapely/shapely/testing.pyi index 1acff3f0a071..0260d0429e4b 100644 --- a/stubs/shapely/shapely/testing.pyi +++ b/stubs/shapely/shapely/testing.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from ._typing import ArrayLike, OptGeoArrayLike __all__ = ["assert_geometries_equal"] @@ -5,7 +6,7 @@ __all__ = ["assert_geometries_equal"] def assert_geometries_equal( x: OptGeoArrayLike, y: OptGeoArrayLike, - tolerance: ArrayLike[float] = 1e-7, + tolerance: ArrayLike[FloatInt] = 1e-7, equal_none: bool = True, equal_nan: bool = True, normalize: bool = False, diff --git a/stubs/shapely/shapely/vectorized/__init__.pyi b/stubs/shapely/shapely/vectorized/__init__.pyi index c7b42e6c5e0a..335d9ca3cae4 100644 --- a/stubs/shapely/shapely/vectorized/__init__.pyi +++ b/stubs/shapely/shapely/vectorized/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import overload from typing_extensions import deprecated @@ -10,38 +11,38 @@ from ..prepared import PreparedGeometry @overload @deprecated("Use 'shapely.contains_xy' instead (available since shapely 2.0.0).") -def contains(geometry: Geometry | PreparedGeometry[Geometry], x: float, y: float) -> np.bool_: ... +def contains(geometry: Geometry | PreparedGeometry[Geometry], x: FloatInt, y: FloatInt) -> np.bool_: ... @overload @deprecated("Use 'shapely.contains_xy' instead (available since shapely 2.0.0).") def contains( - geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLikeSeq[float], y: ArrayLike[float] + geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLikeSeq[FloatInt], y: ArrayLike[FloatInt] ) -> NDArray[np.bool_]: ... @overload @deprecated("Use 'shapely.contains_xy' instead (available since shapely 2.0.0).") def contains( - geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLike[float], y: ArrayLikeSeq[float] + geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLike[FloatInt], y: ArrayLikeSeq[FloatInt] ) -> NDArray[np.bool_]: ... @overload @deprecated("Use 'shapely.contains_xy' instead (available since shapely 2.0.0).") def contains( - geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLike[float], y: ArrayLike[float] + geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLike[FloatInt], y: ArrayLike[FloatInt] ) -> np.bool_ | NDArray[np.bool_]: ... @overload @deprecated("Use 'shapely.intersects_xy' instead (available since shapely 2.0.0).") -def touches(geometry: Geometry | PreparedGeometry[Geometry], x: float, y: float) -> np.bool_: ... +def touches(geometry: Geometry | PreparedGeometry[Geometry], x: FloatInt, y: FloatInt) -> np.bool_: ... @overload @deprecated("Use 'shapely.intersects_xy' instead (available since shapely 2.0.0).") def touches( - geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLikeSeq[float], y: ArrayLike[float] + geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLikeSeq[FloatInt], y: ArrayLike[FloatInt] ) -> NDArray[np.bool_]: ... @overload @deprecated("Use 'shapely.intersects_xy' instead (available since shapely 2.0.0).") def touches( - geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLike[float], y: ArrayLikeSeq[float] + geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLike[FloatInt], y: ArrayLikeSeq[FloatInt] ) -> NDArray[np.bool_]: ... @overload @deprecated("Use 'shapely.intersects_xy' instead (available since shapely 2.0.0).") def touches( - geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLike[float], y: ArrayLike[float] + geometry: Geometry | PreparedGeometry[Geometry], x: ArrayLike[FloatInt], y: ArrayLike[FloatInt] ) -> np.bool_ | NDArray[np.bool_]: ... diff --git a/stubs/simple-websocket/simple_websocket/aiows.pyi b/stubs/simple-websocket/simple_websocket/aiows.pyi index 066a243cb78e..99f7ee40a405 100644 --- a/stubs/simple-websocket/simple_websocket/aiows.pyi +++ b/stubs/simple-websocket/simple_websocket/aiows.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import asyncio import socket from _typeshed import Incomplete, Unused @@ -16,7 +17,7 @@ class AioBase: subprotocol: str | None connection_type: ConnectionType receive_bytes: int - ping_interval: float | None + ping_interval: FloatInt | None max_message_size: int | None pong_received: bool input_buffer: list[bytes | str] @@ -35,14 +36,14 @@ class AioBase: self, connection_type: ConnectionType | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, ) -> None: ... async def connect(self) -> None: ... async def handshake(self) -> None: ... # data can be antyhing. a special case is made for `bytes`, anything else is converted to `str`. async def send(self, data: bytes | Any) -> None: ... - async def receive(self, timeout: float | None = None) -> bytes | str | None: ... + async def receive(self, timeout: FloatInt | None = None) -> bytes | str | None: ... async def close(self, reason: CloseReason | None = None, message: str | None = None) -> None: ... def choose_subprotocol(self, request: Request) -> str | None: ... @@ -65,7 +66,7 @@ class AioServer(AioBase): request: _AioServerRequest, subprotocols: list[str] | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, ) -> None: ... @classmethod @@ -85,7 +86,7 @@ class AioServer(AioBase): headers: dict[str, Any] | None = None, subprotocols: list[str] | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, ) -> WebSocketASGI | AioServer: ... async def handshake(self) -> None: ... @@ -108,7 +109,7 @@ class AioClient(AioBase): subprotocols: list[str] | None = None, headers: dict[str, Any] | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, ssl_context: SSLContext | None = None, ) -> None: ... @@ -120,7 +121,7 @@ class AioClient(AioBase): subprotocols: list[str] | None = None, headers: dict[str, Any] | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, ssl_context: SSLContext | None = None, thread_class: Unused = None, diff --git a/stubs/simple-websocket/simple_websocket/ws.pyi b/stubs/simple-websocket/simple_websocket/ws.pyi index 0366967d6d5a..ccf6fe852f6e 100644 --- a/stubs/simple-websocket/simple_websocket/ws.pyi +++ b/stubs/simple-websocket/simple_websocket/ws.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import socket import threading from _typeshed import FileDescriptorLike @@ -22,21 +23,21 @@ class _ThreadClassProtocol(Protocol): class _EventClassProtocol(Protocol): def clear(self) -> None: ... def set(self) -> None: ... - def wait(self, timeout: float | None = None) -> bool: ... + def wait(self, timeout: FloatInt | None = None) -> bool: ... @type_check_only class _SelectorClassProtocol(Protocol): # the signature of `register` here is the same as `selectors._BaseSelectorImpl` from the stdlib def register(self, fileobj: FileDescriptorLike, events: int, data: Any = None) -> SelectorKey: ... # the signature of `select` here is the same as `selectors.DefaultSelector` from the stdlib - def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, int]]: ... + def select(self, timeout: FloatInt | None = None) -> list[tuple[SelectorKey, int]]: ... def close(self) -> None: ... class Base: subprotocol: str | None sock: socket.socket | None receive_bytes: int - ping_interval: float | None + ping_interval: FloatInt | None max_message_size: int | None pong_received: bool input_buffer: list[bytes | str] @@ -55,7 +56,7 @@ class Base: sock: socket.socket | None = None, connection_type: ConnectionType | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, thread_class: type[_ThreadClassProtocol] | None = None, event_class: type[_EventClassProtocol] | None = None, @@ -64,7 +65,7 @@ class Base: def handshake(self) -> None: ... # data can be antyhing. a special case is made for `bytes`, anything else is converted to `str`. def send(self, data: bytes | Any) -> None: ... - def receive(self, timeout: float | None = None) -> bytes | str | None: ... + def receive(self, timeout: FloatInt | None = None) -> bytes | str | None: ... def close(self, reason: CloseReason | None = None, message: str | None = None) -> None: ... def choose_subprotocol(self, request: Request) -> str | None: ... @@ -78,7 +79,7 @@ class Server(Base): environ: WSGIEnvironment, subprotocols: list[str] | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, thread_class: type[_ThreadClassProtocol] | None = None, event_class: type[_EventClassProtocol] | None = None, @@ -90,7 +91,7 @@ class Server(Base): environ: WSGIEnvironment, subprotocols: list[str] | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, thread_class: type[_ThreadClassProtocol] | None = None, event_class: type[_EventClassProtocol] | None = None, @@ -113,7 +114,7 @@ class Client(Base): subprotocols: list[str] | None = None, headers: dict[bytes, bytes] | list[tuple[bytes, bytes]] | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, ssl_context: SSLContext | None = None, thread_class: type[_ThreadClassProtocol] | None = None, @@ -126,7 +127,7 @@ class Client(Base): subprotocols: list[str] | None = None, headers: dict[bytes, bytes] | list[tuple[bytes, bytes]] | None = None, receive_bytes: int = 4096, - ping_interval: float | None = None, + ping_interval: FloatInt | None = None, max_message_size: int | None = None, ssl_context: SSLContext | None = None, thread_class: type[_ThreadClassProtocol] | None = None, diff --git a/stubs/tensorflow/tensorflow/__init__.pyi b/stubs/tensorflow/tensorflow/__init__.pyi index 2580dec2f797..d1e275d4abda 100644 --- a/stubs/tensorflow/tensorflow/__init__.pyi +++ b/stubs/tensorflow/tensorflow/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc from _typeshed import Incomplete, Unused from abc import ABC, ABCMeta, abstractmethod @@ -189,15 +190,15 @@ class RaggedTensor(metaclass=ABCMeta): def from_sparse(cls, st_input: SparseTensor, name: str | None = None, row_splits_dtype: DTypeLike = ...) -> RaggedTensor: ... def to_sparse(self, name: str | None = None) -> SparseTensor: ... def to_tensor( - self, default_value: float | str | None = None, name: str | None = None, shape: ShapeLike | None = None + self, default_value: FloatInt | str | None = None, name: str | None = None, shape: ShapeLike | None = None ) -> Tensor: ... - def __add__(self, other: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... - def __radd__(self, other: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... - def __sub__(self, other: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... - def __mul__(self, other: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... - def __rmul__(self, other: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... - def __floordiv__(self, other: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... - def __truediv__(self, other: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... + def __add__(self, other: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... + def __radd__(self, other: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... + def __sub__(self, other: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... + def __mul__(self, other: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... + def __rmul__(self, other: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... + def __floordiv__(self, other: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... + def __truediv__(self, other: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... def __getitem__(self, slice_spec: Slice | tuple[Slice, ...]) -> RaggedTensor: ... def __getattr__(self, name: str) -> Incomplete: ... diff --git a/stubs/tensorflow/tensorflow/_aliases.pyi b/stubs/tensorflow/tensorflow/_aliases.pyi index a3ac8f423437..5b66491f7725 100644 --- a/stubs/tensorflow/tensorflow/_aliases.pyi +++ b/stubs/tensorflow/tensorflow/_aliases.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt # Commonly used type aliases. # Everything in this module is private for stubs. There is no runtime equivalent. @@ -31,13 +32,13 @@ KerasSerializable: TypeAlias = KerasSerializable1 | KerasSerializable2 TensorValue: TypeAlias = tf.Tensor # Alias for a 0D Tensor Integer: TypeAlias = TensorValue | int | IntArray | np.number[Any] # Here IntArray are assumed to be 0D. -Float: TypeAlias = Integer | float | FloatArray +Float: TypeAlias = Integer | FloatInt | FloatArray Slice: TypeAlias = tf.Tensor | tf.RaggedTensor | int | slice | None -FloatDataSequence: TypeAlias = Sequence[float] | Sequence[FloatDataSequence] +FloatDataSequence: TypeAlias = Sequence[FloatInt] | Sequence[FloatDataSequence] IntDataSequence: TypeAlias = Sequence[int] | Sequence[IntDataSequence] StrDataSequence: TypeAlias = Sequence[str] | Sequence[StrDataSequence] DataSequence: TypeAlias = FloatDataSequence | StrDataSequence | IntDataSequence -ScalarTensorCompatible: TypeAlias = tf.Tensor | str | float | np.ndarray[Any, Any] | np.number[Any] +ScalarTensorCompatible: TypeAlias = tf.Tensor | str | FloatInt | np.ndarray[Any, Any] | np.number[Any] UIntTensorCompatible: TypeAlias = tf.Tensor | int | UIntArray IntTensorCompatible: TypeAlias = tf.Tensor | int | IntArray | Sequence[IntTensorCompatible] FloatTensorCompatible: TypeAlias = tf.Tensor | int | IntArray | float | FloatArray | np.number[Any] diff --git a/stubs/tensorflow/tensorflow/feature_column/__init__.pyi b/stubs/tensorflow/tensorflow/feature_column/__init__.pyi index efae91af0c23..7d2ebd9ee19d 100644 --- a/stubs/tensorflow/tensorflow/feature_column/__init__.pyi +++ b/stubs/tensorflow/tensorflow/feature_column/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Iterable, Sequence import tensorflow as tf @@ -7,11 +8,11 @@ from tensorflow.python.feature_column import feature_column_v2 as fc, sequence_f def numeric_column( key: str, shape: ShapeLike = (1,), - default_value: float | None = None, + default_value: FloatInt | None = None, dtype: tf.DType = ..., normalizer_fn: Callable[[tf.Tensor], tf.Tensor] | None = None, ) -> fc.NumericColumn: ... -def bucketized_column(source_column: fc.NumericColumn, boundaries: list[float] | tuple[float, ...]) -> fc.BucketizedColumn: ... +def bucketized_column(source_column: fc.NumericColumn, boundaries: list[FloatInt] | tuple[FloatInt, ...]) -> fc.BucketizedColumn: ... def embedding_column( categorical_column: fc.CategoricalColumn, dimension: int, @@ -19,7 +20,7 @@ def embedding_column( initializer: Callable[[ShapeLike], tf.Tensor] | None = None, ckpt_to_load_from: str | None = None, tensor_name_in_ckpt: str | None = None, - max_norm: float | None = None, + max_norm: FloatInt | None = None, trainable: bool = True, use_safe_embedding_lookup: bool = True, ) -> fc.EmbeddingColumn: ... @@ -31,7 +32,7 @@ def shared_embeddings( shared_embedding_collection_name: str | None = None, ckpt_to_load_from: str | None = None, tensor_name_in_ckpt: str | None = None, - max_norm: float | None = None, + max_norm: FloatInt | None = None, trainable: bool = True, use_safe_embedding_lookup: bool = True, ) -> list[fc.SharedEmbeddingColumn]: ... @@ -65,7 +66,7 @@ def crossed_column( def sequence_numeric_column( key: str, shape: ShapeLike = (1,), - default_value: float = 0.0, + default_value: FloatInt = 0.0, dtype: tf.DType = ..., normalizer_fn: Callable[[tf.Tensor], tf.Tensor] | None = None, ) -> seq_fc.SequenceNumericColumn: ... diff --git a/stubs/tensorflow/tensorflow/keras/activations.pyi b/stubs/tensorflow/tensorflow/keras/activations.pyi index 0c24b3dfd031..726def0042ee 100644 --- a/stubs/tensorflow/tensorflow/keras/activations.pyi +++ b/stubs/tensorflow/tensorflow/keras/activations.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing import Any, TypeAlias @@ -8,7 +9,7 @@ from tensorflow._aliases import FloatArray, FloatDataSequence, FloatTensorCompat # The implementation uses isinstance so it must be dict and not any Mapping. _Activation: TypeAlias = str | Callable[[Tensor], Tensor] | dict[str, Any] | None # Ints are not allowed. -_ActivationInput: TypeAlias = Tensor | FloatDataSequence | FloatArray | np.number[Any] | float +_ActivationInput: TypeAlias = Tensor | FloatDataSequence | FloatArray | np.number[Any] | FloatInt def deserialize(config: dict[str, Any], custom_objects: dict[str, Callable[..., Any]] | None = None) -> Callable[..., Any]: ... def elu(x: _ActivationInput, alpha: FloatTensorCompatible | FloatDataSequence = 1.0) -> Tensor: ... diff --git a/stubs/tensorflow/tensorflow/keras/callbacks.pyi b/stubs/tensorflow/tensorflow/keras/callbacks.pyi index 985af36e516b..d8b6d600965f 100644 --- a/stubs/tensorflow/tensorflow/keras/callbacks.pyi +++ b/stubs/tensorflow/tensorflow/keras/callbacks.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Mapping, Sequence from typing import Any, Literal, TypeAlias @@ -71,11 +72,11 @@ class EarlyStopping(Callback): def __init__( self, monitor: str = "val_loss", - min_delta: float = 0, + min_delta: FloatInt = 0, patience: int = 0, verbose: Literal[0, 1] = 0, mode: Literal["auto", "min", "max"] = "auto", - baseline: float | None = None, + baseline: FloatInt | None = None, restore_best_weights: bool = False, start_from_epoch: int = 0, ) -> None: ... @@ -98,7 +99,7 @@ class LambdaCallback(Callback): class LearningRateScheduler(Callback): def __init__( self, - schedule: LearningRateSchedule | Callable[[int], float | tf.Tensor] | Callable[[int, float], float | tf.Tensor], + schedule: LearningRateSchedule | Callable[[int], float | tf.Tensor] | Callable[[int, FloatInt], float | tf.Tensor], verbose: Literal[0, 1] = 0, ) -> None: ... @@ -114,7 +115,7 @@ class ModelCheckpoint(Callback): save_weights_only: bool = False, mode: Literal["auto", "min", "max"] = "auto", save_freq: str | int = "epoch", - initial_value_threshold: float | None = None, + initial_value_threshold: FloatInt | None = None, ) -> None: ... def _save_model(self, epoch: int, batch: int | None, logs: _Logs) -> None: ... @@ -126,13 +127,13 @@ class ReduceLROnPlateau(Callback): def __init__( self, monitor: str = "val_loss", - factor: float = 0.1, + factor: FloatInt = 0.1, patience: int = 10, verbose: Literal[0, 1] = 0, mode: Literal["auto", "min", "max"] = "auto", - min_delta: float = 1e-4, + min_delta: FloatInt = 1e-4, cooldown: int = 0, - min_lr: float = 0.0, + min_lr: FloatInt = 0.0, **kwargs, ) -> None: ... def in_cooldown(self) -> bool: ... diff --git a/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi b/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi index cba15d1a8a10..3b58fa29e292 100644 --- a/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi +++ b/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Iterable, Sequence from typing import Any, Generic, Literal, TypeAlias, TypeVar, overload, type_check_only @@ -236,8 +237,8 @@ class BatchNormalization(Layer[tf.Tensor, tf.Tensor]): def __init__( self, axis: int = -1, - momentum: float = 0.99, - epsilon: float = 0.001, + momentum: FloatInt = 0.99, + epsilon: FloatInt = 0.001, center: bool = True, scale: bool = True, beta_initializer: _Initializer = "zeros", @@ -261,9 +262,9 @@ class BatchNormalization(Layer[tf.Tensor, tf.Tensor]): class ReLU(Layer[tf.Tensor, tf.Tensor]): def __init__( self, - max_value: float | None = None, - negative_slope: float | None = 0.0, - threshold: float | None = 0.0, + max_value: FloatInt | None = None, + negative_slope: FloatInt | None = 0.0, + threshold: FloatInt | None = 0.0, *, # **kwargs passed to Layer activity_regularizer: _Regularizer = None, @@ -276,7 +277,7 @@ class ReLU(Layer[tf.Tensor, tf.Tensor]): class Dropout(Layer[tf.Tensor, tf.Tensor]): def __init__( self, - rate: float, + rate: FloatInt, noise_shape: TensorCompatible | Sequence[int | None] | None = None, seed: int | None = None, *, @@ -354,7 +355,7 @@ class LayerNormalization(Layer[tf.Tensor, tf.Tensor]): def __init__( self, axis: int = -1, - epsilon: float = 0.001, + epsilon: FloatInt = 0.001, center: bool = True, scale: bool = True, rms_scaling: bool = False, @@ -379,7 +380,7 @@ class MultiHeadAttention(Layer[Any, tf.Tensor]): num_heads: int, key_dim: int | None, value_dim: int | None = None, - dropout: float = 0.0, + dropout: FloatInt = 0.0, use_bias: bool = True, output_shape: tuple[int, ...] | None = None, attention_axes: tuple[int, ...] | None = None, @@ -436,7 +437,7 @@ class MultiHeadAttention(Layer[Any, tf.Tensor]): class GaussianDropout(Layer[tf.Tensor, tf.Tensor]): def __init__( self, - rate: float, + rate: FloatInt, seed: int | None = None, *, # **kwargs passed to Layer diff --git a/stubs/tensorflow/tensorflow/keras/losses.pyi b/stubs/tensorflow/tensorflow/keras/losses.pyi index 7b2eecbc9c2a..88b0895a90fe 100644 --- a/stubs/tensorflow/tensorflow/keras/losses.pyi +++ b/stubs/tensorflow/tensorflow/keras/losses.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from abc import ABC, abstractmethod from collections.abc import Callable from typing import Any, Final, Literal, TypeAlias, TypeGuard, TypeVar, overload @@ -27,7 +28,7 @@ class BinaryCrossentropy(Loss): def __init__( self, from_logits: bool = False, - label_smoothing: float = 0.0, + label_smoothing: FloatInt = 0.0, axis: int = -1, reduction: _ReductionValues = "sum_over_batch_size", name: str | None = "binary_crossentropy", @@ -39,10 +40,10 @@ class BinaryFocalCrossentropy(Loss): def __init__( self, apply_class_balancing: bool = False, - alpha: float = 0.25, - gamma: float = 2.0, + alpha: FloatInt = 0.25, + gamma: FloatInt = 2.0, from_logits: bool = False, - label_smoothing: float = 0.0, + label_smoothing: FloatInt = 0.0, axis: int = -1, reduction: _ReductionValues = "sum_over_batch_size", name: str | None = "binary_focal_crossentropy", @@ -54,7 +55,7 @@ class CategoricalCrossentropy(Loss): def __init__( self, from_logits: bool = False, - label_smoothing: float = 0.0, + label_smoothing: FloatInt = 0.0, axis: int = -1, reduction: _ReductionValues = "sum_over_batch_size", name: str | None = "categorical_crossentropy", @@ -84,7 +85,7 @@ class Hinge(Loss): class Huber(Loss): def __init__( - self, delta: float = 1.0, reduction: _ReductionValues = "sum_over_batch_size", name: str | None = "huber_loss", dtype=None + self, delta: FloatInt = 1.0, reduction: _ReductionValues = "sum_over_batch_size", name: str | None = "huber_loss", dtype=None ) -> None: ... def call(self, y_true: Tensor, y_pred: Tensor) -> Tensor: ... @@ -158,7 +159,7 @@ class Reduction: _ReductionValues: TypeAlias = Literal["auto", "none", "sum", "sum_over_batch_size"] def categorical_hinge(y_true: TensorCompatible, y_pred: TensorCompatible) -> Tensor: ... -def huber(y_true: TensorCompatible, y_pred: TensorCompatible, delta: float = 1.0) -> Tensor: ... +def huber(y_true: TensorCompatible, y_pred: TensorCompatible, delta: FloatInt = 1.0) -> Tensor: ... def deserialize(name: str | dict[str, Any], custom_objects: dict[str, Any] | None = None) -> Loss: ... def serialize(loss: KerasSerializable) -> dict[str, Any]: ... diff --git a/stubs/tensorflow/tensorflow/keras/metrics.pyi b/stubs/tensorflow/tensorflow/keras/metrics.pyi index e6f12a00c857..b362232a2786 100644 --- a/stubs/tensorflow/tensorflow/keras/metrics.pyi +++ b/stubs/tensorflow/tensorflow/keras/metrics.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from abc import ABCMeta, abstractmethod from collections.abc import Callable, Iterable, Sequence @@ -44,7 +45,7 @@ class AUC(Metric): summation_method: Literal["interpolation", "minoring", "majoring"] = "interpolation", name: str | None = None, dtype: DTypeLike | None = None, - thresholds: Sequence[float] | None = None, + thresholds: Sequence[FloatInt] | None = None, multi_label: bool = False, num_labels: int | None = None, label_weights: TensorCompatible | None = None, @@ -58,7 +59,7 @@ class AUC(Metric): class Precision(Metric): def __init__( self, - thresholds: float | Sequence[float] | None = None, + thresholds: FloatInt | Sequence[FloatInt] | None = None, top_k: int | None = None, class_id: int | None = None, name: str | None = None, @@ -72,7 +73,7 @@ class Precision(Metric): class Recall(Metric): def __init__( self, - thresholds: float | Sequence[float] | None = None, + thresholds: FloatInt | Sequence[FloatInt] | None = None, top_k: int | None = None, class_id: int | None = None, name: str | None = None, @@ -93,7 +94,7 @@ class MeanMetricWrapper(Metric): def result(self) -> tf.Tensor: ... class BinaryAccuracy(MeanMetricWrapper): - def __init__(self, name: str | None = "binary_accuracy", dtype: DTypeLike | None = None, threshold: float = 0.5) -> None: ... + def __init__(self, name: str | None = "binary_accuracy", dtype: DTypeLike | None = None, threshold: FloatInt = 0.5) -> None: ... class Accuracy(MeanMetricWrapper): def __init__(self, name: str | None = "accuracy", dtype: DTypeLike | None = None) -> None: ... @@ -133,9 +134,9 @@ class Mean(Reduce): def serialize(metric: KerasSerializable) -> dict[str, Any]: ... def binary_crossentropy( - y_true: TensorCompatible, y_pred: TensorCompatible, from_logits: bool = False, label_smoothing: float = 0.0, axis: int = -1 + y_true: TensorCompatible, y_pred: TensorCompatible, from_logits: bool = False, label_smoothing: FloatInt = 0.0, axis: int = -1 ) -> Tensor: ... def categorical_crossentropy( - y_true: TensorCompatible, y_pred: TensorCompatible, from_logits: bool = False, label_smoothing: float = 0.0, axis: int = -1 + y_true: TensorCompatible, y_pred: TensorCompatible, from_logits: bool = False, label_smoothing: FloatInt = 0.0, axis: int = -1 ) -> Tensor: ... def __getattr__(name: str): ... # incomplete module diff --git a/stubs/tensorflow/tensorflow/keras/models.pyi b/stubs/tensorflow/tensorflow/keras/models.pyi index 0e9a62ff4c87..108ee4691b38 100644 --- a/stubs/tensorflow/tensorflow/keras/models.pyi +++ b/stubs/tensorflow/tensorflow/keras/models.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Callable, Container, Iterator from pathlib import Path @@ -39,7 +40,7 @@ class Model(Layer[_InputT_contra, _OutputT_co]): self, optimizer: Optimizer | str = "rmsprop", loss: ContainerGeneric[_Loss] | None = None, - loss_weights: ContainerGeneric[float] | None = None, + loss_weights: ContainerGeneric[FloatInt] | None = None, metrics: ContainerGeneric[_Metric] | None = None, weighted_metrics: ContainerGeneric[_Metric] | None = None, run_eagerly: bool = False, @@ -81,10 +82,10 @@ class Model(Layer[_InputT_contra, _OutputT_co]): epochs: int = 1, verbose: Literal["auto", 0, 1, 2] = "auto", callbacks: list[tf.keras.callbacks.Callback] | None = None, - validation_split: float = 0.0, + validation_split: FloatInt = 0.0, validation_data: TensorCompatible | tf.data.Dataset[Any] | None = None, shuffle: bool = True, - class_weight: dict[int, float] | None = None, + class_weight: dict[int, FloatInt] | None = None, sample_weight: npt.NDArray[np.float64] | None = None, initial_epoch: int = 0, steps_per_epoch: int | None = None, @@ -122,7 +123,7 @@ class Model(Layer[_InputT_contra, _OutputT_co]): x: TensorCompatible | dict[str, TensorCompatible] | tf.data.Dataset[Incomplete], y: TensorCompatible | dict[str, TensorCompatible] | tf.data.Dataset[Incomplete] | None = None, sample_weight: npt.NDArray[np.float64] | None = None, - class_weight: dict[int, float] | None = None, + class_weight: dict[int, FloatInt] | None = None, return_dict: bool = False, ) -> float | list[float]: ... def test_on_batch( @@ -151,7 +152,7 @@ class Model(Layer[_InputT_contra, _OutputT_co]): def summary( self, line_length: int | None = None, - positions: list[float] | None = None, + positions: list[FloatInt] | None = None, print_fn: Callable[[str], None] | None = None, expand_nested: bool = False, show_trainable: bool = False, diff --git a/stubs/tensorflow/tensorflow/keras/optimizers/legacy/__init__.pyi b/stubs/tensorflow/tensorflow/keras/optimizers/legacy/__init__.pyi index 15fb8c0f7181..cd805bfcdf0e 100644 --- a/stubs/tensorflow/tensorflow/keras/optimizers/legacy/__init__.pyi +++ b/stubs/tensorflow/tensorflow/keras/optimizers/legacy/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable, Iterable from typing import Any, TypeAlias @@ -6,7 +7,7 @@ from tensorflow._aliases import Gradients from tensorflow.keras.optimizers import schedules as schedules from tensorflow.python.trackable.base import Trackable -_LearningRate: TypeAlias = float | tf.Tensor | schedules.LearningRateSchedule | Callable[[], float | tf.Tensor] +_LearningRate: TypeAlias = FloatInt | tf.Tensor | schedules.LearningRateSchedule | Callable[[], float | tf.Tensor] _GradientAggregator: TypeAlias = Callable[[list[tuple[Gradients, tf.Variable]]], list[tuple[Gradients, tf.Variable]]] | None _GradientTransformer: TypeAlias = ( Iterable[Callable[[list[tuple[Gradients, tf.Variable]]], list[tuple[Gradients, tf.Variable]]]] | None @@ -32,29 +33,29 @@ class Adam(Optimizer): def __init__( self, learning_rate: _LearningRate = 0.001, - beta_1: float = 0.9, - beta_2: float = 0.999, - epsilon: float = 1e-07, + beta_1: FloatInt = 0.9, + beta_2: FloatInt = 0.999, + epsilon: FloatInt = 1e-07, amsgrad: bool = False, name: str = "Adam", **kwargs: Any, ) -> None: ... class Adagrad(Optimizer): - _initial_accumulator_value: float + _initial_accumulator_value: FloatInt def __init__( self, learning_rate: _LearningRate = 0.001, - initial_accumulator_value: float = 0.1, - epsilon: float = 1e-7, + initial_accumulator_value: FloatInt = 0.1, + epsilon: FloatInt = 1e-7, name: str = "Adagrad", **kwargs: Any, ) -> None: ... class SGD(Optimizer): def __init__( - self, learning_rate: _LearningRate = 0.01, momentum: float = 0.0, nesterov: bool = False, name: str = "SGD", **kwargs: Any + self, learning_rate: _LearningRate = 0.01, momentum: FloatInt = 0.0, nesterov: bool = False, name: str = "SGD", **kwargs: Any ) -> None: ... def __getattr__(name: str): ... # incomplete module diff --git a/stubs/tensorflow/tensorflow/keras/optimizers/schedules.pyi b/stubs/tensorflow/tensorflow/keras/optimizers/schedules.pyi index 20d71a964bf6..f68429ef4816 100644 --- a/stubs/tensorflow/tensorflow/keras/optimizers/schedules.pyi +++ b/stubs/tensorflow/tensorflow/keras/optimizers/schedules.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from abc import abstractmethod from collections.abc import Sequence from typing import Any @@ -17,8 +18,8 @@ class LearningRateSchedule: class PiecewiseConstantDecay(LearningRateSchedule): def __init__( self, - boundaries: Sequence[tf.Tensor] | Sequence[float], - values: Sequence[float] | Sequence[tf.Tensor], + boundaries: Sequence[tf.Tensor] | Sequence[FloatInt], + values: Sequence[FloatInt] | Sequence[tf.Tensor], name: str = "PiecewiseConstant", ) -> None: ... def __call__(self, step: int | tf.Tensor) -> float | tf.Tensor: ... @@ -29,9 +30,9 @@ class PiecewiseConstantDecay(LearningRateSchedule): class InverseTimeDecay(LearningRateSchedule): def __init__( self, - initial_learning_rate: float | tf.Tensor, + initial_learning_rate: FloatInt | tf.Tensor, decay_steps: int, - decay_rate: float, + decay_rate: FloatInt, staircase: bool = False, name: str = "InverseTimeDecay", ) -> None: ... @@ -43,10 +44,10 @@ class InverseTimeDecay(LearningRateSchedule): class PolynomialDecay(LearningRateSchedule): def __init__( self, - initial_learning_rate: float | tf.Tensor, + initial_learning_rate: FloatInt | tf.Tensor, decay_steps: int, - end_learning_rate: float | tf.Tensor = 0.0001, - power: float = 1.0, + end_learning_rate: FloatInt | tf.Tensor = 0.0001, + power: FloatInt = 1.0, cycle: bool = False, name: str = "PolynomialDecay", ) -> None: ... @@ -58,9 +59,9 @@ class PolynomialDecay(LearningRateSchedule): class CosineDecay(LearningRateSchedule): def __init__( self, - initial_learning_rate: float | tf.Tensor, + initial_learning_rate: FloatInt | tf.Tensor, decay_steps: int, - alpha: float | tf.Tensor = 0.0, + alpha: FloatInt | tf.Tensor = 0.0, name: str = "CosineDecay", warmup_target: int | tf.Tensor | None = None, # float32 or float64 Tensor warmup_steps: int | tf.Tensor = 0, # int32 or int64 Tensor @@ -73,11 +74,11 @@ class CosineDecay(LearningRateSchedule): class CosineDecayRestarts(LearningRateSchedule): def __init__( self, - initial_learning_rate: float | tf.Tensor, + initial_learning_rate: FloatInt | tf.Tensor, first_decay_steps: int | tf.Tensor, - t_mul: float | tf.Tensor = 2.0, - m_mul: float | tf.Tensor = 1.0, - alpha: float | tf.Tensor = 0.0, + t_mul: FloatInt | tf.Tensor = 2.0, + m_mul: FloatInt | tf.Tensor = 1.0, + alpha: FloatInt | tf.Tensor = 0.0, name: str = "SGDRDecay", ) -> None: ... def __call__(self, step: int | tf.Tensor) -> float | tf.Tensor: ... @@ -88,9 +89,9 @@ class CosineDecayRestarts(LearningRateSchedule): class ExponentialDecay(LearningRateSchedule): def __init__( self, - initial_learning_rate: float | tf.Tensor, + initial_learning_rate: FloatInt | tf.Tensor, decay_steps: int | tf.Tensor, - decay_rate: float | tf.Tensor, + decay_rate: FloatInt | tf.Tensor, staircase: bool = False, name: str = "ExponentialDecay", ) -> None: ... diff --git a/stubs/tensorflow/tensorflow/math.pyi b/stubs/tensorflow/tensorflow/math.pyi index 50a1a8d52d78..a4b2cd4d7128 100644 --- a/stubs/tensorflow/tensorflow/math.pyi +++ b/stubs/tensorflow/tensorflow/math.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import TypeAlias, TypeVar, overload @@ -201,32 +202,32 @@ def logical_xor(x: RaggedTensor, y: RaggedTensor, name: str | None = "LogicalXor @overload def equal(x: TensorCompatible, y: TensorCompatible, name: str | None = None) -> Tensor: ... @overload -def equal(x: RaggedTensor, y: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... +def equal(x: RaggedTensor, y: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... @overload def not_equal(x: TensorCompatible, y: TensorCompatible, name: str | None = None) -> Tensor: ... @overload -def not_equal(x: RaggedTensor, y: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... +def not_equal(x: RaggedTensor, y: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... @overload def greater(x: TensorCompatible, y: TensorCompatible, name: str | None = None) -> Tensor: ... @overload -def greater(x: RaggedTensor, y: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... +def greater(x: RaggedTensor, y: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... @overload def greater_equal(x: TensorCompatible, y: TensorCompatible, name: str | None = None) -> Tensor: ... @overload -def greater_equal(x: RaggedTensor, y: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... +def greater_equal(x: RaggedTensor, y: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... @overload def less(x: TensorCompatible, y: TensorCompatible, name: str | None = None) -> Tensor: ... @overload -def less(x: RaggedTensor, y: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... +def less(x: RaggedTensor, y: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... @overload def less_equal(x: TensorCompatible, y: TensorCompatible, name: str | None = None) -> Tensor: ... @overload -def less_equal(x: RaggedTensor, y: RaggedTensor | float, name: str | None = None) -> RaggedTensor: ... +def less_equal(x: RaggedTensor, y: RaggedTensor | FloatInt, name: str | None = None) -> RaggedTensor: ... def segment_sum(data: TensorCompatible, segment_ids: TensorCompatible, name: str | None = None) -> Tensor: ... diff --git a/stubs/tensorflow/tensorflow/nn.pyi b/stubs/tensorflow/tensorflow/nn.pyi index 4b926e8b0943..6927ec46eb19 100644 --- a/stubs/tensorflow/tensorflow/nn.pyi +++ b/stubs/tensorflow/tensorflow/nn.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from typing import Any, Literal, overload @@ -50,7 +51,7 @@ def avg_pool3d( name: str | None = None, ) -> Tensor: ... def batch_normalization( - x: Tensor, mean: Tensor, variance: Tensor, offset: Tensor, scale: Tensor, variance_epsilon: float, name: str | None = None + x: Tensor, mean: Tensor, variance: Tensor, offset: Tensor, scale: Tensor, variance_epsilon: FloatInt, name: str | None = None ) -> Tensor: ... def bias_add( value: Tensor, bias: Tensor, data_format: Literal["N...C", "NC..."] | None = None, name: str | None = None @@ -159,14 +160,14 @@ def ctc_unique_labels(labels: Tensor, name: str | None = None) -> tuple[Tensor, @overload def embedding_lookup( - params: TensorCompatible, ids: TensorCompatible, max_norm: float | None = None, name: str | None = None + params: TensorCompatible, ids: TensorCompatible, max_norm: FloatInt | None = None, name: str | None = None ) -> Tensor: ... @overload def embedding_lookup( - params: TensorCompatible, ids: RaggedTensor, max_norm: float | None = None, name: str | None = None + params: TensorCompatible, ids: RaggedTensor, max_norm: FloatInt | None = None, name: str | None = None ) -> RaggedTensor: ... -def leaky_relu(features: TensorCompatible, alpha: float = 0.2, name: str | None = None) -> Tensor: ... +def leaky_relu(features: TensorCompatible, alpha: FloatInt = 0.2, name: str | None = None) -> Tensor: ... def log_poisson_loss( targets: TensorCompatible, log_input: TensorCompatible, compute_full_loss: bool = False, name: str | None = None ) -> Tensor: ... @@ -189,7 +190,7 @@ def safe_embedding_lookup_sparse( sparse_weights: SparseTensor | None = None, combiner: str = "mean", default_id: ScalarTensorCompatible | None = None, - max_norm: float | None = None, + max_norm: FloatInt | None = None, name: str | None = None, allow_fast_lookup: bool = False, ) -> Tensor: ... diff --git a/stubs/tensorflow/tensorflow/python/feature_column/feature_column_v2.pyi b/stubs/tensorflow/tensorflow/python/feature_column/feature_column_v2.pyi index 84571bb27921..0417bc306559 100644 --- a/stubs/tensorflow/tensorflow/python/feature_column/feature_column_v2.pyi +++ b/stubs/tensorflow/tensorflow/python/feature_column/feature_column_v2.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt # The types here are all undocumented, but all feature columns are return types of the # public functions in tf.feature_column. As they are undocumented internals while some # common methods are included, they are incomplete and do not have getattr Incomplete fallback. @@ -36,7 +37,7 @@ class SequenceDenseColumn(_FeatureColumn, metaclass=ABCMeta): ... class NumericColumn(DenseColumn): key: str shape: ShapeLike - default_value: float + default_value: FloatInt dtype: tf.DType normalizer_fn: Callable[[tf.Tensor], tf.Tensor] | None @@ -44,7 +45,7 @@ class NumericColumn(DenseColumn): _cls, key: str, shape: ShapeLike, - default_value: float, + default_value: FloatInt, dtype: tf.DType, normalizer_fn: Callable[[tf.Tensor], tf.Tensor] | None, ) -> Self: ... @@ -62,9 +63,9 @@ class CategoricalColumn(_FeatureColumn): class BucketizedColumn(DenseColumn, CategoricalColumn): source_column: NumericColumn - boundaries: list[float] | tuple[float, ...] + boundaries: list[FloatInt] | tuple[FloatInt, ...] - def __new__(_cls, source_column: NumericColumn, boundaries: list[float] | tuple[float, ...]) -> Self: ... + def __new__(_cls, source_column: NumericColumn, boundaries: list[FloatInt] | tuple[FloatInt, ...]) -> Self: ... @property def name(self) -> str: ... @property @@ -81,7 +82,7 @@ class EmbeddingColumn(DenseColumn, SequenceDenseColumn): initializer: Callable[[ShapeLike], tf.Tensor] | None ckpt_to_load_from: str | None tensor_name_in_ckpt: str | None - max_norm: float | None + max_norm: FloatInt | None trainable: bool use_safe_embedding_lookup: bool @@ -94,7 +95,7 @@ class EmbeddingColumn(DenseColumn, SequenceDenseColumn): initializer: Callable[[ShapeLike], tf.Tensor] | None, ckpt_to_load_from: str | None, tensor_name_in_ckpt: str | None, - max_norm: float | None, + max_norm: FloatInt | None, trainable: bool, use_safe_embedding_lookup: bool = True, ) -> Self: ... @@ -123,7 +124,7 @@ class SharedEmbeddingColumn(DenseColumn, SequenceDenseColumn): categorical_column: CategoricalColumn shared_embedding_column_creator: SharedEmbeddingColumnCreator combiner: _Combiners - max_norm: float | None + max_norm: FloatInt | None use_safe_embedding_lookup: bool def __new__( @@ -131,7 +132,7 @@ class SharedEmbeddingColumn(DenseColumn, SequenceDenseColumn): categorical_column: CategoricalColumn, shared_embedding_column_creator: SharedEmbeddingColumnCreator, combiner: _Combiners, - max_norm: float | None, + max_norm: FloatInt | None, use_safe_embedding_lookup: bool = True, ) -> Self: ... @property diff --git a/stubs/tensorflow/tensorflow/python/feature_column/sequence_feature_column.pyi b/stubs/tensorflow/tensorflow/python/feature_column/sequence_feature_column.pyi index 921ab086518a..3e4176d10b74 100644 --- a/stubs/tensorflow/tensorflow/python/feature_column/sequence_feature_column.pyi +++ b/stubs/tensorflow/tensorflow/python/feature_column/sequence_feature_column.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Callable from typing_extensions import Self @@ -10,7 +11,7 @@ from tensorflow.python.feature_column.feature_column_v2 import SequenceDenseColu class SequenceNumericColumn(SequenceDenseColumn): key: str shape: ShapeLike - default_value: float + default_value: FloatInt dtype: tf.DType normalizer_fn: Callable[[tf.Tensor], tf.Tensor] | None @@ -18,7 +19,7 @@ class SequenceNumericColumn(SequenceDenseColumn): _cls, key: str, shape: ShapeLike, - default_value: float, + default_value: FloatInt, dtype: tf.DType, normalizer_fn: Callable[[tf.Tensor], tf.Tensor] | None, ) -> Self: ... diff --git a/stubs/tensorflow/tensorflow/random.pyi b/stubs/tensorflow/tensorflow/random.pyi index 984773c69e7d..f7516b7ecb31 100644 --- a/stubs/tensorflow/tensorflow/random.pyi +++ b/stubs/tensorflow/tensorflow/random.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from enum import Enum from typing import Literal, TypeAlias @@ -86,19 +87,19 @@ def fixed_unigram_candidate_sampler( unique: bool, range_max: int, vocab_file: str = "", - distortion: float = 1.0, + distortion: FloatInt = 1.0, num_reserved_ids: int = 0, num_shards: int = 1, shard: int = 0, - unigrams: Sequence[float] = (), + unigrams: Sequence[FloatInt] = (), seed: int | None = None, name: str | None = None, ) -> tuple[tf.Tensor, tf.Tensor, tf.Tensor]: ... def fold_in(seed: tf.Tensor | Sequence[int], data: int, alg: _Alg = "auto_select") -> int: ... def gamma( shape: tf.Tensor | Sequence[int], - alpha: tf.Tensor | float | Sequence[float], - beta: tf.Tensor | float | Sequence[float] | None = None, + alpha: tf.Tensor | FloatInt | Sequence[FloatInt], + beta: tf.Tensor | FloatInt | Sequence[FloatInt] | None = None, dtype: DTypeLike = ..., seed: int | None = None, name: str | None = None, @@ -163,8 +164,8 @@ def stateless_gamma( def stateless_normal( shape: tf.Tensor | Sequence[int], seed: tuple[int, int] | tf.Tensor, - mean: float | tf.Tensor = 0.0, - stddev: float | tf.Tensor = 1.0, + mean: FloatInt | tf.Tensor = 0.0, + stddev: FloatInt | tf.Tensor = 1.0, dtype: DTypeLike = ..., name: str | None = None, alg: _Alg = "auto_select", @@ -172,10 +173,10 @@ def stateless_normal( def stateless_parameterized_truncated_normal( shape: tf.Tensor | Sequence[int], seed: tuple[int, int] | tf.Tensor, - means: float | tf.Tensor = 0.0, - stddevs: float | tf.Tensor = 1.0, - minvals: tf.Tensor | float = -2.0, - maxvals: tf.Tensor | float = 2.0, + means: FloatInt | tf.Tensor = 0.0, + stddevs: FloatInt | tf.Tensor = 1.0, + minvals: tf.Tensor | FloatInt = -2.0, + maxvals: tf.Tensor | FloatInt = 2.0, name: str | None = None, ) -> tf.Tensor: ... def stateless_poisson( @@ -188,8 +189,8 @@ def stateless_poisson( def stateless_truncated_normal( shape: tf.Tensor | Sequence[int], seed: tuple[int, int] | tf.Tensor, - mean: float | tf.Tensor = 0.0, - stddev: float | tf.Tensor = 1.0, + mean: FloatInt | tf.Tensor = 0.0, + stddev: FloatInt | tf.Tensor = 1.0, dtype: DTypeLike = ..., name: str | None = None, alg: _Alg = "auto_select", @@ -197,24 +198,24 @@ def stateless_truncated_normal( def stateless_uniform( shape: tf.Tensor | Sequence[int], seed: tuple[int, int] | tf.Tensor, - minval: float | tf.Tensor = 0, - maxval: float | tf.Tensor | None = None, + minval: FloatInt | tf.Tensor = 0, + maxval: FloatInt | tf.Tensor | None = None, dtype: DTypeLike = ..., name: str | None = None, alg: _Alg = "auto_select", ) -> tf.Tensor: ... def truncated_normal( shape: tf.Tensor | Sequence[int], - mean: float | tf.Tensor = 0.0, - stddev: float | tf.Tensor = 1.0, + mean: FloatInt | tf.Tensor = 0.0, + stddev: FloatInt | tf.Tensor = 1.0, dtype: DTypeLike = ..., seed: int | None = None, name: str | None = None, ) -> tf.Tensor: ... def uniform( shape: tf.Tensor | Sequence[int], - minval: float | tf.Tensor = 0, - maxval: float | tf.Tensor | None = None, + minval: FloatInt | tf.Tensor = 0, + maxval: FloatInt | tf.Tensor | None = None, dtype: DTypeLike = ..., seed: int | None = None, name: str | None = None, diff --git a/stubs/tensorflow/tensorflow/summary.pyi b/stubs/tensorflow/tensorflow/summary.pyi index 07cbe539d92d..a5df27120b66 100644 --- a/stubs/tensorflow/tensorflow/summary.pyi +++ b/stubs/tensorflow/tensorflow/summary.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc from collections.abc import Callable, Generator from contextlib import AbstractContextManager, contextmanager @@ -49,7 +50,7 @@ def image( ) -> bool: ... @contextmanager def record_if(condition: bool | tf.Tensor | Callable[[], bool]) -> Generator[None]: ... -def scalar(name: str, data: float | tf.Tensor, step: int | tf.Tensor | None = None, description: str | None = None) -> bool: ... +def scalar(name: str, data: FloatInt | tf.Tensor, step: int | tf.Tensor | None = None, description: str | None = None) -> bool: ... def should_record_summaries() -> bool: ... def text(name: str, data: str | tf.Tensor, step: int | tf.Tensor | None = None, description: str | None = None) -> bool: ... def trace_export(name: str, step: int | tf.Tensor | None = None, profiler_outdir: str | None = None) -> None: ... diff --git a/stubs/tinycss2/tinycss2/ast.pyi b/stubs/tinycss2/tinycss2/ast.pyi index 3390a86fcb78..4155b2a440ca 100644 --- a/stubs/tinycss2/tinycss2/ast.pyi +++ b/stubs/tinycss2/tinycss2/ast.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Literal class Node: @@ -79,32 +80,32 @@ class UnicodeRangeToken(Node): class NumberToken(Node): type: Literal["number"] - value: float + value: FloatInt int_value: int | None is_integer: bool representation: str repr_format: str - def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str) -> None: ... + def __init__(self, line: int, column: int, value: FloatInt, int_value: int | None, representation: str) -> None: ... class PercentageToken(Node): type: Literal["percentage"] - value: float + value: FloatInt int_value: int | None is_integer: bool representation: str repr_format: str - def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str) -> None: ... + def __init__(self, line: int, column: int, value: FloatInt, int_value: int | None, representation: str) -> None: ... class DimensionToken(Node): type: Literal["dimension"] - value: float + value: FloatInt int_value: int | None is_integer: bool representation: str unit: str lower_unit: str repr_format: str - def __init__(self, line: int, column: int, value: float, int_value: int | None, representation: str, unit: str) -> None: ... + def __init__(self, line: int, column: int, value: FloatInt, int_value: int | None, representation: str, unit: str) -> None: ... class ParenthesesBlock(Node): type: Literal["() block"] diff --git a/stubs/tinycss2/tinycss2/color3.pyi b/stubs/tinycss2/tinycss2/color3.pyi index 664acf304a11..bc10d861fa0a 100644 --- a/stubs/tinycss2/tinycss2/color3.pyi +++ b/stubs/tinycss2/tinycss2/color3.pyi @@ -1,12 +1,13 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import NamedTuple from .ast import Node class RGBA(NamedTuple): - red: float - green: float - blue: float - alpha: float + red: FloatInt + green: FloatInt + blue: FloatInt + alpha: FloatInt def parse_color(input: str | Iterable[Node]) -> str | RGBA | None: ... diff --git a/stubs/tinycss2/tinycss2/color4.pyi b/stubs/tinycss2/tinycss2/color4.pyi index d393e156e295..44d5c2099b8a 100644 --- a/stubs/tinycss2/tinycss2/color4.pyi +++ b/stubs/tinycss2/tinycss2/color4.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Iterator from typing import Literal @@ -5,7 +6,7 @@ from .ast import Node class Color: COLOR_SPACES: set[str] | None - def __init__(self, space: str, coordinates: tuple[float | None, ...], alpha: float) -> None: ... + def __init__(self, space: str, coordinates: tuple[FloatInt | None, ...], alpha: FloatInt) -> None: ... def __iter__(self) -> Iterator[float | None]: ... def __getitem__(self, key: int) -> float: ... def __hash__(self) -> int: ... @@ -15,5 +16,5 @@ class Color: def parse_color(input: str | Iterable[Node]) -> Color | Literal["currentcolor"] | None: ... COLOR_SPACES: set[str] -D50: tuple[float, float, float] -D65: tuple[float, float, float] +D50: tuple[FloatInt, FloatInt, FloatInt] +D65: tuple[FloatInt, FloatInt, FloatInt] diff --git a/stubs/tinycss2/tinycss2/color5.pyi b/stubs/tinycss2/tinycss2/color5.pyi index 03246e07e6e9..f2bd3ac90bc3 100644 --- a/stubs/tinycss2/tinycss2/color5.pyi +++ b/stubs/tinycss2/tinycss2/color5.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from typing import Literal @@ -6,8 +7,8 @@ from .ast import Node COLOR_SCHEMES: set[str] COLOR_SPACES: set[str] -D50: tuple[float, float, float] -D65: tuple[float, float, float] +D50: tuple[FloatInt, FloatInt, FloatInt] +D65: tuple[FloatInt, FloatInt, FloatInt] class Color(color4.Color): COLOR_SPACES: set[str] | None diff --git a/stubs/tqdm/tqdm/_monitor.pyi b/stubs/tqdm/tqdm/_monitor.pyi index bb8ee47220b8..d955494912ed 100644 --- a/stubs/tqdm/tqdm/_monitor.pyi +++ b/stubs/tqdm/tqdm/_monitor.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from threading import Thread @@ -9,9 +10,9 @@ class TMonitor(Thread): daemon: bool woken: int tqdm_cls: type[Incomplete] - sleep_interval: float + sleep_interval: FloatInt was_killed: Incomplete - def __init__(self, tqdm_cls: type[Incomplete], sleep_interval: float) -> None: ... + def __init__(self, tqdm_cls: type[Incomplete], sleep_interval: FloatInt) -> None: ... def exit(self): ... def get_instances(self): ... def run(self) -> None: ... diff --git a/stubs/tqdm/tqdm/asyncio.pyi b/stubs/tqdm/tqdm/asyncio.pyi index b665fcfeb728..9f767adc7e17 100644 --- a/stubs/tqdm/tqdm/asyncio.pyi +++ b/stubs/tqdm/tqdm/asyncio.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsWrite from asyncio import Future from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Iterator, Mapping @@ -24,38 +25,38 @@ class tqdm_asyncio(std_tqdm[_T]): fs: Iterable[Awaitable[_T]], *, loop: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, total: int | None = None, desc: str | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., ) -> Iterator[Future[_T]]: ... @classmethod async def gather( cls, *fs: Awaitable[_T], loop: bool | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, total: int | None = None, return_exceptions: bool = False, iterable: Iterable[_T] = ..., @@ -63,25 +64,25 @@ class tqdm_asyncio(std_tqdm[_T]): leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., ) -> list[_T]: ... @overload @@ -89,29 +90,29 @@ class tqdm_asyncio(std_tqdm[_T]): self, iterable: Iterable[_T] | AsyncIterator[_T], desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., **kwargs, ) -> None: ... @@ -120,29 +121,29 @@ class tqdm_asyncio(std_tqdm[_T]): self: tqdm_asyncio[Never], iterable: None = None, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., **kwargs, ) -> None: ... @@ -154,58 +155,58 @@ def tarange( step: int | None = ..., *, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., ) -> tqdm_asyncio[int]: ... @overload def tarange( stop: int, *, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., ) -> tqdm_asyncio[int]: ... tqdm = tqdm_asyncio diff --git a/stubs/tqdm/tqdm/contrib/concurrent.pyi b/stubs/tqdm/tqdm/contrib/concurrent.pyi index a90f6b85f9ff..08229468b593 100644 --- a/stubs/tqdm/tqdm/contrib/concurrent.pyi +++ b/stubs/tqdm/tqdm/contrib/concurrent.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import SupportsWrite from collections.abc import Callable, Generator, Iterable, Mapping @@ -25,29 +26,29 @@ class _TqdmCommonKwargs(TypedDict, total=False): chunksize: int # Standard tqdm parameters desc: str | None - total: float | None + total: FloatInt | None leave: bool | None file: SupportsWrite[str] | None ncols: int | None - mininterval: float - maxinterval: float - miniters: float | None + mininterval: FloatInt + maxinterval: FloatInt + miniters: FloatInt | None ascii: bool | str | None disable: bool | None unit: str - unit_scale: bool | float + unit_scale: bool | FloatInt dynamic_ncols: bool - smoothing: float + smoothing: FloatInt bar_format: str | None - initial: float + initial: FloatInt position: int | None postfix: Mapping[str, object] | str | None - unit_divisor: float + unit_divisor: FloatInt write_bytes: bool | None - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None nrows: int | None colour: str | None - delay: float | None + delay: FloatInt | None # TODO: refactor this, when `TypedDict` will support conditional fields if sys.version_info >= (3, 14): diff --git a/stubs/tqdm/tqdm/contrib/discord.pyi b/stubs/tqdm/tqdm/contrib/discord.pyi index 0c6ba34e702e..686ff22b6b7f 100644 --- a/stubs/tqdm/tqdm/contrib/discord.pyi +++ b/stubs/tqdm/tqdm/contrib/discord.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from concurrent.futures import Future @@ -35,29 +36,29 @@ class tqdm_discord(tqdm_auto[_T]): self, iterable: Iterable[_T], desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., *, token: str | None = None, @@ -69,29 +70,29 @@ class tqdm_discord(tqdm_auto[_T]): self: tqdm_discord[Never], iterable: None = None, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., *, token: str | None = None, diff --git a/stubs/tqdm/tqdm/contrib/slack.pyi b/stubs/tqdm/tqdm/contrib/slack.pyi index cd163bc1bc39..e1895fc5ec77 100644 --- a/stubs/tqdm/tqdm/contrib/slack.pyi +++ b/stubs/tqdm/tqdm/contrib/slack.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from typing import TypeVar, overload @@ -25,29 +26,29 @@ class tqdm_slack(tqdm_auto[_T]): self, iterable: Iterable[_T], desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., *, token: str | None = None, @@ -59,29 +60,29 @@ class tqdm_slack(tqdm_auto[_T]): self: tqdm_slack[Never], iterable: None = None, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., *, token: str | None = None, diff --git a/stubs/tqdm/tqdm/contrib/telegram.pyi b/stubs/tqdm/tqdm/contrib/telegram.pyi index 8fd56a284dea..ced64b0d51c6 100644 --- a/stubs/tqdm/tqdm/contrib/telegram.pyi +++ b/stubs/tqdm/tqdm/contrib/telegram.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from typing import TypeVar, overload @@ -30,29 +31,29 @@ class tqdm_telegram(tqdm_auto[_T]): self, iterable: Iterable[_T], desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., *, token: str | None = None, @@ -64,29 +65,29 @@ class tqdm_telegram(tqdm_auto[_T]): self: tqdm_telegram[Never], iterable: None = None, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., *, token: str | None = None, diff --git a/stubs/tqdm/tqdm/gui.pyi b/stubs/tqdm/tqdm/gui.pyi index 265cfa0cf418..f553e7d7b599 100644 --- a/stubs/tqdm/tqdm/gui.pyi +++ b/stubs/tqdm/tqdm/gui.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from typing import TypeVar, overload @@ -30,29 +31,29 @@ class tqdm_gui(std_tqdm[_T]): self, iterable: Iterable[_T], desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., **kwargs, ) -> None: ... @@ -61,29 +62,29 @@ class tqdm_gui(std_tqdm[_T]): self: tqdm_gui[Never], iterable: None = None, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., **kwargs, ) -> None: ... diff --git a/stubs/tqdm/tqdm/notebook.pyi b/stubs/tqdm/tqdm/notebook.pyi index 58122b8dd9ef..df4f3d6d70b4 100644 --- a/stubs/tqdm/tqdm/notebook.pyi +++ b/stubs/tqdm/tqdm/notebook.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsWrite from collections.abc import Iterable, Iterator, Mapping from typing import TypeVar, overload @@ -12,7 +13,7 @@ _T = TypeVar("_T") class tqdm_notebook(std_tqdm[_T]): @staticmethod def status_printer( - _: SupportsWrite[str] | None, total: float | None = None, desc: str | None = None, ncols: int | None = None + _: SupportsWrite[str] | None, total: FloatInt | None = None, desc: str | None = None, ncols: int | None = None ): ... displayed: bool def display( @@ -38,29 +39,29 @@ class tqdm_notebook(std_tqdm[_T]): self, iterable: Iterable[_T], desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., display: bool = ..., **kwargs, ) -> None: ... @@ -69,29 +70,29 @@ class tqdm_notebook(std_tqdm[_T]): self: tqdm_notebook[Never], iterable: None = None, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., display: bool = ..., **kwargs, ) -> None: ... @@ -100,7 +101,7 @@ class tqdm_notebook(std_tqdm[_T]): def update(self, n: int = 1): ... # type: ignore[override] def close(self) -> None: ... def clear(self, *_, **__) -> None: ... - def reset(self, total: float | None = None): ... + def reset(self, total: FloatInt | None = None): ... tqdm = tqdm_notebook tnrange = trange diff --git a/stubs/tqdm/tqdm/rich.pyi b/stubs/tqdm/tqdm/rich.pyi index e470dec5529b..148fe813bee8 100644 --- a/stubs/tqdm/tqdm/rich.pyi +++ b/stubs/tqdm/tqdm/rich.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsWrite from abc import ABC, abstractmethod from collections.abc import Iterable, Mapping @@ -13,7 +14,7 @@ _T = TypeVar("_T") # Actually rich.progress.ProgressColumn @type_check_only class _ProgressColumn(ABC): - max_refresh: float | None + max_refresh: FloatInt | None def __init__(self, table_column: Incomplete | None = ...) -> None: ... def get_table_column(self): ... def __call__(self, task): ... @@ -46,29 +47,29 @@ class tqdm_rich(std_tqdm[_T]): self, iterable: Iterable[_T], desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., **kwargs, ) -> None: ... @@ -77,29 +78,29 @@ class tqdm_rich(std_tqdm[_T]): self: tqdm_rich[Never], iterable: None = None, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., **kwargs, ) -> None: ... diff --git a/stubs/tqdm/tqdm/std.pyi b/stubs/tqdm/tqdm/std.pyi index 9059076506a8..67221a906083 100644 --- a/stubs/tqdm/tqdm/std.pyi +++ b/stubs/tqdm/tqdm/std.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import contextlib from _typeshed import Incomplete, SupportsRead, SupportsWrite from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping @@ -37,28 +38,28 @@ class tqdm(Comparable, Generic[_T]): monitor: ClassVar[TMonitor | None] @staticmethod - def format_sizeof(num: float, suffix: str = "", divisor: float = 1000) -> str: ... + def format_sizeof(num: FloatInt, suffix: str = "", divisor: FloatInt = 1000) -> str: ... @staticmethod - def format_interval(t: float) -> str: ... + def format_interval(t: FloatInt) -> str: ... @staticmethod - def format_num(n: float) -> str: ... + def format_num(n: FloatInt) -> str: ... @staticmethod def status_printer(file: SupportsWrite[str]) -> Callable[[str], None]: ... @staticmethod def format_meter( - n: float, - total: float, - elapsed: float, + n: FloatInt, + total: FloatInt, + elapsed: FloatInt, ncols: int | None = None, prefix: str | None = "", ascii: bool | str | None = False, unit: str | None = "it", - unit_scale: bool | float | None = False, - rate: float | None = None, + unit_scale: bool | FloatInt | None = False, + rate: FloatInt | None = None, bar_format: str | None = None, postfix: str | Mapping[str, object] | None = None, - unit_divisor: float | None = 1000, - initial: float | None = 0, + unit_divisor: FloatInt | None = 1000, + initial: FloatInt | None = 0, colour: str | None = None, ) -> str: ... @@ -67,29 +68,29 @@ class tqdm(Comparable, Generic[_T]): self, iterable: Iterable[_T], desc: str | None = None, - total: float | None = None, + total: FloatInt | None = None, leave: bool | None = True, file: SupportsWrite[str] | None = None, ncols: int | None = None, - mininterval: float = 0.1, - maxinterval: float = 10.0, - miniters: float | None = None, + mininterval: FloatInt = 0.1, + maxinterval: FloatInt = 10.0, + miniters: FloatInt | None = None, ascii: bool | str | None = None, disable: bool | None = False, unit: str = "it", - unit_scale: bool | float = False, + unit_scale: bool | FloatInt = False, dynamic_ncols: bool = False, - smoothing: float = 0.3, + smoothing: FloatInt = 0.3, bar_format: str | None = None, - initial: float = 0, + initial: FloatInt = 0, position: int | None = None, postfix: Mapping[str, object] | str | None = None, - unit_divisor: float = 1000, + unit_divisor: FloatInt = 1000, write_bytes: bool = False, - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = None, + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = None, nrows: int | None = None, colour: str | None = None, - delay: float | None = 0, + delay: FloatInt | None = 0, gui: bool = False, **kwargs, ) -> None: ... @@ -98,29 +99,29 @@ class tqdm(Comparable, Generic[_T]): self: tqdm[Never], iterable: None = None, desc: str | None = None, - total: float | None = None, + total: FloatInt | None = None, leave: bool | None = True, file: SupportsWrite[str] | None = None, ncols: int | None = None, - mininterval: float = 0.1, - maxinterval: float = 10.0, - miniters: float | None = None, + mininterval: FloatInt = 0.1, + maxinterval: FloatInt = 10.0, + miniters: FloatInt | None = None, ascii: bool | str | None = None, disable: bool | None = False, unit: str = "it", - unit_scale: bool | float = False, + unit_scale: bool | FloatInt = False, dynamic_ncols: bool = False, - smoothing: float = 0.3, + smoothing: FloatInt = 0.3, bar_format: str | None = None, - initial: float = 0, + initial: FloatInt = 0, position: int | None = None, postfix: Mapping[str, object] | str | None = None, - unit_divisor: float = 1000, + unit_divisor: FloatInt = 1000, write_bytes: bool | None = False, - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = None, + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = None, nrows: int | None = None, colour: str | None = None, - delay: float | None = 0, + delay: FloatInt | None = 0, gui: bool = False, **kwargs, ) -> None: ... @@ -141,29 +142,29 @@ class tqdm(Comparable, Generic[_T]): cls, *, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., ) -> None: ... iterable: Incomplete @@ -176,27 +177,27 @@ class tqdm(Comparable, Generic[_T]): fp: Incomplete ncols: int | None nrows: int | None - mininterval: float - maxinterval: float - miniters: float | None + mininterval: FloatInt + maxinterval: FloatInt + miniters: FloatInt | None dynamic_miniters: bool ascii: bool | str | None unit: str - unit_scale: bool | float - unit_divisor: float - initial: float - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None - delay: float | None + unit_scale: bool | FloatInt + unit_divisor: FloatInt + initial: FloatInt + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None + delay: FloatInt | None gui: bool dynamic_ncols: bool - smoothing: float + smoothing: FloatInt bar_format: str | None postfix: Mapping[str, object] | str | None colour: str | None last_print_n: float | int sp: Incomplete - last_print_t: float - start_t: float + last_print_t: FloatInt + start_t: FloatInt def __bool__(self) -> bool: ... def __len__(self) -> int: ... @@ -209,14 +210,14 @@ class tqdm(Comparable, Generic[_T]): def __del__(self) -> None: ... def __hash__(self) -> int: ... def __iter__(self) -> Iterator[_T]: ... - def update(self, n: float | None = 1) -> bool | None: ... + def update(self, n: FloatInt | None = 1) -> bool | None: ... def close(self) -> None: ... def clear(self, nolock: bool = False) -> None: ... def refresh( - self, nolock: bool = False, lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = None + self, nolock: bool = False, lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = None ) -> None: ... def unpause(self) -> None: ... - def reset(self, total: float | None = None) -> None: ... + def reset(self, total: FloatInt | None = None) -> None: ... def set_description(self, desc: str | None = None, refresh: bool | None = True) -> None: ... def set_description_str(self, desc: str | None = None, refresh: bool | None = True) -> None: ... def set_postfix(self, ordered_dict: Mapping[str, object] | None = None, refresh: bool | None = True, **kwargs) -> None: ... @@ -229,12 +230,12 @@ class tqdm(Comparable, Generic[_T]): @overload @classmethod def wrapattr( - cls, stream: SupportsRead[_U], method: Literal["read"], total: float | None = None, bytes: bool = True, **tqdm_kwargs + cls, stream: SupportsRead[_U], method: Literal["read"], total: FloatInt | None = None, bytes: bool = True, **tqdm_kwargs ) -> contextlib._GeneratorContextManager[SupportsRead[_U]]: ... @overload @classmethod def wrapattr( - cls, stream: SupportsWrite[_U], method: Literal["write"], total: float | None = None, bytes: bool = True, **tqdm_kwargs + cls, stream: SupportsWrite[_U], method: Literal["write"], total: FloatInt | None = None, bytes: bool = True, **tqdm_kwargs ) -> contextlib._GeneratorContextManager[SupportsWrite[_U]]: ... @overload @@ -244,56 +245,56 @@ def trange( step: int | None = ..., *, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., ) -> tqdm[int]: ... @overload def trange( stop: int, *, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., ) -> tqdm[int]: ... diff --git a/stubs/tqdm/tqdm/tk.pyi b/stubs/tqdm/tqdm/tk.pyi index c45457e323a7..9a0afabcb354 100644 --- a/stubs/tqdm/tqdm/tk.pyi +++ b/stubs/tqdm/tqdm/tk.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from typing import TypeVar, overload @@ -15,29 +16,29 @@ class tqdm_tk(std_tqdm[_T]): self, iterable: Iterable[_T], desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., grab=..., tk_parent=..., @@ -49,29 +50,29 @@ class tqdm_tk(std_tqdm[_T]): self: tqdm_tk[Never], iterable: None = None, desc: str | None = ..., - total: float | None = ..., + total: FloatInt | None = ..., leave: bool | None = ..., file: SupportsWrite[str] | None = ..., ncols: int | None = ..., - mininterval: float = ..., - maxinterval: float = ..., - miniters: float | None = ..., + mininterval: FloatInt = ..., + maxinterval: FloatInt = ..., + miniters: FloatInt | None = ..., ascii: bool | str | None = ..., disable: bool | None = ..., unit: str = ..., - unit_scale: bool | float = ..., + unit_scale: bool | FloatInt = ..., dynamic_ncols: bool = ..., - smoothing: float = ..., + smoothing: FloatInt = ..., bar_format: str | None = ..., - initial: float = ..., + initial: FloatInt = ..., position: int | None = ..., postfix: Mapping[str, object] | str | None = ..., - unit_divisor: float = ..., + unit_divisor: FloatInt = ..., write_bytes: bool | None = ..., - lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ..., + lock_args: tuple[bool | None, FloatInt | None] | tuple[bool | None] | None = ..., nrows: int | None = ..., colour: str | None = ..., - delay: float | None = ..., + delay: FloatInt | None = ..., gui: bool = ..., grab=..., tk_parent=..., diff --git a/stubs/ttkthemes/ttkthemes/_imgops.pyi b/stubs/ttkthemes/ttkthemes/_imgops.pyi index 5a65a25702a9..0f557e4dd9b6 100644 --- a/stubs/ttkthemes/ttkthemes/_imgops.pyi +++ b/stubs/ttkthemes/ttkthemes/_imgops.pyi @@ -1,6 +1,7 @@ +from _typeshed import FloatInt from typing import Any, TypeAlias _Image: TypeAlias = Any # actually PIL.Image, but not worth adding a dependency -def shift_hue(image: _Image, hue: float) -> _Image: ... +def shift_hue(image: _Image, hue: FloatInt) -> _Image: ... def make_transparent(image: _Image) -> _Image: ... diff --git a/stubs/ttkthemes/ttkthemes/_widget.pyi b/stubs/ttkthemes/ttkthemes/_widget.pyi index d5bf4d3ee151..60fd8e5f29a3 100644 --- a/stubs/ttkthemes/ttkthemes/_widget.pyi +++ b/stubs/ttkthemes/ttkthemes/_widget.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import _tkinter from _typeshed import StrPath from typing import ClassVar @@ -17,9 +18,9 @@ class ThemedWidget: def set_theme_advanced( self, theme_name: str, - brightness: float = 1.0, - saturation: float = 1.0, - hue: float = 1.0, + brightness: FloatInt = 1.0, + saturation: FloatInt = 1.0, + hue: FloatInt = 1.0, preserve_transparency: bool = True, output_dir: StrPath | None = None, advanced_name: str = "advanced", diff --git a/stubs/ttkthemes/ttkthemes/themed_tk.pyi b/stubs/ttkthemes/ttkthemes/themed_tk.pyi index 77f34b04ad00..bfad19060bef 100644 --- a/stubs/ttkthemes/ttkthemes/themed_tk.pyi +++ b/stubs/ttkthemes/ttkthemes/themed_tk.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import tkinter from collections.abc import Callable from typing import Any, Literal @@ -31,21 +32,21 @@ class ThemedTk(tkinter.Tk, ThemedWidget): toplevel: bool | None = ..., theme: str | None = ..., background: str = ..., - bd: float | str = ..., + bd: FloatInt | str = ..., bg: str = ..., - border: float | str = ..., - borderwidth: float | str = ..., + border: FloatInt | str = ..., + borderwidth: FloatInt | str = ..., cursor: tkinter._Cursor = ..., - height: float | str = ..., + height: FloatInt | str = ..., highlightbackground: str = ..., highlightcolor: str = ..., - highlightthickness: float | str = ..., + highlightthickness: FloatInt | str = ..., menu: tkinter.Menu = ..., - padx: float | str = ..., - pady: float | str = ..., + padx: FloatInt | str = ..., + pady: FloatInt | str = ..., relief: Literal["raised", "sunken", "flat", "ridge", "solid", "groove"] = ..., takefocus: bool | Literal[0, 1, ""] | Callable[[str], bool | None] = ..., - width: float | str = ..., + width: FloatInt | str = ..., ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... def cget(self, k: str) -> Any: ... def configure( # type: ignore[override] @@ -56,21 +57,21 @@ class ThemedTk(tkinter.Tk, ThemedWidget): toplevel: bool | None = ..., theme: str | None = ..., background: str = ..., - bd: float | str = ..., + bd: FloatInt | str = ..., bg: str = ..., - border: float | str = ..., - borderwidth: float | str = ..., + border: FloatInt | str = ..., + borderwidth: FloatInt | str = ..., cursor: tkinter._Cursor = ..., - height: float | str = ..., + height: FloatInt | str = ..., highlightbackground: str = ..., highlightcolor: str = ..., - highlightthickness: float | str = ..., + highlightthickness: FloatInt | str = ..., menu: tkinter.Menu = ..., - padx: float | str = ..., - pady: float | str = ..., + padx: FloatInt | str = ..., + pady: FloatInt | str = ..., relief: Literal["raised", "sunken", "flat", "ridge", "solid", "groove"] = ..., takefocus: bool | Literal[0, 1, ""] | Callable[[str], bool | None] = ..., - width: float | str = ..., + width: FloatInt | str = ..., ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... def __getitem__(self, k: str) -> Any: ... def __setitem__(self, k: str, v: Any) -> None: ... diff --git a/stubs/uWSGI/uwsgi.pyi b/stubs/uWSGI/uwsgi.pyi index 1830e762d770..8c58e5ec61ea 100644 --- a/stubs/uWSGI/uwsgi.pyi +++ b/stubs/uWSGI/uwsgi.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import HasFileno, OptExcInfo, ReadOnlyBuffer from _typeshed.wsgi import WSGIApplication from collections.abc import Callable @@ -68,7 +69,7 @@ def add_timer(signum: int, seconds: int, /) -> None: ... def add_var(key: bytes | str, val: bytes | str, /) -> Literal[True]: ... def alarm(alarm: str, msg: bytes | ReadOnlyBuffer | str, /) -> None: ... def async_connect(socket_name: str, /) -> int: ... -def async_sleep(timeout: float, /) -> Literal[b""]: ... +def async_sleep(timeout: FloatInt, /) -> Literal[b""]: ... def cache_clear(cache_name: str = ..., /) -> _TrueOrNone: ... def cache_dec(key: str | bytes, decrement: int = 1, expires: int = 0, cache_name: str = ..., /) -> _TrueOrNone: ... def cache_del(key: str | bytes, cache_name: str = ..., /) -> _TrueOrNone: ... diff --git a/stubs/vobject/vobject/icalendar.pyi b/stubs/vobject/vobject/icalendar.pyi index 5d0cab4d4bb9..94e267e13318 100644 --- a/stubs/vobject/vobject/icalendar.pyi +++ b/stubs/vobject/vobject/icalendar.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from _typeshed import Incomplete from collections.abc import Iterable @@ -212,7 +213,7 @@ utcDateTimeList: list[str] dateTimeOrDateList: list[str] textList: list[str] -def numToDigits(num: float | None, places: int) -> str: ... +def numToDigits(num: FloatInt | None, places: int) -> str: ... def timedeltaToString(delta: datetime.timedelta) -> str: ... def timeToString(dateOrDateTime: datetime.date | datetime.datetime) -> str: ... def dateToString(date: datetime.date) -> str: ... diff --git a/stubs/vobject/vobject/vcard.pyi b/stubs/vobject/vobject/vcard.pyi index 7707566f95ea..3aec0f63f8d4 100644 --- a/stubs/vobject/vobject/vcard.pyi +++ b/stubs/vobject/vobject/vcard.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import AnyStr from .base import ContentLine @@ -77,7 +78,7 @@ class Label(VCardTextBehavior): class GEO(VCardBehavior): ... wacky_apple_photo_serialize: bool -REALLY_LARGE: float +REALLY_LARGE: FloatInt class Photo(VCardTextBehavior): name: str diff --git a/stubs/waitress/waitress/channel.pyi b/stubs/waitress/waitress/channel.pyi index 61f234855c89..8ee4ddb376f4 100644 --- a/stubs/waitress/waitress/channel.pyi +++ b/stubs/waitress/waitress/channel.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Sequence from socket import _RetAddress, socket from threading import Condition, Lock @@ -18,7 +19,7 @@ class HTTPChannel(wasyncore.dispatcher): error_task_class: type[ErrorTask] parser_class: type[HTTPRequestParser] request: HTTPRequestParser | None - last_activity: float + last_activity: FloatInt will_close: bool close_when_flushed: bool requests: Sequence[HTTPRequestParser] @@ -28,7 +29,7 @@ class HTTPChannel(wasyncore.dispatcher): server: BaseWSGIServer adj: Adjustments outbufs: Sequence[OverflowableBuffer] - creation_time: float + creation_time: FloatInt sendbuf_len: int task_lock: Lock outbuf_lock: Condition diff --git a/stubs/waitress/waitress/wasyncore.pyi b/stubs/waitress/waitress/wasyncore.pyi index 788cbc8d2208..3e4ff9ae2b50 100644 --- a/stubs/waitress/waitress/wasyncore.pyi +++ b/stubs/waitress/waitress/wasyncore.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import ReadableBuffer from collections.abc import Mapping @@ -16,12 +17,12 @@ class ExitNow(Exception): ... def read(obj: dispatcher) -> None: ... def write(obj: dispatcher) -> None: ... def readwrite(obj: dispatcher, flags: int) -> None: ... -def poll(timeout: float = 0.0, map: _SocketMap | None = None) -> None: ... -def poll2(timeout: float = 0.0, map: _SocketMap | None = None) -> None: ... +def poll(timeout: FloatInt = 0.0, map: _SocketMap | None = None) -> None: ... +def poll2(timeout: FloatInt = 0.0, map: _SocketMap | None = None) -> None: ... poll3 = poll2 -def loop(timeout: float = 30.0, use_poll: bool = False, map: _SocketMap | None = None, count: int | None = None) -> None: ... +def loop(timeout: FloatInt = 30.0, use_poll: bool = False, map: _SocketMap | None = None, count: int | None = None) -> None: ... def compact_traceback() -> tuple[tuple[str, str, str], BaseException, BaseException, str]: ... class dispatcher: diff --git a/stubs/workalendar/workalendar/skyfield_astronomy.pyi b/stubs/workalendar/workalendar/skyfield_astronomy.pyi index fa73cc93a317..b37b58ceef4d 100644 --- a/stubs/workalendar/workalendar/skyfield_astronomy.pyi +++ b/stubs/workalendar/workalendar/skyfield_astronomy.pyi @@ -1,12 +1,13 @@ +from _typeshed import FloatInt import datetime from _typeshed import Incomplete from math import _SupportsFloatOrIndex from typing import Final -hour: Final[float] -minute: Final[float] -second: Final[float] -newton_precision: Final[float] +hour: Final[FloatInt] +minute: Final[FloatInt] +second: Final[FloatInt] +newton_precision: Final[FloatInt] def calculate_equinoxes(year, timezone: str = "UTC") -> tuple[Incomplete, Incomplete]: ... def get_current_longitude(current_date, earth, sun): ... diff --git a/stubs/wurlitzer/wurlitzer.pyi b/stubs/wurlitzer/wurlitzer.pyi index eee899a1e1ee..3d2a8feea576 100644 --- a/stubs/wurlitzer/wurlitzer.pyi +++ b/stubs/wurlitzer/wurlitzer.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt __all__ = ["STDOUT", "PIPE", "Wurlitzer", "pipes", "sys_pipes", "sys_pipes_forever", "stop_sys_pipes"] import contextlib @@ -29,7 +30,7 @@ class _Stream(SupportsWrite[_T_contra], Protocol): _InteractiveShell: TypeAlias = Any class Wurlitzer: - flush_interval: float + flush_interval: FloatInt encoding: str | None thread: Thread | None handle: tuple[ @@ -52,7 +53,7 @@ class Wurlitzer: self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None ) -> None: ... -def dup2(a: int, b: int, timeout: float = 3) -> int: ... +def dup2(a: int, b: int, timeout: FloatInt = 3) -> int: ... def sys_pipes(encoding: str = ..., bufsize: int | None = None) -> contextlib._GeneratorContextManager[tuple[TextIO, TextIO]]: ... # stubtest does not support overloaded context managers, hence the _GeneratorContextManager[Foo] return types. diff --git a/stubs/xlrd/xlrd/book.pyi b/stubs/xlrd/xlrd/book.pyi index 35819e83e79f..f5fda73f7589 100644 --- a/stubs/xlrd/xlrd/book.pyi +++ b/stubs/xlrd/xlrd/book.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import sys from _typeshed import SupportsWrite from collections.abc import Iterator @@ -70,8 +71,8 @@ class Book(BaseObject): style_name_map: dict[str, tuple[int, int]] colour_map: dict[int, tuple[int, int, int] | None] palette_record: list[tuple[int, int, int]] - load_time_stage_1: float - load_time_stage_2: float + load_time_stage_1: FloatInt + load_time_stage_2: FloatInt def sheets(self) -> list[Sheet]: ... def sheet_by_index(self, sheetx: int) -> Sheet: ... def __iter__(self) -> Iterator[Sheet]: ... diff --git a/stubs/xlrd/xlrd/formula.pyi b/stubs/xlrd/xlrd/formula.pyi index 4082010b5c8c..44dd7f1921a3 100644 --- a/stubs/xlrd/xlrd/formula.pyi +++ b/stubs/xlrd/xlrd/formula.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from typing import Final from .book import Book, Name @@ -48,11 +49,11 @@ okind_dict: Final[dict[int, str]] class FormulaError(Exception): ... class Operand: - value: float | str | None + value: FloatInt | str | None kind: int text: str rank: int - def __init__(self, akind: int | None = None, avalue: float | str | None = None, arank: int = 0, atext: str = "?") -> None: ... + def __init__(self, akind: int | None = None, avalue: FloatInt | str | None = None, arank: int = 0, atext: str = "?") -> None: ... class Ref3D(tuple[int, int, int, int, int, int, int, int, int, int, int, int]): coords: tuple[int, int, int, int, int, int] diff --git a/stubs/xlrd/xlrd/sheet.pyi b/stubs/xlrd/xlrd/sheet.pyi index 7aa5806dcaea..473355ea7484 100644 --- a/stubs/xlrd/xlrd/sheet.pyi +++ b/stubs/xlrd/xlrd/sheet.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import SupportsWrite from array import array from collections.abc import Callable, Generator, Sequence @@ -44,7 +45,7 @@ ctype_text: Final[dict[int, str]] class Cell(BaseObject): __slots__ = ["ctype", "value", "xf_index"] ctype: Literal[0, 1, 2, 3, 4, 5, 6] - value: str | float + value: str | FloatInt xf_index: int | None def __init__(self, ctype: Literal[0, 1, 2, 3, 4, 5, 6], value: str, xf_index: int | None = None) -> None: ... @@ -96,8 +97,8 @@ class Sheet(BaseObject): row_label_ranges: list[tuple[int, int, int, int]] merged_cells: list[tuple[int, int, int, int]] rich_text_runlist_map: dict[tuple[int, int], list[tuple[int, int]]] - defcolwidth: float | None - standardwidth: float | None + defcolwidth: FloatInt | None + standardwidth: FloatInt | None default_row_height: int | None default_row_height_mismatch: int | None default_row_hidden: int | None diff --git a/stubs/xlrd/xlrd/xldate.pyi b/stubs/xlrd/xlrd/xldate.pyi index 7940d5c20707..0ace80aad1f9 100644 --- a/stubs/xlrd/xlrd/xldate.pyi +++ b/stubs/xlrd/xlrd/xldate.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from typing import Final, Literal @@ -16,8 +17,8 @@ class XLDateBadDatemode(XLDateError): ... class XLDateBadTuple(XLDateError): ... # 0: 1900-based, 1: 1904-based. -def xldate_as_tuple(xldate: float, datemode: Literal[0, 1]) -> tuple[int, int, int, int, int, int]: ... -def xldate_as_datetime(xldate: float, datemode: Literal[0, 1]) -> datetime.datetime: ... +def xldate_as_tuple(xldate: FloatInt, datemode: Literal[0, 1]) -> tuple[int, int, int, int, int, int]: ... +def xldate_as_datetime(xldate: FloatInt, datemode: Literal[0, 1]) -> datetime.datetime: ... def _leap(y: int) -> Literal[0, 1]: ... def xldate_from_date_tuple(date_tuple: tuple[int, int, int], datemode: Literal[0, 1]) -> float: ... def xldate_from_time_tuple(time_tuple: tuple[int, int, int]) -> float: ... diff --git a/stubs/xmldiff/xmldiff/diff.pyi b/stubs/xmldiff/xmldiff/diff.pyi index 3dff61747a35..00bb30656f9d 100644 --- a/stubs/xmldiff/xmldiff/diff.pyi +++ b/stubs/xmldiff/xmldiff/diff.pyi @@ -1,16 +1,17 @@ +from _typeshed import FloatInt from _typeshed import Incomplete from collections.abc import Generator from typing import Literal class Differ: - F: float + F: FloatInt uniqueattrs: Incomplete fast_match: Incomplete best_match: Incomplete ignored_attrs: Incomplete def __init__( self, - F: float | None = None, + F: FloatInt | None = None, uniqueattrs=None, ratio_mode: Literal["accurate", "fast", "faster"] = "fast", fast_match: bool = False, diff --git a/stubs/xmldiff/xmldiff/diff_match_patch.pyi b/stubs/xmldiff/xmldiff/diff_match_patch.pyi index 476b35acc453..d862e7f432b7 100644 --- a/stubs/xmldiff/xmldiff/diff_match_patch.pyi +++ b/stubs/xmldiff/xmldiff/diff_match_patch.pyi @@ -1,11 +1,12 @@ +from _typeshed import FloatInt from _typeshed import Incomplete class diff_match_patch: - Diff_Timeout: float + Diff_Timeout: FloatInt Diff_EditCost: int - Match_Threshold: float + Match_Threshold: FloatInt Match_Distance: int - Patch_DeleteThreshold: float + Patch_DeleteThreshold: FloatInt Patch_Margin: int Match_MaxBits: int def __init__(self) -> None: ... diff --git a/stubs/xmldiff/xmldiff/main.pyi b/stubs/xmldiff/xmldiff/main.pyi index 8283095ec0bd..2bd182b46224 100644 --- a/stubs/xmldiff/xmldiff/main.pyi +++ b/stubs/xmldiff/xmldiff/main.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from argparse import ArgumentParser from collections.abc import Iterable, Mapping, Sequence from typing import Any, TypeAlias, overload @@ -62,7 +63,7 @@ def diff_files( left: str, right: str, diff_options: dict[str, Any] | None = None, formatter: None = None ) -> Iterable[_ACTIONS]: ... -def validate_F(arg: float | str) -> float: ... +def validate_F(arg: FloatInt | str) -> float: ... def make_diff_parser() -> ArgumentParser: ... def diff_command(args: Sequence[str] | None = None) -> int | None: ... def patch_tree(actions, tree): ... diff --git a/stubs/yt-dlp/yt_dlp/compat/__init__.pyi b/stubs/yt-dlp/yt_dlp/compat/__init__.pyi index 4d5f96eb63f9..a30bda112e74 100644 --- a/stubs/yt-dlp/yt_dlp/compat/__init__.pyi +++ b/stubs/yt-dlp/yt_dlp/compat/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime import urllib.request import xml.etree.ElementTree as etree @@ -8,6 +9,6 @@ class compat_HTMLParseError(ValueError): ... def compat_etree_fromstring(text: str) -> etree.Element[str]: ... def compat_ord(c: str) -> int: ... -def compat_datetime_from_timestamp(timestamp: float) -> datetime.datetime: ... +def compat_datetime_from_timestamp(timestamp: FloatInt) -> datetime.datetime: ... def compat_expanduser(path: str) -> str: ... def urllib_req_to_req(urllib_request: urllib.request.Request) -> Request: ... diff --git a/stubs/yt-dlp/yt_dlp/downloader/common.pyi b/stubs/yt-dlp/yt_dlp/downloader/common.pyi index c71cae83914b..1146fc906d0f 100644 --- a/stubs/yt-dlp/yt_dlp/downloader/common.pyi +++ b/stubs/yt-dlp/yt_dlp/downloader/common.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from _typeshed import OpenBinaryMode, OpenTextMode from collections.abc import Callable, Mapping from typing import IO, Any, AnyStr, TypedDict, type_check_only @@ -19,7 +20,7 @@ class _FileDownloaderParams(TypedDict): nopart: bool noprogress: bool noresizebuffer: bool - progress_delta: float | None + progress_delta: FloatInt | None progress_template: dict[str, str] quiet: bool ratelimit: int | None @@ -41,19 +42,19 @@ class FileDownloader: @classmethod def format_eta(cls, seconds: int | None) -> str: ... @staticmethod - def calc_percent(byte_counter: float, data_len: float | None) -> float: ... + def calc_percent(byte_counter: FloatInt, data_len: FloatInt | None) -> float: ... @staticmethod - def format_percent(percent: float | None) -> str: ... + def format_percent(percent: FloatInt | None) -> str: ... @classmethod def calc_eta( cls, start_or_rate: int | None, - now_or_remaining: float | None, + now_or_remaining: FloatInt | None, total: int | type[NO_DEFAULT] = ..., current: int | type[NO_DEFAULT] = ..., ) -> float | int | None: ... @staticmethod - def calc_speed(start: float, now: float, bytes: int) -> float | None: ... + def calc_speed(start: FloatInt, now: FloatInt, bytes: int) -> float | None: ... @staticmethod def format_speed(speed: int | None) -> str: ... @staticmethod @@ -61,8 +62,8 @@ class FileDownloader: @staticmethod def filesize_or_none(unencoded_filename: AnyStr) -> int | None: ... @staticmethod - def best_block_size(elapsed_time: float, bytes: int) -> int: ... - def slow_down(self, start_time: float, now: float, byte_counter: int) -> None: ... + def best_block_size(elapsed_time: FloatInt, bytes: int) -> int: ... + def slow_down(self, start_time: FloatInt, now: FloatInt, byte_counter: int) -> None: ... def temp_name(self, filename: str) -> str: ... def undo_temp_name(self, filename: str) -> str: ... def ytdl_filename(self, filename: str) -> str: ... diff --git a/stubs/yt-dlp/yt_dlp/extractor/common.pyi b/stubs/yt-dlp/yt_dlp/extractor/common.pyi index f086539d6a52..cb57d87c9265 100644 --- a/stubs/yt-dlp/yt_dlp/extractor/common.pyi +++ b/stubs/yt-dlp/yt_dlp/extractor/common.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import re from _typeshed import Incomplete, Unused from collections.abc import Callable, Collection, Iterable, Iterator, Mapping, Sequence @@ -400,7 +401,7 @@ class InfoExtractor: errnote: str | None = None, fatal: bool = True, tries: int = 1, - timeout: float | type[NO_DEFAULT] = ..., + timeout: FloatInt | type[NO_DEFAULT] = ..., # Remaining arguments are collected with *args, **kwargs and # forwarded to _download_webpage_handle(). encoding: str | None = ..., @@ -568,7 +569,7 @@ class InfoExtractor: def _remove_duplicate_formats(formats: list[dict[str, Any]]) -> None: ... def _is_valid_url(self, url: str, video_id: str, item: str = "video", headers: Mapping[str, Any] = {}) -> bool: ... def _proto_relative_url(self, url: str, scheme: str | None = None) -> str: ... - def _sleep(self, timeout: float, video_id: str, msg_template: str | None = None) -> None: ... + def _sleep(self, timeout: FloatInt, video_id: str, msg_template: str | None = None) -> None: ... def _extract_f4m_formats( self, manifest_url: str, @@ -873,7 +874,7 @@ class InfoExtractor: base: int | None = None, ) -> int | None: ... def _float( - self, v: Any, name: str, fatal: bool = False, *, scale: int = 1, invscale: int = 1, default: float | None = None + self, v: Any, name: str, fatal: bool = False, *, scale: int = 1, invscale: int = 1, default: FloatInt | None = None ) -> float | None: ... def _set_cookie( self, @@ -918,7 +919,7 @@ class InfoExtractor: chapter_list: Iterable[Mapping[str, Any]], start_function: Callable[..., Any], title_function: Callable[..., Any], - duration: float, + duration: FloatInt, strict: bool = True, ) -> list[dict[str, int]] | None: ... def _extract_chapters_from_description( diff --git a/stubs/yt-dlp/yt_dlp/jsinterp.pyi b/stubs/yt-dlp/yt_dlp/jsinterp.pyi index 046586574c09..2ec8009d8dcf 100644 --- a/stubs/yt-dlp/yt_dlp/jsinterp.pyi +++ b/stubs/yt-dlp/yt_dlp/jsinterp.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import collections import types from collections.abc import Callable, Collection, Iterable, Mapping @@ -10,7 +11,7 @@ from yt_dlp.utils._utils import function_with_repr from .utils import ExtractorError def int_to_int32(n: int) -> int: ... -def js_number_to_string(val: float, radix: int = 10) -> str: ... +def js_number_to_string(val: FloatInt, radix: int = 10) -> str: ... class JS_Undefined: ... diff --git a/stubs/yt-dlp/yt_dlp/networking/_helper.pyi b/stubs/yt-dlp/yt_dlp/networking/_helper.pyi index d0e48da6604a..74af6bb85415 100644 --- a/stubs/yt-dlp/yt_dlp/networking/_helper.pyi +++ b/stubs/yt-dlp/yt_dlp/networking/_helper.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import ssl from _socket import _Address from _typeshed import StrOrBytesPath @@ -35,7 +36,7 @@ _IPAddress: TypeAlias = tuple[ ] def create_socks_proxy_socket( - dest_addr: _Address, proxy_args: Mapping[str, Any], proxy_ip_addr: _IPAddress, timeout: float | None, source_address: _Address + dest_addr: _Address, proxy_args: Mapping[str, Any], proxy_ip_addr: _IPAddress, timeout: FloatInt | None, source_address: _Address ) -> sockssocket: ... def create_connection( address: tuple[str, int], diff --git a/stubs/yt-dlp/yt_dlp/networking/common.pyi b/stubs/yt-dlp/yt_dlp/networking/common.pyi index ea71e3336673..99636168fcd6 100644 --- a/stubs/yt-dlp/yt_dlp/networking/common.pyi +++ b/stubs/yt-dlp/yt_dlp/networking/common.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import abc import enum import io @@ -50,7 +51,7 @@ class RequestHandler(abc.ABC, metaclass=abc.ABCMeta): logger: _YDLLogger, headers: HTTPHeaderDict | Mapping[str, str] | None = None, cookiejar: YoutubeDLCookieJar | None = None, - timeout: float | None = None, + timeout: FloatInt | None = None, proxies: Mapping[str, Any] | None = None, source_address: str | None = None, verbose: bool = False, diff --git a/stubs/yt-dlp/yt_dlp/utils/_utils.pyi b/stubs/yt-dlp/yt_dlp/utils/_utils.pyi index 6a4c6c1ad708..675b18284ad9 100644 --- a/stubs/yt-dlp/yt_dlp/utils/_utils.pyi +++ b/stubs/yt-dlp/yt_dlp/utils/_utils.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import enum import html.parser import json @@ -277,7 +278,7 @@ def extract_timezone(date_str: str, default: Any = None) -> tuple[timedelta, str def parse_iso8601(date_str: str, delimiter: str = "T", timezone: type[NO_DEFAULT] | Any | None = None) -> int: ... def date_formats(day_first: bool = True) -> list[str]: ... def unified_strdate(date_str: str, day_first: bool = True) -> str: ... -def unified_timestamp(date_str: str, day_first: bool = True, tz_offset: float = 0) -> int: ... +def unified_timestamp(date_str: str, day_first: bool = True, tz_offset: FloatInt = 0) -> int: ... def determine_ext(url: str, default_ext: str = "unknown_video") -> str: ... def subtitles_filename(filename: str, sub_lang: str, sub_format: str, expected_real_ext: str | None = None) -> str: ... def datetime_from_str(date_str: str, precision: str = "auto", format: str = "%Y%m%d") -> datetime: ... @@ -326,7 +327,7 @@ def smuggle_url(url: str, data: Any) -> str: ... # data may be anything JSON se # default is simply returned if #__youtubedl_smuggle is present. def unsmuggle_url(smug_url: str, default: Any | None = None) -> tuple[str, Any]: ... -def format_decimal_suffix(num: float, fmt: str = "%d%s", *, factor: int = 1000) -> str: ... +def format_decimal_suffix(num: FloatInt, fmt: str = "%d%s", *, factor: int = 1000) -> str: ... def format_bytes(bytes: int) -> str: ... def lookup_unit_table(unit_table: Mapping[str, int], s: str, strict: bool = False) -> float: ... def parse_bytes(s: str) -> int: ... @@ -350,7 +351,7 @@ def int_or_none( ) -> int | None: ... def str_or_none(v: Any, default: str | None = None) -> str: ... def str_to_int(int_str: str) -> int: ... -def float_or_none(v: Any, scale: int = 1, invscale: int = 1, default: float | None = None) -> float | None: ... +def float_or_none(v: Any, scale: int = 1, invscale: int = 1, default: FloatInt | None = None) -> float | None: ... def bool_or_none(v: Any, default: bool | None = None) -> bool | None: ... def strip_or_none(v: Any, default: str | None = None) -> str | None: ... def url_or_none(url: Any) -> str | None: ... @@ -514,8 +515,8 @@ class download_range_func: def __eq__(self, other: object) -> bool: ... def parse_dfxp_time_expr(time_expr: str | None) -> int | None: ... -def srt_subtitles_timecode(seconds: float) -> str: ... -def ass_subtitles_timecode(seconds: float) -> str: ... +def srt_subtitles_timecode(seconds: FloatInt) -> str: ... +def ass_subtitles_timecode(seconds: FloatInt) -> str: ... def dfxp2srt(dfxp_data: bytes) -> str: ... def cli_option(params: _YoutubeDLOptions, command_option: str, param: str, separator: str | None = None) -> Any: ... def cli_bool_option( @@ -545,7 +546,7 @@ class GeoUtils: def long_to_bytes(n: int, blocksize: int = 0) -> bytes: ... def bytes_to_long(s: bytes) -> int: ... -def ohdave_rsa_encrypt(data: ReadableBuffer, exponent: float, modulus: float | None) -> str: ... +def ohdave_rsa_encrypt(data: ReadableBuffer, exponent: FloatInt, modulus: FloatInt | None) -> str: ... def pkcs1pad(data: Sequence[int], length: int) -> list[int]: ... def encode_base_n(num: int, n: int | None = None, table: str | None = None) -> str: ... def decode_base_n(string: str, n: int | None = None, table: str | None = None) -> int: ... @@ -578,7 +579,7 @@ def make_parent_dirs(path: PathLike[AnyStr]) -> None: ... def get_executable_path() -> str: ... def get_user_config_dirs(package_name: str) -> Iterator[str]: ... def get_system_config_dirs(package_name: str) -> Iterator[str]: ... -def time_seconds(**kwargs: float) -> int: ... +def time_seconds(**kwargs: FloatInt) -> int: ... def jwt_encode( payload_data: Any, key: str, *, alg: Literal["HS256"] = "HS256", headers: Mapping[str, Any] | None = None ) -> str: ... # payload_data and headers are passed to json.dumps(). @@ -722,7 +723,7 @@ class Popen(subprocess.Popen[AnyStr]): shell: bool = False, **kwargs: Any, # Passed to subprocess.Popen.__init__(). ) -> None: ... - def communicate_or_kill(self, input: AnyStr | None = None, timeout: float | None = None) -> tuple[AnyStr, AnyStr]: ... + def communicate_or_kill(self, input: AnyStr | None = None, timeout: FloatInt | None = None) -> tuple[AnyStr, AnyStr]: ... def kill(self, *, timeout: int = 0) -> None: ... # kwargs passed to cls.__init__(). @classmethod diff --git a/stubs/yt-dlp/yt_dlp/utils/progress.pyi b/stubs/yt-dlp/yt_dlp/utils/progress.pyi index eb1833e74b7d..342088a389a9 100644 --- a/stubs/yt-dlp/yt_dlp/utils/progress.pyi +++ b/stubs/yt-dlp/yt_dlp/utils/progress.pyi @@ -1,9 +1,10 @@ +from _typeshed import FloatInt class ProgressCalculator: SAMPLING_WINDOW: int - SAMPLING_RATE: float + SAMPLING_RATE: FloatInt GRACE_PERIOD: int downloaded: int - elapsed: float + elapsed: FloatInt speed: SmoothValue eta: SmoothValue def __init__(self, initial: int) -> None: ... @@ -17,8 +18,8 @@ class ProgressCalculator: def update(self, size: int | None) -> None: ... class SmoothValue: - value: float | None - def __init__(self, initial: float | None, smoothing: float) -> None: ... - smooth: float | None - def set(self, value: float) -> None: ... + value: FloatInt | None + def __init__(self, initial: FloatInt | None, smoothing: FloatInt) -> None: ... + smooth: FloatInt | None + def set(self, value: FloatInt) -> None: ... def reset(self) -> None: ... diff --git a/stubs/zxcvbn/zxcvbn/__init__.pyi b/stubs/zxcvbn/zxcvbn/__init__.pyi index 668d12a9b250..ea924421fc39 100644 --- a/stubs/zxcvbn/zxcvbn/__init__.pyi +++ b/stubs/zxcvbn/zxcvbn/__init__.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt import datetime from collections.abc import Iterable from decimal import Decimal @@ -11,7 +12,7 @@ from .time_estimates import _TimeEstimate class _Result(_TimeEstimate, TypedDict): password: str guesses: Decimal - guesses_log10: float + guesses_log10: FloatInt sequence: list[_Match] calc_time: datetime.timedelta feedback: _Feedback diff --git a/stubs/zxcvbn/zxcvbn/matching.pyi b/stubs/zxcvbn/zxcvbn/matching.pyi index 849b66cccab7..872bf5109f44 100644 --- a/stubs/zxcvbn/zxcvbn/matching.pyi +++ b/stubs/zxcvbn/zxcvbn/matching.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable, Mapping from decimal import Decimal from re import Pattern @@ -13,7 +14,7 @@ class _Match(TypedDict): i: int j: int guesses: NotRequired[int] # all patterns except 'date' - guesses_log10: NotRequired[float] # all patterns except 'date' + guesses_log10: NotRequired[FloatInt] # all patterns except 'date' # pattern == 'date' separator: NotRequired[str] @@ -38,7 +39,7 @@ class _Match(TypedDict): base_token: NotRequired[str] # base_guesses: NotRequired[Decimal] base_matches: NotRequired[list[Any]] # Any = _Match, https://github.com/python/mypy/issues/731 - repeat_count: NotRequired[float] + repeat_count: NotRequired[FloatInt] # pattern == 'regex' regex_name: NotRequired[str] diff --git a/stubs/zxcvbn/zxcvbn/scoring.pyi b/stubs/zxcvbn/zxcvbn/scoring.pyi index a553977c42e2..facb9ddebb4a 100644 --- a/stubs/zxcvbn/zxcvbn/scoring.pyi +++ b/stubs/zxcvbn/zxcvbn/scoring.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterable from decimal import Decimal from re import Pattern @@ -19,7 +20,7 @@ REFERENCE_YEAR: int class _GuessesResult(TypedDict): password: str guesses: int - guesses_log10: float + guesses_log10: FloatInt sequence: list[_Match] def nCk(n: int, k: int) -> float: ... @@ -34,8 +35,8 @@ def sequence_guesses(match: _Match) -> int: ... def regex_guesses(match: _Match) -> int | None: ... def date_guesses(match: _Match) -> int: ... -KEYBOARD_AVERAGE_DEGREE: float -KEYPAD_AVERAGE_DEGREE: float +KEYBOARD_AVERAGE_DEGREE: FloatInt +KEYPAD_AVERAGE_DEGREE: FloatInt KEYBOARD_STARTING_POSITIONS: int KEYPAD_STARTING_POSITIONS: int diff --git a/stubs/zxcvbn/zxcvbn/time_estimates.pyi b/stubs/zxcvbn/zxcvbn/time_estimates.pyi index f18ec53268c7..9dc396cff123 100644 --- a/stubs/zxcvbn/zxcvbn/time_estimates.pyi +++ b/stubs/zxcvbn/zxcvbn/time_estimates.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from decimal import Decimal from typing import Literal, TypedDict, type_check_only @@ -21,7 +22,7 @@ class _CrackTimesDisplay(TypedDict): offline_slow_hashing_1e4_per_second: str offline_fast_hashing_1e10_per_second: str -def estimate_attack_times(guesses: Decimal | float) -> _TimeEstimate: ... +def estimate_attack_times(guesses: Decimal | FloatInt) -> _TimeEstimate: ... def guesses_to_score(guesses: Decimal) -> Literal[0, 1, 2, 3, 4]: ... -def display_time(seconds: float) -> str: ... -def float_to_decimal(f: float) -> Decimal: ... +def display_time(seconds: FloatInt) -> str: ... +def float_to_decimal(f: FloatInt) -> Decimal: ... From 65cc5fcc8fee49d7a58b260e6e785075b9ff7443 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 15:35:28 +0000 Subject: [PATCH 02/11] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/Authlib/authlib/common/encoding.pyi | 7 +-- stubs/Authlib/authlib/jose/rfc7515/jws.pyi | 8 +-- stubs/Authlib/authlib/jose/rfc7516/jwe.pyi | 3 +- .../jose/rfc7517/_cryptography_key.pyi | 3 +- .../authlib/jose/rfc7517/asymmetric_key.pyi | 3 +- stubs/Authlib/authlib/jose/rfc7517/jwk.pyi | 12 +++-- .../Authlib/authlib/jose/rfc7518/jwe_algs.pyi | 3 +- stubs/Authlib/authlib/oauth1/rfc5849/util.pyi | 1 + .../Authlib/authlib/oidc/core/grants/util.pyi | 3 +- stubs/Authlib/authlib/oidc/core/util.pyi | 3 +- .../flask_socketio/__init__.pyi | 3 +- stubs/JACK-Client/jack/__init__.pyi | 3 +- stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi | 4 +- stubs/PyAutoGUI/pyautogui/__init__.pyi | 3 +- stubs/PyMeeus/pymeeus/Coordinates.pyi | 6 ++- stubs/PyMeeus/pymeeus/CurveFitting.pyi | 10 +++- stubs/PyMeeus/pymeeus/Epoch.pyi | 22 +++++++-- stubs/PyMeeus/pymeeus/Interpolation.pyi | 10 +++- stubs/PyMeeus/pymeeus/Minor.pyi | 1 + stubs/PyMySQL/pymysql/connections.pyi | 3 +- stubs/PyMySQL/pymysql/converters.pyi | 3 +- stubs/PyScreeze/pyscreeze/__init__.pyi | 3 +- stubs/PySocks/socks.pyi | 3 +- stubs/PySocks/sockshandler.pyi | 3 +- stubs/PyYAML/yaml/constructor.pyi | 3 +- stubs/PyYAML/yaml/representer.pyi | 3 +- stubs/Pygments/pygments/lexer.pyi | 3 +- stubs/WebOb/webob/acceptparse.pyi | 3 +- stubs/WebTest/webtest/http.pyi | 3 +- .../aws_xray_sdk/core/models/entity.pyi | 3 +- .../aws_xray_sdk/core/models/subsegment.pyi | 3 +- stubs/boltons/boltons/cacheutils.pyi | 3 +- stubs/boltons/boltons/iterutils.pyi | 3 +- stubs/boltons/boltons/socketutils.pyi | 3 +- stubs/boltons/boltons/statsutils.pyi | 7 +-- stubs/capturer/capturer.pyi | 10 ++-- stubs/cffi/cffi/api.pyi | 3 +- stubs/cffi/cffi/backend_ctypes.pyi | 3 +- stubs/channels/channels/layers.pyi | 2 +- stubs/convertdate/convertdate/daycount.pyi | 2 +- stubs/convertdate/convertdate/dublin.pyi | 2 +- stubs/convertdate/convertdate/iso.pyi | 2 +- stubs/convertdate/convertdate/julianday.pyi | 2 +- stubs/convertdate/convertdate/mayan.pyi | 3 +- stubs/convertdate/convertdate/ordinal.pyi | 1 + stubs/croniter/croniter/croniter.pyi | 3 +- stubs/dateparser/dateparser/__init__.pyi | 2 +- stubs/dateparser/dateparser/conf.pyi | 2 +- .../custom_language_detection/fasttext.pyi | 1 + .../custom_language_detection/langdetect.pyi | 1 + stubs/dateparser/dateparser/date.pyi | 3 +- stubs/docker/docker/api/container.pyi | 3 +- stubs/docker/docker/models/containers.pyi | 2 +- stubs/docker/docker/transport/npipesocket.pyi | 3 +- stubs/docker/docker/utils/utils.pyi | 3 +- stubs/docutils/docutils/nodes.pyi | 3 +- stubs/docutils/docutils/writers/manpage.pyi | 3 +- .../docutils/writers/odf_odt/__init__.pyi | 3 +- stubs/ephem/ephem/__init__.pyi | 4 +- stubs/ephem/ephem/_libastro.pyi | 11 +++-- stubs/flake8/flake8/formatting/base.pyi | 3 +- stubs/geojson/geojson/utils.pyi | 3 +- stubs/geopandas/geopandas/array.pyi | 3 +- stubs/geopandas/geopandas/base.pyi | 19 ++++--- stubs/geopandas/geopandas/geodataframe.pyi | 3 +- stubs/geopandas/geopandas/io/arrow.pyi | 3 +- stubs/geopandas/geopandas/plotting.pyi | 3 +- stubs/gevent/gevent/_ffi/loop.pyi | 3 +- stubs/gevent/gevent/_ffi/watcher.pyi | 3 +- stubs/gevent/gevent/_hub_primitives.pyi | 3 +- stubs/gevent/gevent/_types.pyi | 3 +- stubs/gevent/gevent/greenlet.pyi | 2 +- stubs/gevent/gevent/libev/corecext.pyi | 7 +-- stubs/gevent/gevent/libev/corecffi.pyi | 3 +- stubs/gevent/gevent/libuv/loop.pyi | 3 +- stubs/gevent/gevent/libuv/watcher.pyi | 1 + stubs/gevent/gevent/pywsgi.pyi | 3 +- stubs/gevent/gevent/queue.pyi | 2 +- stubs/gevent/gevent/select.pyi | 3 +- stubs/gevent/gevent/selectors.pyi | 3 +- stubs/gevent/gevent/util.pyi | 3 +- .../google/cloud/ndb/global_cache.pyi | 19 ++++--- .../google/cloud/ndb/model.pyi | 3 +- stubs/grpcio/grpc/__init__.pyi | 2 +- stubs/grpcio/grpc/aio/__init__.pyi | 3 +- stubs/gunicorn/gunicorn/ctl/client.pyi | 3 +- stubs/gunicorn/gunicorn/ctl/handlers.pyi | 3 +- stubs/gunicorn/gunicorn/dirty/client.pyi | 3 +- stubs/gunicorn/gunicorn/dirty/errors.pyi | 3 +- stubs/gunicorn/gunicorn/dirty/stash.pyi | 3 +- stubs/gunicorn/gunicorn/dirty/tlv.pyi | 3 +- stubs/gunicorn/gunicorn/http/parser.pyi | 2 +- .../gunicorn/http2/async_connection.pyi | 3 +- stubs/gunicorn/gunicorn/http2/negotiation.pyi | 2 +- stubs/gunicorn/gunicorn/instrument/statsd.pyi | 2 +- stubs/gunicorn/gunicorn/util.pyi | 3 +- stubs/gunicorn/gunicorn/workers/gthread.pyi | 3 +- stubs/hdbcli/hdbcli/dbapi.pyi | 3 +- stubs/httplib2/httplib2/__init__.pyi | 3 +- stubs/httpretty/httpretty/core.pyi | 2 +- stubs/inifile/inifile.pyi | 3 +- .../kafka-python/kafka/admin/_partitions.pyi | 3 +- stubs/kafka-python/kafka/admin/_topics.pyi | 3 +- .../kafka/admin/_transactions.pyi | 3 +- stubs/kafka-python/kafka/consumer/group.pyi | 7 +-- .../kafka/coordinator/heartbeat.pyi | 3 +- .../kafka/metrics/stats/percentiles.pyi | 3 +- .../kafka/metrics/stats/sensor.pyi | 1 + .../kafka/metrics/stats/total.pyi | 1 + stubs/kafka-python/kafka/net/connection.pyi | 3 +- stubs/kafka-python/kafka/net/transport.pyi | 3 +- stubs/kafka-python/kafka/producer/kafka.pyi | 3 +- .../kafka/producer/producer_batch.pyi | 3 +- .../kafka/producer/record_accumulator.pyi | 3 +- .../kafka/protocol/admin/client_quotas.pyi | 3 +- stubs/keyboard/keyboard/_mouse_event.pyi | 2 +- stubs/keyboard/keyboard/mouse.pyi | 2 +- stubs/ldap3/ldap3/utils/conv.pyi | 1 + stubs/m3u8/m3u8/httpclient.pyi | 2 +- stubs/m3u8/m3u8/model.pyi | 3 +- stubs/m3u8/m3u8/version_matching.pyi | 1 + stubs/mock/mock/mock.pyi | 3 +- stubs/mysqlclient/MySQLdb/times.pyi | 3 +- stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi | 3 +- .../algorithms/approximation/kcomponents.pyi | 3 +- .../algorithms/approximation/maxcut.pyi | 3 +- .../approximation/traveling_salesman.pyi | 3 +- .../algorithms/bipartite/generators.pyi | 3 +- .../centrality/current_flow_betweenness.pyi | 3 +- .../algorithms/centrality/dispersion.pyi | 1 + .../algorithms/centrality/eigenvector.pyi | 3 +- .../networkx/algorithms/centrality/katz.pyi | 3 +- .../algorithms/centrality/laplacian.pyi | 3 +- .../networkx/networkx/algorithms/chordal.pyi | 3 +- .../networkx/algorithms/community/leiden.pyi | 3 +- .../networkx/algorithms/community/louvain.pyi | 3 +- .../networkx/algorithms/community/lukes.pyi | 3 +- .../algorithms/community/modularity_max.pyi | 3 +- .../networkx/algorithms/community/quality.pyi | 3 +- .../connectivity/edge_augmentation.pyi | 3 +- .../algorithms/flow/boykovkolmogorov.pyi | 3 +- .../networkx/algorithms/flow/dinitz_alg.pyi | 3 +- .../networkx/algorithms/flow/edmondskarp.pyi | 3 +- .../networkx/algorithms/flow/preflowpush.pyi | 3 +- .../flow/shortestaugmentingpath.pyi | 3 +- .../algorithms/isomorphism/matchhelpers.pyi | 3 +- .../networkx/algorithms/isomorphism/vf2pp.pyi | 3 +- .../networkx/algorithms/link_prediction.pyi | 8 +-- .../algorithms/node_classification.pyi | 3 +- .../networkx/algorithms/planarity.pyi | 3 +- .../networkx/networkx/algorithms/richclub.pyi | 3 +- .../algorithms/shortest_paths/weighted.pyi | 10 +++- .../networkx/algorithms/similarity.pyi | 3 +- .../networkx/algorithms/sparsifiers.pyi | 3 +- .../networkx/algorithms/tree/branchings.pyi | 3 +- .../networkx/networkx/algorithms/tree/mst.pyi | 3 +- .../networkx/networkx/algorithms/vitality.pyi | 3 +- stubs/networkx/networkx/convert.pyi | 3 +- stubs/networkx/networkx/convert_matrix.pyi | 3 +- stubs/networkx/networkx/drawing/nx_pylab.pyi | 3 +- .../networkx/generators/community.pyi | 3 +- .../networkx/networkx/generators/directed.pyi | 3 +- .../networkx/generators/duplication.pyi | 3 +- stubs/networkx/networkx/generators/ego.pyi | 1 + .../networkx/generators/expanders.pyi | 3 +- .../networkx/generators/geometric.pyi | 3 +- .../generators/internet_as_graphs.pyi | 3 +- .../networkx/generators/intersection.pyi | 1 + .../networkx/networkx/generators/lattice.pyi | 7 +-- .../networkx/generators/random_graphs.pyi | 7 +-- .../generators/spectral_graph_forge.pyi | 3 +- stubs/networkx/networkx/linalg/spectrum.pyi | 1 + .../networkx/utils/random_sequence.pyi | 3 +- .../rfc6749/clients/service_application.pyi | 3 +- stubs/openpyxl/openpyxl/cell/cell.pyi | 3 +- stubs/openpyxl/openpyxl/chart/_3d.pyi | 3 +- stubs/openpyxl/openpyxl/chart/_chart.pyi | 3 +- stubs/openpyxl/openpyxl/chart/axis.pyi | 3 +- .../openpyxl/openpyxl/chart/bubble_chart.pyi | 3 +- stubs/openpyxl/openpyxl/chart/chartspace.pyi | 3 +- stubs/openpyxl/openpyxl/chart/layout.pyi | 3 +- stubs/openpyxl/openpyxl/chart/marker.pyi | 3 +- stubs/openpyxl/openpyxl/chart/pie_chart.pyi | 3 +- stubs/openpyxl/openpyxl/descriptors/base.pyi | 39 +++++++++++---- stubs/openpyxl/openpyxl/descriptors/excel.pyi | 3 +- .../openpyxl/openpyxl/descriptors/nested.pyi | 3 +- stubs/openpyxl/openpyxl/drawing/colors.pyi | 3 +- stubs/openpyxl/openpyxl/drawing/fill.pyi | 3 +- stubs/openpyxl/openpyxl/drawing/geometry.pyi | 3 +- stubs/openpyxl/openpyxl/drawing/line.pyi | 3 +- stubs/openpyxl/openpyxl/drawing/text.pyi | 3 +- stubs/openpyxl/openpyxl/styles/alignment.pyi | 3 +- stubs/openpyxl/openpyxl/styles/colors.pyi | 3 +- stubs/openpyxl/openpyxl/styles/fills.pyi | 3 +- stubs/openpyxl/openpyxl/styles/fonts.pyi | 3 +- stubs/openpyxl/openpyxl/worksheet/filters.pyi | 3 +- stubs/paramiko/paramiko/channel.pyi | 3 +- stubs/paramiko/paramiko/client.pyi | 3 +- stubs/paramiko/paramiko/common.pyi | 2 +- stubs/paramiko/paramiko/packet.pyi | 3 +- stubs/paramiko/paramiko/proxy.pyi | 3 +- stubs/paramiko/paramiko/sftp_client.pyi | 3 +- stubs/paramiko/paramiko/transport.pyi | 3 +- .../parsimonious/parsimonious/expressions.pyi | 2 +- stubs/peewee/peewee.pyi | 3 +- stubs/pexpect/pexpect/_async.pyi | 2 +- stubs/pexpect/pexpect/expect.pyi | 2 +- stubs/pexpect/pexpect/fdpexpect.pyi | 3 +- stubs/pexpect/pexpect/popen_spawn.pyi | 3 +- stubs/pexpect/pexpect/pty_spawn.pyi | 3 +- stubs/pexpect/pexpect/pxssh.pyi | 3 +- stubs/pexpect/pexpect/replwrap.pyi | 3 +- stubs/pexpect/pexpect/run.pyi | 3 +- stubs/pexpect/pexpect/spawnbase.pyi | 4 +- .../pika/pika/adapters/asyncio_connection.pyi | 3 +- .../pika/adapters/blocking_connection.pyi | 3 +- .../pika/pika/adapters/select_connection.pyi | 2 +- .../pika/adapters/utils/nbio_interface.pyi | 2 +- .../utils/selector_ioloop_adapter.pyi | 2 +- stubs/pika/pika/connection.pyi | 3 +- stubs/pony/pony/orm/dbapiprovider.pyi | 3 +- stubs/pony/pony/orm/dbproviders/sqlite.pyi | 3 +- stubs/pony/pony/utils/utils.pyi | 3 +- .../protobuf/internal/testing_refleaks.pyi | 3 +- .../protobuf/internal/well_known_types.pyi | 3 +- .../google/protobuf/internal/wire_format.pyi | 1 + stubs/psutil/psutil/__init__.pyi | 3 +- stubs/psutil/psutil/_common.pyi | 3 +- stubs/psutil/psutil/_ntuples.pyi | 3 +- stubs/psutil/psutil/_psaix.pyi | 2 +- stubs/psutil/psutil/_psbsd.pyi | 2 +- stubs/psutil/psutil/_pslinux.pyi | 2 +- stubs/psutil/psutil/_psosx.pyi | 2 +- stubs/psutil/psutil/_psposix.pyi | 3 +- stubs/psutil/psutil/_pssunos.pyi | 2 +- stubs/psutil/psutil/_pswindows.pyi | 2 +- stubs/psycopg2/psycopg2/_psycopg.pyi | 3 +- stubs/psycopg2/psycopg2/tz.pyi | 2 +- stubs/pyaudio/pyaudio.pyi | 2 +- stubs/pycups/cups.pyi | 3 +- stubs/pycurl/pycurl/_pycurl.pyi | 3 +- .../pyinstaller/PyInstaller/building/api.pyi | 3 +- stubs/pyinstaller/PyInstaller/compat.pyi | 3 +- stubs/pyluach/pyluach/dates.pyi | 2 +- stubs/pynput/pynput/_util.pyi | 3 +- stubs/pynput/pynput/keyboard/__init__.pyi | 3 +- stubs/pyogrio/pyogrio/geopandas.pyi | 2 +- stubs/pyserial/serial/__init__.pyi | 2 +- stubs/pyserial/serial/rfc2217.pyi | 3 +- stubs/pyserial/serial/rs485.pyi | 1 + stubs/pyserial/serial/serialposix.pyi | 3 +- stubs/pyserial/serial/serialutil.pyi | 3 +- .../serial/urlhandler/protocol_socket.pyi | 3 +- stubs/python-dateutil/dateutil/tz/tz.pyi | 3 +- stubs/python-jenkins/jenkins/__init__.pyi | 3 +- stubs/python-xlib/Xlib/ext/nvcontrol.pyi | 3 +- stubs/python-xlib/Xlib/ext/xinput.pyi | 10 ++-- stubs/python-xlib/Xlib/protocol/rq.pyi | 3 +- stubs/pytz/pytz/reference.pyi | 2 +- stubs/pywin32/_win32typing.pyi | 3 +- stubs/pywin32/win32/win32api.pyi | 3 +- stubs/pywin32/win32/win32gui.pyi | 3 +- stubs/pyxdg/xdg/IconTheme.pyi | 3 +- stubs/qrbill/qrbill/bill.pyi | 7 +-- .../qrcode/qrcode/image/styles/colormasks.pyi | 3 +- .../qrcode/image/styles/moduledrawers/pil.pyi | 2 +- .../qrcode/image/styles/moduledrawers/svg.pyi | 2 +- stubs/rasterio/rasterio/__init__.pyi | 2 +- stubs/rasterio/rasterio/_base.pyi | 2 +- stubs/rasterio/rasterio/_io.pyi | 2 +- stubs/rasterio/rasterio/features.pyi | 2 +- stubs/rasterio/rasterio/io.pyi | 2 +- stubs/rasterio/rasterio/mask.pyi | 2 +- stubs/rasterio/rasterio/merge.pyi | 2 +- stubs/rasterio/rasterio/plot.pyi | 2 +- stubs/rasterio/rasterio/stack.pyi | 2 +- stubs/rasterio/rasterio/transform.pyi | 7 +-- stubs/rasterio/rasterio/warp.pyi | 3 +- stubs/rasterio/rasterio/windows.pyi | 4 +- stubs/ratelimit/ratelimit/exception.pyi | 1 + stubs/regex/regex/_main.pyi | 3 +- .../reportlab/graphics/barcode/code39.pyi | 3 +- .../reportlab/graphics/barcode/common.pyi | 3 +- .../reportlab/graphics/barcode/lto.pyi | 3 +- .../reportlab/graphics/charts/axes.pyi | 3 +- .../reportlab/graphics/charts/barcharts.pyi | 3 +- .../reportlab/graphics/charts/dotbox.pyi | 3 +- .../reportlab/graphics/charts/legends.pyi | 3 +- .../reportlab/graphics/charts/linecharts.pyi | 3 +- .../reportlab/graphics/charts/lineplots.pyi | 3 +- .../reportlab/graphics/charts/piecharts.pyi | 3 +- .../reportlab/graphics/charts/slidebox.pyi | 3 +- .../reportlab/graphics/charts/spider.pyi | 3 +- .../reportlab/graphics/charts/utils.pyi | 7 +-- .../reportlab/graphics/charts/utils3d.pyi | 3 +- .../reportlab/graphics/renderPDF.pyi | 3 +- .../reportlab/reportlab/graphics/renderPM.pyi | 11 +++-- .../reportlab/reportlab/graphics/renderPS.pyi | 3 +- .../reportlab/graphics/renderSVG.pyi | 3 +- stubs/reportlab/reportlab/graphics/shapes.pyi | 29 ++++++++--- .../reportlab/graphics/transform.pyi | 1 + .../reportlab/graphics/widgetbase.pyi | 3 +- .../graphics/widgets/signsandsymbols.pyi | 3 +- .../reportlab/graphics/widgets/table.pyi | 3 +- stubs/reportlab/reportlab/lib/colors.pyi | 4 +- stubs/reportlab/reportlab/lib/corp.pyi | 3 +- stubs/reportlab/reportlab/lib/rl_accel.pyi | 3 +- stubs/reportlab/reportlab/lib/styles.pyi | 3 +- stubs/reportlab/reportlab/lib/testutils.pyi | 3 +- stubs/reportlab/reportlab/lib/textsplit.pyi | 3 +- stubs/reportlab/reportlab/lib/utils.pyi | 3 +- .../reportlab/reportlab/pdfbase/acroform.pyi | 3 +- .../reportlab/pdfbase/pdfmetrics.pyi | 3 +- stubs/reportlab/reportlab/pdfbase/ttfonts.pyi | 3 +- stubs/reportlab/reportlab/pdfgen/canvas.pyi | 49 +++++++++++++++---- .../reportlab/reportlab/pdfgen/textobject.pyi | 11 +++-- .../reportlab/platypus/doctemplate.pyi | 3 +- .../reportlab/platypus/flowables.pyi | 3 +- stubs/reportlab/reportlab/platypus/para.pyi | 3 +- .../reportlab/platypus/paragraph.pyi | 1 + .../reportlab/platypus/tableofcontents.pyi | 3 +- stubs/reportlab/reportlab/platypus/tables.pyi | 7 +-- .../reportlab/platypus/xpreformatted.pyi | 1 + stubs/reportlab/reportlab/rl_config.pyi | 3 +- stubs/reportlab/reportlab/rl_settings.pyi | 3 +- stubs/requests/requests/adapters.pyi | 3 +- stubs/requests/requests/sessions.pyi | 3 +- stubs/retry/retry/api.pyi | 3 +- stubs/seaborn/seaborn/_core/moves.pyi | 3 +- stubs/seaborn/seaborn/_core/plot.pyi | 3 +- stubs/seaborn/seaborn/_core/properties.pyi | 3 +- stubs/seaborn/seaborn/_core/scales.pyi | 3 +- stubs/seaborn/seaborn/_core/typing.pyi | 3 +- stubs/seaborn/seaborn/_marks/base.pyi | 3 +- stubs/seaborn/seaborn/axisgrid.pyi | 3 +- stubs/seaborn/seaborn/matrix.pyi | 3 +- stubs/seaborn/seaborn/palettes.pyi | 6 ++- stubs/seaborn/seaborn/rcmod.pyi | 8 +-- stubs/seaborn/seaborn/regression.pyi | 3 +- stubs/seaborn/seaborn/utils.pyi | 3 +- stubs/setuptools/setuptools/msvc.pyi | 2 +- stubs/shapely/shapely/_coverage.pyi | 4 +- stubs/shapely/shapely/_geometry.pyi | 3 +- stubs/shapely/shapely/_ragged_array.pyi | 1 + stubs/shapely/shapely/affinity.pyi | 4 +- .../shapely/shapely/algorithms/polylabel.pyi | 1 + stubs/shapely/shapely/constructive.pyi | 34 +++++++++---- stubs/shapely/shapely/creation.pyi | 4 +- stubs/shapely/shapely/geometry/base.pyi | 3 +- stubs/shapely/shapely/measurement.pyi | 8 ++- stubs/shapely/shapely/predicates.pyi | 8 ++- stubs/shapely/shapely/set_operations.pyi | 8 ++- stubs/shapely/shapely/strtree.pyi | 3 +- stubs/shapely/shapely/testing.pyi | 1 + .../simple_websocket/aiows.pyi | 3 +- .../simple-websocket/simple_websocket/ws.pyi | 3 +- stubs/tensorflow/tensorflow/__init__.pyi | 3 +- stubs/tensorflow/tensorflow/_aliases.pyi | 2 +- .../tensorflow/feature_column/__init__.pyi | 4 +- .../tensorflow/keras/layers/__init__.pyi | 3 +- stubs/tensorflow/tensorflow/keras/losses.pyi | 6 ++- stubs/tensorflow/tensorflow/keras/metrics.pyi | 7 +-- stubs/tensorflow/tensorflow/keras/models.pyi | 3 +- .../keras/optimizers/legacy/__init__.pyi | 7 ++- .../feature_column/feature_column_v2.pyi | 4 +- stubs/tensorflow/tensorflow/summary.pyi | 6 ++- stubs/tinycss2/tinycss2/ast.pyi | 4 +- stubs/tqdm/tqdm/_monitor.pyi | 3 +- stubs/tqdm/tqdm/asyncio.pyi | 3 +- stubs/tqdm/tqdm/contrib/concurrent.pyi | 3 +- stubs/tqdm/tqdm/contrib/discord.pyi | 3 +- stubs/tqdm/tqdm/contrib/slack.pyi | 3 +- stubs/tqdm/tqdm/contrib/telegram.pyi | 3 +- stubs/tqdm/tqdm/gui.pyi | 3 +- stubs/tqdm/tqdm/notebook.pyi | 3 +- stubs/tqdm/tqdm/rich.pyi | 3 +- stubs/tqdm/tqdm/std.pyi | 3 +- stubs/tqdm/tqdm/tk.pyi | 3 +- stubs/ttkthemes/ttkthemes/_widget.pyi | 3 +- stubs/ttkthemes/ttkthemes/themed_tk.pyi | 2 +- stubs/uWSGI/uwsgi.pyi | 3 +- stubs/vobject/vobject/icalendar.pyi | 3 +- stubs/waitress/waitress/wasyncore.pyi | 3 +- .../workalendar/skyfield_astronomy.pyi | 3 +- stubs/wurlitzer/wurlitzer.pyi | 1 + stubs/xlrd/xlrd/book.pyi | 3 +- stubs/xlrd/xlrd/formula.pyi | 4 +- stubs/xlrd/xlrd/sheet.pyi | 3 +- stubs/xlrd/xlrd/xldate.pyi | 2 +- stubs/xmldiff/xmldiff/diff.pyi | 3 +- stubs/xmldiff/xmldiff/diff_match_patch.pyi | 3 +- stubs/yt-dlp/yt_dlp/compat/__init__.pyi | 2 +- stubs/yt-dlp/yt_dlp/downloader/common.pyi | 3 +- stubs/yt-dlp/yt_dlp/extractor/common.pyi | 3 +- stubs/yt-dlp/yt_dlp/jsinterp.pyi | 2 +- stubs/yt-dlp/yt_dlp/networking/_helper.pyi | 9 ++-- stubs/yt-dlp/yt_dlp/networking/common.pyi | 3 +- stubs/yt-dlp/yt_dlp/utils/_utils.pyi | 2 +- stubs/yt-dlp/yt_dlp/utils/progress.pyi | 1 + stubs/zxcvbn/zxcvbn/__init__.pyi | 2 +- 400 files changed, 721 insertions(+), 739 deletions(-) diff --git a/stubs/Authlib/authlib/common/encoding.pyi b/stubs/Authlib/authlib/common/encoding.pyi index b6dc13a226a1..2389f9da22b8 100644 --- a/stubs/Authlib/authlib/common/encoding.pyi +++ b/stubs/Authlib/authlib/common/encoding.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from collections.abc import Iterable from typing import Any, SupportsBytes, SupportsIndex, overload @@ -22,7 +21,9 @@ def json_loads(s: str | bytes | bytearray) -> Any: ... # returns json.loads() def json_dumps(data: Any, ensure_ascii: bool = False) -> str: ... # data pass to json.dumps() def urlsafe_b64decode(s: bytes | bytearray) -> bytes: ... def urlsafe_b64encode(s: ReadableBuffer) -> bytes: ... -def base64_to_int(s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer) -> int: ... +def base64_to_int( + s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, +) -> int: ... def int_to_base64(num: int) -> str: ... def json_b64encode( text: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, diff --git a/stubs/Authlib/authlib/jose/rfc7515/jws.pyi b/stubs/Authlib/authlib/jose/rfc7515/jws.pyi index bb0b0671a915..6304815862c4 100644 --- a/stubs/Authlib/authlib/jose/rfc7515/jws.pyi +++ b/stubs/Authlib/authlib/jose/rfc7515/jws.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections.abc import Iterable from typing import SupportsBytes, SupportsIndex @@ -14,7 +13,10 @@ class JsonWebSignature: def register_algorithm(cls, algorithm: JWSAlgorithm) -> None: ... def serialize_compact(self, protected, payload, key) -> bytes: ... def deserialize_compact( - self, s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, key, decode=None + self, + s: str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, + key, + decode=None, ) -> JWSObject: ... def serialize_json(self, header_obj, payload, key) -> dict[str, Incomplete]: ... def deserialize_json(self, obj, key, decode=None) -> JWSObject: ... diff --git a/stubs/Authlib/authlib/jose/rfc7516/jwe.pyi b/stubs/Authlib/authlib/jose/rfc7516/jwe.pyi index 4131deddbf98..397bb9bef7d2 100644 --- a/stubs/Authlib/authlib/jose/rfc7516/jwe.pyi +++ b/stubs/Authlib/authlib/jose/rfc7516/jwe.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections import OrderedDict from collections.abc import Iterable from typing import SupportsBytes, SupportsIndex diff --git a/stubs/Authlib/authlib/jose/rfc7517/_cryptography_key.pyi b/stubs/Authlib/authlib/jose/rfc7517/_cryptography_key.pyi index 0338cfa808d2..54763488828d 100644 --- a/stubs/Authlib/authlib/jose/rfc7517/_cryptography_key.pyi +++ b/stubs/Authlib/authlib/jose/rfc7517/_cryptography_key.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from collections.abc import Iterable from typing import Literal, SupportsBytes, SupportsIndex, overload diff --git a/stubs/Authlib/authlib/jose/rfc7517/asymmetric_key.pyi b/stubs/Authlib/authlib/jose/rfc7517/asymmetric_key.pyi index 77ebc0da5d93..c0b23a0b6ed2 100644 --- a/stubs/Authlib/authlib/jose/rfc7517/asymmetric_key.pyi +++ b/stubs/Authlib/authlib/jose/rfc7517/asymmetric_key.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections.abc import Iterable from typing import ClassVar, Literal, SupportsBytes, SupportsIndex from typing_extensions import Self diff --git a/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi b/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi index 10015204f725..a88acd7e09cc 100644 --- a/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi +++ b/stubs/Authlib/authlib/jose/rfc7517/jwk.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections.abc import Collection, Iterable, Mapping from typing import SupportsBytes, SupportsIndex @@ -13,7 +12,14 @@ class JsonWebKey: def import_key( cls, raw: ( - str | bytes | FloatInt | Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer | Mapping[str, object] + str + | bytes + | FloatInt + | Iterable[SupportsIndex] + | SupportsIndex + | SupportsBytes + | ReadableBuffer + | Mapping[str, object] ), options: Mapping[str, object] | None = None, ) -> Key: ... diff --git a/stubs/Authlib/authlib/jose/rfc7518/jwe_algs.pyi b/stubs/Authlib/authlib/jose/rfc7518/jwe_algs.pyi index e5a2734b551f..4568c8b12f75 100644 --- a/stubs/Authlib/authlib/jose/rfc7518/jwe_algs.pyi +++ b/stubs/Authlib/authlib/jose/rfc7518/jwe_algs.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections.abc import Iterable from typing import ClassVar, Final, SupportsBytes, SupportsIndex diff --git a/stubs/Authlib/authlib/oauth1/rfc5849/util.pyi b/stubs/Authlib/authlib/oauth1/rfc5849/util.pyi index 929f9883b577..3700bd606ec4 100644 --- a/stubs/Authlib/authlib/oauth1/rfc5849/util.pyi +++ b/stubs/Authlib/authlib/oauth1/rfc5849/util.pyi @@ -1,3 +1,4 @@ from _typeshed import FloatInt + def escape(s: str | bytes | FloatInt) -> str: ... def unescape(s: str | bytes) -> str: ... diff --git a/stubs/Authlib/authlib/oidc/core/grants/util.pyi b/stubs/Authlib/authlib/oidc/core/grants/util.pyi index eb0a932b7cdf..d8d719deafaf 100644 --- a/stubs/Authlib/authlib/oidc/core/grants/util.pyi +++ b/stubs/Authlib/authlib/oidc/core/grants/util.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from collections.abc import Collection, Iterable from typing import Literal, SupportsBytes, SupportsIndex, overload diff --git a/stubs/Authlib/authlib/oidc/core/util.pyi b/stubs/Authlib/authlib/oidc/core/util.pyi index 0f526d400857..be2b22df673e 100644 --- a/stubs/Authlib/authlib/oidc/core/util.pyi +++ b/stubs/Authlib/authlib/oidc/core/util.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from collections.abc import Iterable from typing import SupportsBytes, SupportsIndex diff --git a/stubs/Flask-SocketIO/flask_socketio/__init__.pyi b/stubs/Flask-SocketIO/flask_socketio/__init__.pyi index af20fae6d1da..55d3edb38e01 100644 --- a/stubs/Flask-SocketIO/flask_socketio/__init__.pyi +++ b/stubs/Flask-SocketIO/flask_socketio/__init__.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from logging import Logger from threading import Thread diff --git a/stubs/JACK-Client/jack/__init__.pyi b/stubs/JACK-Client/jack/__init__.pyi index 5d24fedede55..80002d292576 100644 --- a/stubs/JACK-Client/jack/__init__.pyi +++ b/stubs/JACK-Client/jack/__init__.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Callable, Generator, Iterable, Iterator, Sequence from typing import Any, Final, Literal, overload, type_check_only from typing_extensions import Never, Self diff --git a/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi b/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi index 34f95ce6f0f9..157f901bad58 100644 --- a/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi +++ b/stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi @@ -14,5 +14,7 @@ def remove_edge_detect(chip_name: str, channel: int, timeout: FloatInt = 0.3) -> def add_edge_callback(chip_name: str, channel: int, callback: Callable[[int], None]) -> None: ... def edge_event_detected(chip_name: str, channel: int) -> bool: ... def gpio_event_added(chip_name: str, channel: int) -> Any: ... -def blocking_wait_for_edge(chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, timeout: FloatInt) -> int: ... +def blocking_wait_for_edge( + chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, timeout: FloatInt +) -> int: ... def event_cleanup(chip_name: str, channel: int) -> None: ... diff --git a/stubs/PyAutoGUI/pyautogui/__init__.pyi b/stubs/PyAutoGUI/pyautogui/__init__.pyi index a783554416db..b27cbfd799d3 100644 --- a/stubs/PyAutoGUI/pyautogui/__init__.pyi +++ b/stubs/PyAutoGUI/pyautogui/__init__.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import contextlib -from _typeshed import ConvertibleToInt +from _typeshed import ConvertibleToInt, FloatInt from collections.abc import Callable, Iterable, Sequence from datetime import datetime from typing import Final, NamedTuple, ParamSpec, SupportsIndex, SupportsInt, TypeAlias, TypeVar diff --git a/stubs/PyMeeus/pymeeus/Coordinates.pyi b/stubs/PyMeeus/pymeeus/Coordinates.pyi index 775702319852..774c902a362f 100644 --- a/stubs/PyMeeus/pymeeus/Coordinates.pyi +++ b/stubs/PyMeeus/pymeeus/Coordinates.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from typing import Final, overload from pymeeus.Angle import Angle @@ -190,7 +190,9 @@ def velocity(r: FloatInt, a: FloatInt) -> float: ... def velocity_perihelion(e: FloatInt, a: FloatInt) -> float: ... def velocity_aphelion(e: FloatInt, a: FloatInt) -> float: ... def length_orbit(e: FloatInt, a: FloatInt) -> float: ... -def passage_nodes_elliptic(omega: Angle, e: FloatInt, a: FloatInt, t: Epoch, ascending: bool | None = True) -> tuple[Epoch, float]: ... +def passage_nodes_elliptic( + omega: Angle, e: FloatInt, a: FloatInt, t: Epoch, ascending: bool | None = True +) -> tuple[Epoch, float]: ... def passage_nodes_parabolic(omega: Angle, q: FloatInt, t: Epoch, ascending: bool | None = True) -> tuple[Epoch, float]: ... def phase_angle(sun_dist: FloatInt, earth_dist: FloatInt, sun_earth_dist: FloatInt) -> Angle: ... def illuminated_fraction(sun_dist: FloatInt, earth_dist: FloatInt, sun_earth_dist: FloatInt) -> float: ... diff --git a/stubs/PyMeeus/pymeeus/CurveFitting.pyi b/stubs/PyMeeus/pymeeus/CurveFitting.pyi index fb886229a3e9..927b547a2647 100644 --- a/stubs/PyMeeus/pymeeus/CurveFitting.pyi +++ b/stubs/PyMeeus/pymeeus/CurveFitting.pyi @@ -13,7 +13,10 @@ class CurveFitting: def __init__(self, a: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], /) -> None: ... @overload def __init__( - self, a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], / + self, + a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], + a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], + /, ) -> None: ... @overload def __init__( @@ -28,7 +31,10 @@ class CurveFitting: def set(self, a: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], /) -> None: ... @overload def set( - self, a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], / + self, + a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], + a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], + /, ) -> None: ... @overload def set( diff --git a/stubs/PyMeeus/pymeeus/Epoch.pyi b/stubs/PyMeeus/pymeeus/Epoch.pyi index 6e481ace54d1..8d82ffa1ddb7 100644 --- a/stubs/PyMeeus/pymeeus/Epoch.pyi +++ b/stubs/PyMeeus/pymeeus/Epoch.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from typing import Final, Literal, overload from typing_extensions import Self @@ -15,7 +15,15 @@ class Epoch: def __init__(self) -> None: ... @overload def __init__( - self, year: int, month: int, day: int, /, *time: FloatInt, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False + self, + year: int, + month: int, + day: int, + /, + *time: FloatInt, + leap_seconds: FloatInt = 0, + local: bool = False, + utc: bool = False, ) -> None: ... @overload def __init__( @@ -34,7 +42,15 @@ class Epoch: def set(self) -> None: ... @overload def set( - self, year: int, month: int, day: int, /, *time: FloatInt, leap_seconds: FloatInt = 0, local: bool = False, utc: bool = False + self, + year: int, + month: int, + day: int, + /, + *time: FloatInt, + leap_seconds: FloatInt = 0, + local: bool = False, + utc: bool = False, ) -> None: ... @overload def set( diff --git a/stubs/PyMeeus/pymeeus/Interpolation.pyi b/stubs/PyMeeus/pymeeus/Interpolation.pyi index 6c764c40c7ef..cc5015d3ebdf 100644 --- a/stubs/PyMeeus/pymeeus/Interpolation.pyi +++ b/stubs/PyMeeus/pymeeus/Interpolation.pyi @@ -12,7 +12,10 @@ class Interpolation: def __init__(self, a: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], /) -> None: ... @overload def __init__( - self, a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], / + self, + a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], + a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], + /, ) -> None: ... @overload def __init__( @@ -27,7 +30,10 @@ class Interpolation: def set(self, a: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], /) -> None: ... @overload def set( - self, a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], / + self, + a1: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], + a2: list[FloatInt | Angle] | tuple[FloatInt | Angle, ...], + /, ) -> None: ... @overload def set( diff --git a/stubs/PyMeeus/pymeeus/Minor.pyi b/stubs/PyMeeus/pymeeus/Minor.pyi index 1c72743eeb55..87874e9e484d 100644 --- a/stubs/PyMeeus/pymeeus/Minor.pyi +++ b/stubs/PyMeeus/pymeeus/Minor.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from pymeeus.Angle import Angle from pymeeus.Epoch import Epoch diff --git a/stubs/PyMySQL/pymysql/connections.pyi b/stubs/PyMySQL/pymysql/connections.pyi index 27f949108696..052c0fa3134e 100644 --- a/stubs/PyMySQL/pymysql/connections.pyi +++ b/stubs/PyMySQL/pymysql/connections.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from collections.abc import Callable from socket import _Address, socket as _socket from ssl import SSLContext, _PasswordType diff --git a/stubs/PyMySQL/pymysql/converters.pyi b/stubs/PyMySQL/pymysql/converters.pyi index 6a6f715f3f5f..ba4e73dafbfb 100644 --- a/stubs/PyMySQL/pymysql/converters.pyi +++ b/stubs/PyMySQL/pymysql/converters.pyi @@ -1,8 +1,7 @@ -from _typeshed import FloatInt import datetime import re import time -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Callable, Mapping, Sequence from decimal import Decimal from typing import Any, TypeAlias, TypeVar diff --git a/stubs/PyScreeze/pyscreeze/__init__.pyi b/stubs/PyScreeze/pyscreeze/__init__.pyi index 8c4a17527def..3a0ba12332a8 100644 --- a/stubs/PyScreeze/pyscreeze/__init__.pyi +++ b/stubs/PyScreeze/pyscreeze/__init__.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import ConvertibleToFloat, Incomplete, StrOrBytesPath, Unused +from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, StrOrBytesPath, Unused from collections.abc import Callable, Generator from typing import Final, NamedTuple, ParamSpec, TypeAlias, TypeVar, overload diff --git a/stubs/PySocks/socks.pyi b/stubs/PySocks/socks.pyi index 859c58e506b0..7954aff0476a 100644 --- a/stubs/PySocks/socks.pyi +++ b/stubs/PySocks/socks.pyi @@ -1,8 +1,7 @@ -from _typeshed import FloatInt import logging import socket import types -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from collections.abc import Callable, Iterable, Mapping from typing import Final, ParamSpec, TypeAlias, TypeVar, overload diff --git a/stubs/PySocks/sockshandler.pyi b/stubs/PySocks/sockshandler.pyi index ecfec5b3ec42..4a549ebe0662 100644 --- a/stubs/PySocks/sockshandler.pyi +++ b/stubs/PySocks/sockshandler.pyi @@ -1,9 +1,8 @@ -from _typeshed import FloatInt import http.client import ssl import sys import urllib.request -from _typeshed import Incomplete, SupportsKeysAndGetItem +from _typeshed import FloatInt, Incomplete, SupportsKeysAndGetItem from typing import Any, TypeVar import socks diff --git a/stubs/PyYAML/yaml/constructor.pyi b/stubs/PyYAML/yaml/constructor.pyi index 8cc459261099..64b2c1f47408 100644 --- a/stubs/PyYAML/yaml/constructor.pyi +++ b/stubs/PyYAML/yaml/constructor.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Generator, Hashable from datetime import date from re import Pattern diff --git a/stubs/PyYAML/yaml/representer.pyi b/stubs/PyYAML/yaml/representer.pyi index 5ba96089c91d..61ff07ab5f90 100644 --- a/stubs/PyYAML/yaml/representer.pyi +++ b/stubs/PyYAML/yaml/representer.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime -from _typeshed import Incomplete, ReadableBuffer, SupportsItems +from _typeshed import FloatInt, Incomplete, ReadableBuffer, SupportsItems from collections.abc import Callable, Iterable, Mapping from types import BuiltinFunctionType, FunctionType, ModuleType from typing import ClassVar, TypeVar diff --git a/stubs/Pygments/pygments/lexer.pyi b/stubs/Pygments/pygments/lexer.pyi index 9f6c9d5be4bc..c8630e352e69 100644 --- a/stubs/Pygments/pygments/lexer.pyi +++ b/stubs/Pygments/pygments/lexer.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable, Iterator, Sequence from re import Pattern, RegexFlag from typing import ClassVar, Final diff --git a/stubs/WebOb/webob/acceptparse.pyi b/stubs/WebOb/webob/acceptparse.pyi index b94ead8b8194..4b77badf04e8 100644 --- a/stubs/WebOb/webob/acceptparse.pyi +++ b/stubs/WebOb/webob/acceptparse.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsItems +from _typeshed import FloatInt, SupportsItems from collections.abc import Callable, Iterable, Iterator, Sequence from typing import Any, Literal, NamedTuple, Protocol, TypeAlias, TypeVar, overload, type_check_only from typing_extensions import Self diff --git a/stubs/WebTest/webtest/http.pyi b/stubs/WebTest/webtest/http.pyi index f988a2910135..ee1e71fd62fe 100644 --- a/stubs/WebTest/webtest/http.pyi +++ b/stubs/WebTest/webtest/http.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from _typeshed.wsgi import StartResponse, WSGIApplication, WSGIEnvironment from collections.abc import Iterable from threading import Thread diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi index 559f3a0bb1dc..91ea3867865d 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/entity.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from logging import Logger from traceback import StackSummary from typing import Any, Final, Literal, overload diff --git a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi index 41b69bdcd06b..72c70cede7b0 100644 --- a/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi +++ b/stubs/aws-xray-sdk/aws_xray_sdk/core/models/subsegment.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from types import TracebackType from typing import Final diff --git a/stubs/boltons/boltons/cacheutils.pyi b/stubs/boltons/boltons/cacheutils.pyi index 56c2e71d97c8..b2d8a62bc02a 100644 --- a/stubs/boltons/boltons/cacheutils.pyi +++ b/stubs/boltons/boltons/cacheutils.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import weakref -from _typeshed import Incomplete, SupportsItems, SupportsKeysAndGetItem +from _typeshed import FloatInt, Incomplete, SupportsItems, SupportsKeysAndGetItem from collections.abc import Callable, Generator, Hashable, Iterable, Iterator, Mapping from typing import Any, Generic, TypeVar, overload from typing_extensions import Self diff --git a/stubs/boltons/boltons/iterutils.pyi b/stubs/boltons/boltons/iterutils.pyi index cc8843107d30..0261d97c4d2d 100644 --- a/stubs/boltons/boltons/iterutils.pyi +++ b/stubs/boltons/boltons/iterutils.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Generator, Iterable from typing import TypeVar from typing_extensions import TypeIs diff --git a/stubs/boltons/boltons/socketutils.pyi b/stubs/boltons/boltons/socketutils.pyi index 24ea87c5e144..ec855e27b65a 100644 --- a/stubs/boltons/boltons/socketutils.pyi +++ b/stubs/boltons/boltons/socketutils.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import socket -from _typeshed import ReadableBuffer, SliceableBuffer +from _typeshed import FloatInt, ReadableBuffer, SliceableBuffer DEFAULT_TIMEOUT: int DEFAULT_MAXSIZE: int diff --git a/stubs/boltons/boltons/statsutils.pyi b/stubs/boltons/boltons/statsutils.pyi index 998c174bbaee..a6a8d57226cc 100644 --- a/stubs/boltons/boltons/statsutils.pyi +++ b/stubs/boltons/boltons/statsutils.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, Incomplete +from _typeshed import ConvertibleToFloat, FloatInt, Incomplete from collections.abc import Callable, Iterable, Iterator from typing import Any, Literal, overload from typing_extensions import Self @@ -21,7 +20,9 @@ class Stats: default: FloatInt @overload - def __init__(self, data: list[FloatInt], default: FloatInt = 0.0, *, use_copy: Literal[False], is_sorted: bool = False) -> None: ... + def __init__( + self, data: list[FloatInt], default: FloatInt = 0.0, *, use_copy: Literal[False], is_sorted: bool = False + ) -> None: ... @overload def __init__(self, data: list[FloatInt], default: FloatInt, use_copy: Literal[False], is_sorted: bool = False) -> None: ... @overload diff --git a/stubs/capturer/capturer.pyi b/stubs/capturer/capturer.pyi index c1201eafb849..249a96f9b2e3 100644 --- a/stubs/capturer/capturer.pyi +++ b/stubs/capturer/capturer.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptorOrPath, SupportsWrite +from _typeshed import FileDescriptorOrPath, FloatInt, SupportsWrite from collections.abc import Callable from io import BufferedReader from multiprocessing import Process @@ -46,7 +45,12 @@ class CaptureOutput(MultiProcessHelper): stdout: PseudoTerminal stderr: PseudoTerminal def __init__( - self, merged: bool = True, encoding: str = ..., termination_delay: FloatInt = ..., chunk_size: int = 1024, relay: bool = True + self, + merged: bool = True, + encoding: str = ..., + termination_delay: FloatInt = ..., + chunk_size: int = 1024, + relay: bool = True, ) -> None: ... def initialize_stream(self, file_obj: IO[str], expected_fd: int) -> Stream: ... def __enter__(self) -> Self: ... diff --git a/stubs/cffi/cffi/api.pyi b/stubs/cffi/cffi/api.pyi index 962f62c1d1ab..d375e2725587 100644 --- a/stubs/cffi/cffi/api.pyi +++ b/stubs/cffi/cffi/api.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import sys import types -from _typeshed import ReadableBuffer, WriteableBuffer +from _typeshed import FloatInt, ReadableBuffer, WriteableBuffer from collections.abc import Callable, Hashable from typing import Any, Literal, TypeAlias, TypeVar, overload diff --git a/stubs/cffi/cffi/backend_ctypes.pyi b/stubs/cffi/cffi/backend_ctypes.pyi index d25d98ad50c5..05bc691de3e3 100644 --- a/stubs/cffi/cffi/backend_ctypes.pyi +++ b/stubs/cffi/cffi/backend_ctypes.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable unicode = str diff --git a/stubs/channels/channels/layers.pyi b/stubs/channels/channels/layers.pyi index b5a0bc899f14..d71f24d4c73b 100644 --- a/stubs/channels/channels/layers.pyi +++ b/stubs/channels/channels/layers.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import asyncio +from _typeshed import FloatInt from re import Pattern from typing import Any, ClassVar, TypeAlias, overload from typing_extensions import deprecated diff --git a/stubs/convertdate/convertdate/daycount.pyi b/stubs/convertdate/convertdate/daycount.pyi index 91c4a79445b4..b6ea2ca4bb67 100644 --- a/stubs/convertdate/convertdate/daycount.pyi +++ b/stubs/convertdate/convertdate/daycount.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt class DayCount: epoch: FloatInt diff --git a/stubs/convertdate/convertdate/dublin.pyi b/stubs/convertdate/convertdate/dublin.pyi index 8cd00824037a..f527f1ba8032 100644 --- a/stubs/convertdate/convertdate/dublin.pyi +++ b/stubs/convertdate/convertdate/dublin.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from typing import Final EPOCH: Final = 2415020 diff --git a/stubs/convertdate/convertdate/iso.pyi b/stubs/convertdate/convertdate/iso.pyi index 3be29604554d..c2cfcf4b6ddd 100644 --- a/stubs/convertdate/convertdate/iso.pyi +++ b/stubs/convertdate/convertdate/iso.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from typing import Final, Literal MON: Final = 0 diff --git a/stubs/convertdate/convertdate/julianday.pyi b/stubs/convertdate/convertdate/julianday.pyi index 887fa4705232..6061865dc5c6 100644 --- a/stubs/convertdate/convertdate/julianday.pyi +++ b/stubs/convertdate/convertdate/julianday.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt def to_datetime(jdc: FloatInt) -> datetime.datetime: ... def from_datetime(dt: datetime.datetime) -> float: ... diff --git a/stubs/convertdate/convertdate/mayan.pyi b/stubs/convertdate/convertdate/mayan.pyi index 78a927026e02..43ae1981291c 100644 --- a/stubs/convertdate/convertdate/mayan.pyi +++ b/stubs/convertdate/convertdate/mayan.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Generator from typing import Final, Literal, overload from typing_extensions import Never diff --git a/stubs/convertdate/convertdate/ordinal.pyi b/stubs/convertdate/convertdate/ordinal.pyi index 93829d2dfffe..0e5bc106bbb8 100644 --- a/stubs/convertdate/convertdate/ordinal.pyi +++ b/stubs/convertdate/convertdate/ordinal.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + def to_jd(year: int, dayofyear: int) -> float: ... def from_jd(jd: FloatInt) -> tuple[int, int]: ... def from_gregorian(year: int, month: int, day: int) -> tuple[int, int]: ... diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index 2bdc3acbcfe0..8f0119cb1d6f 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Generator, Iterable from re import Match, Pattern from typing import Any, Final, Generic, Literal, Protocol, TypeAlias, TypeVar, overload, type_check_only diff --git a/stubs/dateparser/dateparser/__init__.pyi b/stubs/dateparser/dateparser/__init__.pyi index 4d6ea4e6fc18..66f95d19e928 100644 --- a/stubs/dateparser/dateparser/__init__.pyi +++ b/stubs/dateparser/dateparser/__init__.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from typing import Any, Final, Literal, TypedDict, type_check_only from dateparser.conf import Settings diff --git a/stubs/dateparser/dateparser/conf.pyi b/stubs/dateparser/dateparser/conf.pyi index 9988233a0595..0df25d602025 100644 --- a/stubs/dateparser/dateparser/conf.pyi +++ b/stubs/dateparser/dateparser/conf.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from collections.abc import Callable from typing import Any, Literal, ParamSpec, TypeVar from typing_extensions import Self diff --git a/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi b/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi index 704e4e1320c4..ea10222818fe 100644 --- a/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi +++ b/stubs/dateparser/dateparser/custom_language_detection/fasttext.pyi @@ -1,2 +1,3 @@ from _typeshed import FloatInt + def detect_languages(text: str, confidence_threshold: FloatInt) -> list[str]: ... diff --git a/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi b/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi index 704e4e1320c4..ea10222818fe 100644 --- a/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi +++ b/stubs/dateparser/dateparser/custom_language_detection/langdetect.pyi @@ -1,2 +1,3 @@ from _typeshed import FloatInt + def detect_languages(text: str, confidence_threshold: FloatInt) -> list[str]: ... diff --git a/stubs/dateparser/dateparser/date.pyi b/stubs/dateparser/dateparser/date.pyi index 846d291c43d7..380c1f1c7c2b 100644 --- a/stubs/dateparser/dateparser/date.pyi +++ b/stubs/dateparser/dateparser/date.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import re -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections import OrderedDict from collections.abc import Callable, Iterable, Iterator, Set as AbstractSet from datetime import date, datetime, tzinfo diff --git a/stubs/docker/docker/api/container.pyi b/stubs/docker/docker/api/container.pyi index ab8016431198..d609a2c85e95 100644 --- a/stubs/docker/docker/api/container.pyi +++ b/stubs/docker/docker/api/container.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable, Mapping from typing import Any, Literal, TypeAlias, TypedDict, overload, type_check_only from typing_extensions import NotRequired diff --git a/stubs/docker/docker/models/containers.pyi b/stubs/docker/docker/models/containers.pyi index f727d7596051..51d8ffdb07bb 100644 --- a/stubs/docker/docker/models/containers.pyi +++ b/stubs/docker/docker/models/containers.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import datetime from _io import _BufferedReaderStream +from _typeshed import FloatInt from builtins import list as _list from collections.abc import Iterable, Iterator, Mapping from socket import SocketIO diff --git a/stubs/docker/docker/transport/npipesocket.pyi b/stubs/docker/docker/transport/npipesocket.pyi index 65fa3b7db766..895098f513ae 100644 --- a/stubs/docker/docker/transport/npipesocket.pyi +++ b/stubs/docker/docker/transport/npipesocket.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import io -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from typing import Any, Literal, TypeAlias from typing_extensions import Never diff --git a/stubs/docker/docker/utils/utils.pyi b/stubs/docker/docker/utils/utils.pyi index 654f094bf314..03854b6dfa35 100644 --- a/stubs/docker/docker/utils/utils.pyi +++ b/stubs/docker/docker/utils/utils.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime -from _typeshed import FileDescriptorOrPath, ReadableBuffer, Unused +from _typeshed import FileDescriptorOrPath, FloatInt, ReadableBuffer, Unused from collections.abc import Iterable, Mapping from shlex import _ShlexInstream from typing import Literal, NamedTuple, TypedDict, TypeVar, overload, type_check_only diff --git a/stubs/docutils/docutils/nodes.pyi b/stubs/docutils/docutils/nodes.pyi index 2a387ce45c67..b870b1b4cf74 100644 --- a/stubs/docutils/docutils/nodes.pyi +++ b/stubs/docutils/docutils/nodes.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import sys import xml.dom.minidom -from _typeshed import Incomplete, MaybeNone, StrPath +from _typeshed import FloatInt, Incomplete, MaybeNone, StrPath from abc import abstractmethod from collections import Counter from collections.abc import Callable, Generator, Iterable, Iterator, Mapping, Sequence diff --git a/stubs/docutils/docutils/writers/manpage.pyi b/stubs/docutils/docutils/writers/manpage.pyi index 8bedfa24dc2f..cabd0af43064 100644 --- a/stubs/docutils/docutils/writers/manpage.pyi +++ b/stubs/docutils/docutils/writers/manpage.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import re -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from typing import ClassVar, Final, Protocol, type_check_only from typing_extensions import Never diff --git a/stubs/docutils/docutils/writers/odf_odt/__init__.pyi b/stubs/docutils/docutils/writers/odf_odt/__init__.pyi index fbae10479f99..de872dd46dbe 100644 --- a/stubs/docutils/docutils/writers/odf_odt/__init__.pyi +++ b/stubs/docutils/docutils/writers/odf_odt/__init__.pyi @@ -1,8 +1,7 @@ -from _typeshed import FloatInt import itertools import re import zipfile -from _typeshed import FileDescriptorOrPath, Incomplete, ReadableBuffer, SizedBuffer, Unused +from _typeshed import FileDescriptorOrPath, FloatInt, Incomplete, ReadableBuffer, SizedBuffer, Unused from collections.abc import Generator from typing import ClassVar, Final, Literal from xml.etree import ElementTree diff --git a/stubs/ephem/ephem/__init__.pyi b/stubs/ephem/ephem/__init__.pyi index 21931b3fe47f..175103c5be5f 100644 --- a/stubs/ephem/ephem/__init__.pyi +++ b/stubs/ephem/ephem/__init__.pyi @@ -242,7 +242,9 @@ class Coordinate: @overload def __init__(self, body: Body, *, epoch: _libastro._DateInitType | None = None) -> None: ... @overload - def __init__(self, coord1: FloatInt | str, coord2: FloatInt | str, *, epoch: _libastro._DateInitType | None = None) -> None: ... + def __init__( + self, coord1: FloatInt | str, coord2: FloatInt | str, *, epoch: _libastro._DateInitType | None = None + ) -> None: ... @overload def __init__(self, coord: Coordinate, *, epoch: _libastro._DateInitType | None = None) -> None: ... diff --git a/stubs/ephem/ephem/_libastro.pyi b/stubs/ephem/ephem/_libastro.pyi index 0428663272bd..3e4f6810824a 100644 --- a/stubs/ephem/ephem/_libastro.pyi +++ b/stubs/ephem/ephem/_libastro.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import builtins -from _typeshed import Unused +from _typeshed import FloatInt, Unused from datetime import datetime as _datetime from typing import Final, TypeAlias, TypedDict, overload, type_check_only from typing_extensions import Never, Self, deprecated, disjoint_base @@ -368,7 +367,9 @@ def degrees(angle: FloatInt | str, /) -> Angle: ... def hours(angle: FloatInt | str, /) -> Angle: ... def now() -> Date: ... def separation( - obj1: tuple[FloatInt | str, FloatInt | str] | Body | Observer, obj2: tuple[FloatInt | str, FloatInt | str] | Body | Observer, / + obj1: tuple[FloatInt | str, FloatInt | str] | Body | Observer, + obj2: tuple[FloatInt | str, FloatInt | str] | Body | Observer, + /, ) -> Angle: ... def readdb(db_line: str, /) -> Body: ... def readtle(name: str, line1: str, line2: str, /) -> EarthSatellite: ... @@ -389,7 +390,9 @@ def eq_ecl(epoch: Date | FloatInt, ra: Angle | FloatInt, dec: Angle | FloatInt, def ecl_eq(epoch: Date | FloatInt, lon: Angle | FloatInt, lat: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... def eq_gal(epoch: Date | FloatInt, ra: Angle | FloatInt, dec: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... def gal_eq(epoch: Date | FloatInt, glon: Angle | FloatInt, glat: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... -def precess(epoch1: Date | FloatInt, epoch2: Date | FloatInt, ra: Angle | FloatInt, dec: Angle | FloatInt, /) -> tuple[Angle, Angle]: ... +def precess( + epoch1: Date | FloatInt, epoch2: Date | FloatInt, ra: Angle | FloatInt, dec: Angle | FloatInt, / +) -> tuple[Angle, Angle]: ... def _next_pass( observer: Observer, body: Body, / ) -> tuple[Date | None, Angle | None, Date | None, Angle | None, Date | None, Angle | None]: ... diff --git a/stubs/flake8/flake8/formatting/base.pyi b/stubs/flake8/flake8/formatting/base.pyi index 32f788f68c33..15ff538a108c 100644 --- a/stubs/flake8/flake8/formatting/base.pyi +++ b/stubs/flake8/flake8/formatting/base.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import argparse -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from ..statistics import Statistics from ..violation import Violation as Violation diff --git a/stubs/geojson/geojson/utils.pyi b/stubs/geojson/geojson/utils.pyi index e9896e9d97c0..e3edbfddddd8 100644 --- a/stubs/geojson/geojson/utils.pyi +++ b/stubs/geojson/geojson/utils.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Generator from typing import Any, Literal diff --git a/stubs/geopandas/geopandas/array.pyi b/stubs/geopandas/geopandas/array.pyi index 67b8fe31ab71..2871c824cfda 100644 --- a/stubs/geopandas/geopandas/array.pyi +++ b/stubs/geopandas/geopandas/array.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import builtins -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from collections.abc import Callable, Collection from typing import Any, ClassVar, Final, Literal, SupportsIndex, TypeAlias, TypeVar, overload from typing_extensions import Never, Self, deprecated diff --git a/stubs/geopandas/geopandas/base.pyi b/stubs/geopandas/geopandas/base.pyi index 6c51bba0bd0e..635ab7105cd4 100644 --- a/stubs/geopandas/geopandas/base.pyi +++ b/stubs/geopandas/geopandas/base.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsGetItem +from _typeshed import FloatInt, Incomplete, SupportsGetItem from collections.abc import Callable, Collection, Hashable, Iterable, Mapping, Sequence from typing import Any, Literal, Protocol, SupportsIndex, TypeAlias, overload, type_check_only from typing_extensions import Self, deprecated @@ -29,8 +28,12 @@ class _SupportsGeoInterface(Protocol): # noqa: Y046 def __geo_interface__(self) -> dict[str, Any]: ... # values are arbitrary _ConvertibleToCRS: TypeAlias = str | int | tuple[str, str] | list[str] | dict[str, Incomplete] | _SupportsToWkt -_AffinityOrigin: TypeAlias = Literal["center", "centroid"] | Point | tuple[FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] -_ClipMask: TypeAlias = GeoDataFrame | GeoSeries | Polygon | MultiPolygon | tuple[FloatInt, FloatInt, FloatInt, FloatInt] # noqa: Y047 +_AffinityOrigin: TypeAlias = ( + Literal["center", "centroid"] | Point | tuple[FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] +) +_ClipMask: TypeAlias = ( + GeoDataFrame | GeoSeries | Polygon | MultiPolygon | tuple[FloatInt, FloatInt, FloatInt, FloatInt] +) # noqa: Y047 # np.floating[Any] because precision is not important _BboxLike: TypeAlias = Sequence[FloatInt] | NDArray[np.floating[Any]] | Geometry | GeoDataFrame | GeoSeries # noqa: Y047 _MaskLike: TypeAlias = dict[str, Incomplete] | Geometry | GeoDataFrame | GeoSeries # noqa: Y047 @@ -145,7 +148,9 @@ class GeoPandasBase: def intersection_all(self) -> BaseGeometry: ... def contains(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... def contains_properly(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... - def dwithin(self, other: GeoSeries | Geometry, distance: FloatInt | ArrayLike, align: bool | None = None) -> pd.Series[bool]: ... + def dwithin( + self, other: GeoSeries | Geometry, distance: FloatInt | ArrayLike, align: bool | None = None + ) -> pd.Series[bool]: ... def geom_equals(self, other: GeoSeries | Geometry, align: bool | None = None) -> pd.Series[bool]: ... def geom_equals_exact( self, other: GeoSeries | Geometry, tolerance: FloatInt | ArrayLike, align: bool | None = None @@ -166,7 +171,9 @@ class GeoPandasBase: def frechet_distance( self, other: GeoSeries | Geometry, align: bool | None = None, densify: FloatInt | ArrayLike | None = None ) -> pd.Series[float]: ... - def difference(self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: FloatInt | None = None) -> GeoSeries: ... + def difference( + self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: FloatInt | None = None + ) -> GeoSeries: ... def symmetric_difference( self, other: GeoSeries | Geometry, align: bool | None = None, grid_size: FloatInt | None = None ) -> GeoSeries: ... diff --git a/stubs/geopandas/geopandas/geodataframe.pyi b/stubs/geopandas/geopandas/geodataframe.pyi index 47243c809f08..d3ece1ddfdf4 100644 --- a/stubs/geopandas/geopandas/geodataframe.pyi +++ b/stubs/geopandas/geopandas/geodataframe.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import io import os -from _typeshed import Incomplete, SupportsGetItem, SupportsLenAndGetItem, SupportsRead, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsGetItem, SupportsLenAndGetItem, SupportsRead, SupportsWrite from collections.abc import Callable, Container, Hashable, Iterable, Iterator, Mapping, Sequence from json import JSONEncoder from typing import Any, Literal, overload diff --git a/stubs/geopandas/geopandas/io/arrow.pyi b/stubs/geopandas/geopandas/io/arrow.pyi index aa56f245334c..5f4cfa94357b 100644 --- a/stubs/geopandas/geopandas/io/arrow.pyi +++ b/stubs/geopandas/geopandas/io/arrow.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import os -from _typeshed import Incomplete, SupportsGetItem, SupportsKeysAndGetItem +from _typeshed import FloatInt, Incomplete, SupportsGetItem, SupportsKeysAndGetItem from collections.abc import Iterable, Mapping from typing import Any, Final diff --git a/stubs/geopandas/geopandas/plotting.pyi b/stubs/geopandas/geopandas/plotting.pyi index 311d99e0b6d3..8e6e82e53934 100644 --- a/stubs/geopandas/geopandas/plotting.pyi +++ b/stubs/geopandas/geopandas/plotting.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import os -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Collection, Hashable, Iterable, Mapping, Sequence from typing import Literal, TypeAlias, overload diff --git a/stubs/gevent/gevent/_ffi/loop.pyi b/stubs/gevent/gevent/_ffi/loop.pyi index a40ccb5ca770..4b5cd6216287 100644 --- a/stubs/gevent/gevent/_ffi/loop.pyi +++ b/stubs/gevent/gevent/_ffi/loop.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import FileDescriptor +from _typeshed import FileDescriptor, FloatInt from collections.abc import Callable, Sequence from types import TracebackType from typing import Protocol, TypeAlias, type_check_only diff --git a/stubs/gevent/gevent/_ffi/watcher.pyi b/stubs/gevent/gevent/_ffi/watcher.pyi index a58df2170c12..a79a27265072 100644 --- a/stubs/gevent/gevent/_ffi/watcher.pyi +++ b/stubs/gevent/gevent/_ffi/watcher.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptor, StrOrBytesPath +from _typeshed import FileDescriptor, FloatInt, StrOrBytesPath from collections.abc import Callable from types import TracebackType from typing import Any, Literal, overload diff --git a/stubs/gevent/gevent/_hub_primitives.pyi b/stubs/gevent/gevent/_hub_primitives.pyi index f404b004406c..269414ea43c6 100644 --- a/stubs/gevent/gevent/_hub_primitives.pyi +++ b/stubs/gevent/gevent/_hub_primitives.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptor +from _typeshed import FileDescriptor, FloatInt from collections.abc import Callable, Collection, Iterable from types import TracebackType from typing import Any, Generic, Protocol, TypeVar, overload, type_check_only diff --git a/stubs/gevent/gevent/_types.pyi b/stubs/gevent/gevent/_types.pyi index 3cd6e00ce16f..5625e2867b67 100644 --- a/stubs/gevent/gevent/_types.pyi +++ b/stubs/gevent/gevent/_types.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import FileDescriptor, StrOrBytesPath +from _typeshed import FileDescriptor, FloatInt, StrOrBytesPath from collections.abc import Callable from types import TracebackType from typing import Any, Literal, Protocol, TypeAlias, overload, type_check_only diff --git a/stubs/gevent/gevent/greenlet.pyi b/stubs/gevent/gevent/greenlet.pyi index acc6aadca440..f6831871979c 100644 --- a/stubs/gevent/gevent/greenlet.pyi +++ b/stubs/gevent/gevent/greenlet.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import weakref +from _typeshed import FloatInt from collections.abc import Callable, Iterable, Sequence from types import FrameType, TracebackType from typing import Any, ClassVar, Generic, ParamSpec, TypeVar, overload diff --git a/stubs/gevent/gevent/libev/corecext.pyi b/stubs/gevent/gevent/libev/corecext.pyi index 1802248f3777..b531378d7675 100644 --- a/stubs/gevent/gevent/libev/corecext.pyi +++ b/stubs/gevent/gevent/libev/corecext.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import FileDescriptor +from _typeshed import FileDescriptor, FloatInt from collections.abc import Callable, Sequence from types import TracebackType from typing import Any, ParamSpec @@ -64,7 +63,9 @@ if sys.platform != "win32": def pendingcnt(self) -> int: ... def io(self, fd: FileDescriptor, events: int, ref: bool = True, priority: int | None = None) -> watcher.io: ... def closing_fd(self, fd: FileDescriptor) -> bool: ... - def timer(self, after: FloatInt, repeat: FloatInt = 0.0, ref: bool = True, priority: int | None = None) -> watcher.timer: ... + def timer( + self, after: FloatInt, repeat: FloatInt = 0.0, ref: bool = True, priority: int | None = None + ) -> watcher.timer: ... def signal(self, signum: int, ref: bool = True, priority: int | None = None) -> watcher.signal: ... def idle(self, ref: bool = True, priority: int | None = None) -> watcher.idle: ... def prepare(self, ref: bool = True, priority: int | None = None) -> watcher.prepare: ... diff --git a/stubs/gevent/gevent/libev/corecffi.pyi b/stubs/gevent/gevent/libev/corecffi.pyi index 41e370582f31..4ac51b72d3db 100644 --- a/stubs/gevent/gevent/libev/corecffi.pyi +++ b/stubs/gevent/gevent/libev/corecffi.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import FileDescriptor +from _typeshed import FileDescriptor, FloatInt from collections.abc import Sequence from gevent._ffi.loop import AbstractLoop diff --git a/stubs/gevent/gevent/libuv/loop.pyi b/stubs/gevent/gevent/libuv/loop.pyi index 4dbc9c7ad968..8fa6d5fd09b4 100644 --- a/stubs/gevent/gevent/libuv/loop.pyi +++ b/stubs/gevent/gevent/libuv/loop.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import FileDescriptor +from _typeshed import FileDescriptor, FloatInt from typing import NamedTuple from gevent._ffi.loop import AbstractLoop diff --git a/stubs/gevent/gevent/libuv/watcher.pyi b/stubs/gevent/gevent/libuv/watcher.pyi index 5e7ceb283dd0..922f74ede215 100644 --- a/stubs/gevent/gevent/libuv/watcher.pyi +++ b/stubs/gevent/gevent/libuv/watcher.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from gevent._ffi import watcher as _base from gevent._types import _IoWatcher diff --git a/stubs/gevent/gevent/pywsgi.pyi b/stubs/gevent/gevent/pywsgi.pyi index 54164c4b9d49..e80602719878 100644 --- a/stubs/gevent/gevent/pywsgi.pyi +++ b/stubs/gevent/gevent/pywsgi.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import OptExcInfo, StrOrBytesPath, SupportsWrite +from _typeshed import FloatInt, OptExcInfo, StrOrBytesPath, SupportsWrite from _typeshed.wsgi import WSGIApplication, WSGIEnvironment from collections.abc import Callable, Container, Iterable, Iterator from http.client import HTTPMessage diff --git a/stubs/gevent/gevent/queue.pyi b/stubs/gevent/gevent/queue.pyi index 75bc7c292320..f34d3be023a4 100644 --- a/stubs/gevent/gevent/queue.pyi +++ b/stubs/gevent/gevent/queue.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import sys import types +from _typeshed import FloatInt from collections import deque from collections.abc import Iterable diff --git a/stubs/gevent/gevent/select.pyi b/stubs/gevent/gevent/select.pyi index 4cd00658bdd8..0f1af19f6e74 100644 --- a/stubs/gevent/gevent/select.pyi +++ b/stubs/gevent/gevent/select.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import FileDescriptorLike +from _typeshed import FileDescriptorLike, FloatInt from collections.abc import Iterable from select import error as error from typing import Any diff --git a/stubs/gevent/gevent/selectors.pyi b/stubs/gevent/gevent/selectors.pyi index e93ff1da379c..ed690f107559 100644 --- a/stubs/gevent/gevent/selectors.pyi +++ b/stubs/gevent/gevent/selectors.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptorLike +from _typeshed import FileDescriptorLike, FloatInt from collections.abc import Mapping from selectors import BaseSelector, SelectorKey from typing import Any diff --git a/stubs/gevent/gevent/util.pyi b/stubs/gevent/gevent/util.pyi index c5011159cb2f..fe4a83b6e965 100644 --- a/stubs/gevent/gevent/util.pyi +++ b/stubs/gevent/gevent/util.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsWrite +from _typeshed import FloatInt, SupportsWrite from collections.abc import Callable from types import TracebackType from typing import Any, Generic, ParamSpec, TypeVar diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi index fd3663ad8427..03000e1f0841 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/global_cache.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import abc -from _typeshed import Incomplete, SupportsItems +from _typeshed import FloatInt, Incomplete, SupportsItems from typing_extensions import Self ConnectionError: Incomplete @@ -15,7 +14,9 @@ class GlobalCache(metaclass=abc.ABCMeta): @abc.abstractmethod def set(self, items, expires=None): ... @abc.abstractmethod - def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None) -> dict[bytes, bool]: ... + def set_if_not_exists( + self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None + ) -> dict[bytes, bool]: ... @abc.abstractmethod def delete(self, keys): ... @abc.abstractmethod @@ -32,7 +33,9 @@ class _InProcessGlobalCache(GlobalCache): def __init__(self) -> None: ... def get(self, keys): ... def set(self, items, expires=None) -> None: ... - def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None) -> dict[bytes, bool]: ... + def set_if_not_exists( + self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None + ) -> dict[bytes, bool]: ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... @@ -51,7 +54,9 @@ class RedisCache(GlobalCache): def pipes(self): ... def get(self, keys): ... def set(self, items, expires=None) -> None: ... - def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None) -> dict[bytes, bool]: ... + def set_if_not_exists( + self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None + ) -> dict[bytes, bool]: ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... @@ -75,7 +80,9 @@ class MemcacheCache(GlobalCache): def caskeys(self): ... def get(self, keys): ... def set(self, items, expires=None): ... - def set_if_not_exists(self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None) -> dict[bytes, bool]: ... + def set_if_not_exists( + self, items: SupportsItems[bytes, bytes | None], expires: FloatInt | None = None + ) -> dict[bytes, bool]: ... def delete(self, keys) -> None: ... def watch(self, items) -> None: ... def unwatch(self, keys) -> None: ... diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi index 411da6c5c089..906bea8bc987 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/model.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Callable, Iterable, Sequence from typing import Any, Literal, TypeAlias from typing_extensions import Never, Self diff --git a/stubs/grpcio/grpc/__init__.pyi b/stubs/grpcio/grpc/__init__.pyi index 5e6ede411d36..05f3e0d10449 100644 --- a/stubs/grpcio/grpc/__init__.pyi +++ b/stubs/grpcio/grpc/__init__.pyi @@ -1,7 +1,7 @@ -from _typeshed import FloatInt import abc import enum import threading +from _typeshed import FloatInt from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from concurrent import futures from types import ModuleType, TracebackType diff --git a/stubs/grpcio/grpc/aio/__init__.pyi b/stubs/grpcio/grpc/aio/__init__.pyi index bd1c8b3ec4df..287332b1fe4a 100644 --- a/stubs/grpcio/grpc/aio/__init__.pyi +++ b/stubs/grpcio/grpc/aio/__init__.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import abc import asyncio -from _typeshed import Incomplete, MaybeNone +from _typeshed import FloatInt, Incomplete, MaybeNone from collections.abc import ( AsyncIterable, AsyncIterator, diff --git a/stubs/gunicorn/gunicorn/ctl/client.pyi b/stubs/gunicorn/gunicorn/ctl/client.pyi index 9eaf17d809c4..25774f4bc0d4 100644 --- a/stubs/gunicorn/gunicorn/ctl/client.pyi +++ b/stubs/gunicorn/gunicorn/ctl/client.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from typing_extensions import Self class ControlClientError(Exception): ... diff --git a/stubs/gunicorn/gunicorn/ctl/handlers.pyi b/stubs/gunicorn/gunicorn/ctl/handlers.pyi index 2bea29e3e954..49efbe3758d6 100644 --- a/stubs/gunicorn/gunicorn/ctl/handlers.pyi +++ b/stubs/gunicorn/gunicorn/ctl/handlers.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Literal, TypedDict, type_check_only from typing_extensions import NotRequired diff --git a/stubs/gunicorn/gunicorn/dirty/client.pyi b/stubs/gunicorn/gunicorn/dirty/client.pyi index a37a7e3e1d1f..bebdc65ab825 100644 --- a/stubs/gunicorn/gunicorn/dirty/client.pyi +++ b/stubs/gunicorn/gunicorn/dirty/client.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from types import TracebackType from typing import Any, ClassVar from typing_extensions import Self diff --git a/stubs/gunicorn/gunicorn/dirty/errors.pyi b/stubs/gunicorn/gunicorn/dirty/errors.pyi index 1434d360931e..adaf635a6f44 100644 --- a/stubs/gunicorn/gunicorn/dirty/errors.pyi +++ b/stubs/gunicorn/gunicorn/dirty/errors.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import TypedDict, type_check_only @type_check_only diff --git a/stubs/gunicorn/gunicorn/dirty/stash.pyi b/stubs/gunicorn/gunicorn/dirty/stash.pyi index b8756f7cb02e..dd41212ec19e 100644 --- a/stubs/gunicorn/gunicorn/dirty/stash.pyi +++ b/stubs/gunicorn/gunicorn/dirty/stash.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterator from types import TracebackType from typing_extensions import Self diff --git a/stubs/gunicorn/gunicorn/dirty/tlv.pyi b/stubs/gunicorn/gunicorn/dirty/tlv.pyi index 82218458d2e4..59dc2066d4ca 100644 --- a/stubs/gunicorn/gunicorn/dirty/tlv.pyi +++ b/stubs/gunicorn/gunicorn/dirty/tlv.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final TYPE_NONE: Final = 0x00 diff --git a/stubs/gunicorn/gunicorn/http/parser.pyi b/stubs/gunicorn/gunicorn/http/parser.pyi index 0e6c3ad06891..3609489a9878 100644 --- a/stubs/gunicorn/gunicorn/http/parser.pyi +++ b/stubs/gunicorn/gunicorn/http/parser.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import socket +from _typeshed import FloatInt from collections.abc import Callable, Iterable, Iterator from typing import ClassVar diff --git a/stubs/gunicorn/gunicorn/http2/async_connection.pyi b/stubs/gunicorn/gunicorn/http2/async_connection.pyi index da99ad328bcb..ed49af0a5d59 100644 --- a/stubs/gunicorn/gunicorn/http2/async_connection.pyi +++ b/stubs/gunicorn/gunicorn/http2/async_connection.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from asyncio import StreamReader, StreamWriter from collections.abc import Iterable from typing import ClassVar diff --git a/stubs/gunicorn/gunicorn/http2/negotiation.pyi b/stubs/gunicorn/gunicorn/http2/negotiation.pyi index 62f93ca621a7..24511b7974b4 100644 --- a/stubs/gunicorn/gunicorn/http2/negotiation.pyi +++ b/stubs/gunicorn/gunicorn/http2/negotiation.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import socket +from _typeshed import FloatInt from typing import Final, Literal, Protocol, type_check_only from gunicorn.config import Config diff --git a/stubs/gunicorn/gunicorn/instrument/statsd.pyi b/stubs/gunicorn/gunicorn/instrument/statsd.pyi index 04671da32d3a..3ccc3389384f 100644 --- a/stubs/gunicorn/gunicorn/instrument/statsd.pyi +++ b/stubs/gunicorn/gunicorn/instrument/statsd.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import logging import socket +from _typeshed import FloatInt from collections.abc import Mapping from datetime import timedelta from typing import Final diff --git a/stubs/gunicorn/gunicorn/util.pyi b/stubs/gunicorn/gunicorn/util.pyi index 5f6a66f2bf10..b0f59e96e7f0 100644 --- a/stubs/gunicorn/gunicorn/util.pyi +++ b/stubs/gunicorn/gunicorn/util.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import types -from _typeshed import FileDescriptorLike, FileDescriptorOrPath, StrOrBytesPath +from _typeshed import FileDescriptorLike, FileDescriptorOrPath, FloatInt, StrOrBytesPath from inspect import _IntrospectableCallable, _ParameterKind from re import Pattern from socket import socket diff --git a/stubs/gunicorn/gunicorn/workers/gthread.pyi b/stubs/gunicorn/gunicorn/workers/gthread.pyi index 38b9a3e09fb9..368f1fba8eea 100644 --- a/stubs/gunicorn/gunicorn/workers/gthread.pyi +++ b/stubs/gunicorn/gunicorn/workers/gthread.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import socket -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections import deque from collections.abc import Callable from concurrent.futures import Future, ThreadPoolExecutor diff --git a/stubs/hdbcli/hdbcli/dbapi.pyi b/stubs/hdbcli/hdbcli/dbapi.pyi index 7deaff4fd560..5bfe6d6e7adc 100644 --- a/stubs/hdbcli/hdbcli/dbapi.pyi +++ b/stubs/hdbcli/hdbcli/dbapi.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import decimal -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections.abc import Callable, Sequence from datetime import date, datetime, time from types import TracebackType diff --git a/stubs/httplib2/httplib2/__init__.pyi b/stubs/httplib2/httplib2/__init__.pyi index e8dbea66b4cb..dbded2b43d0b 100644 --- a/stubs/httplib2/httplib2/__init__.pyi +++ b/stubs/httplib2/httplib2/__init__.pyi @@ -1,10 +1,9 @@ -from _typeshed import FloatInt import builtins import email.message import http.client import re from _ssl import _PasswordType -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, MaybeNone, StrOrBytesPath +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, MaybeNone, StrOrBytesPath from collections.abc import Generator from ssl import _SSLMethod from typing import Any, ClassVar, Final, Literal, TypeVar, overload diff --git a/stubs/httpretty/httpretty/core.pyi b/stubs/httpretty/httpretty/core.pyi index dcb3632294fa..c5fc5181a11d 100644 --- a/stubs/httpretty/httpretty/core.pyi +++ b/stubs/httpretty/httpretty/core.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import re +from _typeshed import FloatInt from collections.abc import Callable, Iterable, Mapping from contextlib import AbstractContextManager from http.client import HTTPMessage diff --git a/stubs/inifile/inifile.pyi b/stubs/inifile/inifile.pyi index 45e5700205a9..3749f31eaae2 100644 --- a/stubs/inifile/inifile.pyi +++ b/stubs/inifile/inifile.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import StrPath, SupportsKeysAndGetItem +from _typeshed import FloatInt, StrPath, SupportsKeysAndGetItem from collections.abc import Container, Iterable, Iterator, Mapping, MutableMapping, Sequence from typing import Literal, TypeAlias, TypeVar, overload from uuid import UUID diff --git a/stubs/kafka-python/kafka/admin/_partitions.pyi b/stubs/kafka-python/kafka/admin/_partitions.pyi index fd38353fb149..f3979964609b 100644 --- a/stubs/kafka-python/kafka/admin/_partitions.pyi +++ b/stubs/kafka-python/kafka/admin/_partitions.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Mapping, Sequence from typing_extensions import deprecated diff --git a/stubs/kafka-python/kafka/admin/_topics.pyi b/stubs/kafka-python/kafka/admin/_topics.pyi index 493a4e6415cd..e1a39a9ea03e 100644 --- a/stubs/kafka-python/kafka/admin/_topics.pyi +++ b/stubs/kafka-python/kafka/admin/_topics.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import uuid -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Mapping, Sequence from typing_extensions import deprecated diff --git a/stubs/kafka-python/kafka/admin/_transactions.pyi b/stubs/kafka-python/kafka/admin/_transactions.pyi index 342f1fe0ab7b..97d3111ff478 100644 --- a/stubs/kafka-python/kafka/admin/_transactions.pyi +++ b/stubs/kafka-python/kafka/admin/_transactions.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import NamedTuple from kafka.structs import TopicPartition diff --git a/stubs/kafka-python/kafka/consumer/group.pyi b/stubs/kafka-python/kafka/consumer/group.pyi index 3099a78a6c5d..e201704f2d41 100644 --- a/stubs/kafka-python/kafka/consumer/group.pyi +++ b/stubs/kafka-python/kafka/consumer/group.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import selectors import ssl -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from types import TracebackType from typing import Final, Literal, TypeAlias, overload @@ -144,6 +143,8 @@ class KafkaConsumer(Iterator[ConsumerRecord]): def beginning_offsets( self, partitions: Iterable[TopicPartition], timeout_ms: FloatInt | None = None ) -> dict[TopicPartition, int]: ... - def end_offsets(self, partitions: Iterable[TopicPartition], timeout_ms: FloatInt | None = None) -> dict[TopicPartition, int]: ... + def end_offsets( + self, partitions: Iterable[TopicPartition], timeout_ms: FloatInt | None = None + ) -> dict[TopicPartition, int]: ... def __iter__(self) -> Self: ... def __next__(self) -> ConsumerRecord: ... diff --git a/stubs/kafka-python/kafka/coordinator/heartbeat.pyi b/stubs/kafka-python/kafka/coordinator/heartbeat.pyi index 9a052c36a879..3300960617fc 100644 --- a/stubs/kafka-python/kafka/coordinator/heartbeat.pyi +++ b/stubs/kafka-python/kafka/coordinator/heartbeat.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete class Heartbeat: DEFAULT_CONFIG: dict[str, Incomplete] diff --git a/stubs/kafka-python/kafka/metrics/stats/percentiles.pyi b/stubs/kafka-python/kafka/metrics/stats/percentiles.pyi index 354850fa5656..8dfe8d572d01 100644 --- a/stubs/kafka-python/kafka/metrics/stats/percentiles.pyi +++ b/stubs/kafka-python/kafka/metrics/stats/percentiles.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from kafka.metrics.compound_stat import AbstractCompoundStat from kafka.metrics.stats.sampled_stat import AbstractSampledStat diff --git a/stubs/kafka-python/kafka/metrics/stats/sensor.pyi b/stubs/kafka-python/kafka/metrics/stats/sensor.pyi index f627631c36a9..330d5930860e 100644 --- a/stubs/kafka-python/kafka/metrics/stats/sensor.pyi +++ b/stubs/kafka-python/kafka/metrics/stats/sensor.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + class Sensor: __slots__ = ( "_lock", diff --git a/stubs/kafka-python/kafka/metrics/stats/total.pyi b/stubs/kafka-python/kafka/metrics/stats/total.pyi index 134bab9eabe2..5c1dcb5fccd2 100644 --- a/stubs/kafka-python/kafka/metrics/stats/total.pyi +++ b/stubs/kafka-python/kafka/metrics/stats/total.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from kafka.metrics.measurable_stat import AbstractMeasurableStat class Total(AbstractMeasurableStat): diff --git a/stubs/kafka-python/kafka/net/connection.pyi b/stubs/kafka-python/kafka/net/connection.pyi index 9704c98d23e1..c116891c88bb 100644 --- a/stubs/kafka-python/kafka/net/connection.pyi +++ b/stubs/kafka-python/kafka/net/connection.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections import deque from collections.abc import Generator from typing_extensions import Self diff --git a/stubs/kafka-python/kafka/net/transport.pyi b/stubs/kafka-python/kafka/net/transport.pyi index e2ab6aed65f0..19740f33533b 100644 --- a/stubs/kafka-python/kafka/net/transport.pyi +++ b/stubs/kafka-python/kafka/net/transport.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import socket -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete class KafkaTCPTransport: host: Incomplete | None diff --git a/stubs/kafka-python/kafka/producer/kafka.pyi b/stubs/kafka-python/kafka/producer/kafka.pyi index 8a73bcc74407..daeecfb76ea1 100644 --- a/stubs/kafka-python/kafka/producer/kafka.pyi +++ b/stubs/kafka-python/kafka/producer/kafka.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import selectors import ssl -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Mapping, Sequence from types import TracebackType from typing import Literal, TypeAlias diff --git a/stubs/kafka-python/kafka/producer/producer_batch.pyi b/stubs/kafka-python/kafka/producer/producer_batch.pyi index 1b33827c0b75..c5b40ed7e070 100644 --- a/stubs/kafka-python/kafka/producer/producer_batch.pyi +++ b/stubs/kafka-python/kafka/producer/producer_batch.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from enum import IntEnum from kafka.producer.future import FutureProduceResult diff --git a/stubs/kafka-python/kafka/producer/record_accumulator.pyi b/stubs/kafka-python/kafka/producer/record_accumulator.pyi index d3d451bfe738..227fbc03503b 100644 --- a/stubs/kafka-python/kafka/producer/record_accumulator.pyi +++ b/stubs/kafka-python/kafka/producer/record_accumulator.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete class AtomicInteger: def __init__(self, val: int = 0) -> None: ... diff --git a/stubs/kafka-python/kafka/protocol/admin/client_quotas.pyi b/stubs/kafka-python/kafka/protocol/admin/client_quotas.pyi index 9ffee027b289..8c62d464ef9e 100644 --- a/stubs/kafka-python/kafka/protocol/admin/client_quotas.pyi +++ b/stubs/kafka-python/kafka/protocol/admin/client_quotas.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from kafka.protocol.api_message import ApiMessage from kafka.protocol.data_container import DataContainer diff --git a/stubs/keyboard/keyboard/_mouse_event.pyi b/stubs/keyboard/keyboard/_mouse_event.pyi index 0fe0e702d195..5934f13a61fb 100644 --- a/stubs/keyboard/keyboard/_mouse_event.pyi +++ b/stubs/keyboard/keyboard/_mouse_event.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt from typing import Literal, NamedTuple, TypeAlias _MouseEvent: TypeAlias = ButtonEvent | WheelEvent | MoveEvent # noqa: Y047 # Used outside diff --git a/stubs/keyboard/keyboard/mouse.pyi b/stubs/keyboard/keyboard/mouse.pyi index de848beb7e32..664baf8cddbb 100644 --- a/stubs/keyboard/keyboard/mouse.pyi +++ b/stubs/keyboard/keyboard/mouse.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt from collections.abc import Callable, Iterable from ctypes import c_long from typing import Literal, SupportsInt, TypeAlias, TypeVar diff --git a/stubs/ldap3/ldap3/utils/conv.pyi b/stubs/ldap3/ldap3/utils/conv.pyi index 9ca3e4488658..75c0f8766630 100644 --- a/stubs/ldap3/ldap3/utils/conv.pyi +++ b/stubs/ldap3/ldap3/utils/conv.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + def to_unicode(obj: FloatInt | bytes | str, encoding: str | None = None, from_server: bool = False) -> str: ... def to_raw(obj, encoding: str = "utf-8"): ... def escape_filter_chars(text: FloatInt | bytes | str, encoding: str | None = None) -> str: ... diff --git a/stubs/m3u8/m3u8/httpclient.pyi b/stubs/m3u8/m3u8/httpclient.pyi index 572fcb29003f..e7b3b98daae7 100644 --- a/stubs/m3u8/m3u8/httpclient.pyi +++ b/stubs/m3u8/m3u8/httpclient.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import urllib.request +from _typeshed import FloatInt from typing import Any, Protocol, type_check_only @type_check_only diff --git a/stubs/m3u8/m3u8/model.pyi b/stubs/m3u8/m3u8/model.pyi index 2231e18c57c3..b29aa09a6be0 100644 --- a/stubs/m3u8/m3u8/model.pyi +++ b/stubs/m3u8/m3u8/model.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime as dt -from _typeshed import Incomplete, StrOrBytesPath, Unused +from _typeshed import FloatInt, Incomplete, StrOrBytesPath, Unused from collections.abc import Callable, Iterable, Mapping from decimal import Decimal from typing import Any, ClassVar, Literal, Protocol, TypeAlias, TypeVar, overload, type_check_only diff --git a/stubs/m3u8/m3u8/version_matching.pyi b/stubs/m3u8/m3u8/version_matching.pyi index 2d706c7460e7..ca3e8fcb29a1 100644 --- a/stubs/m3u8/m3u8/version_matching.pyi +++ b/stubs/m3u8/m3u8/version_matching.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from m3u8.version_matching_rules import VersionMatchingError def get_version(file_lines: list[str]) -> float | None: ... diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 9f45e2804fa9..617f287a77e1 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Coroutine, Iterable, Mapping, Sequence from contextlib import AbstractContextManager from types import TracebackType diff --git a/stubs/mysqlclient/MySQLdb/times.pyi b/stubs/mysqlclient/MySQLdb/times.pyi index 1e7f9c8061da..5327968fb812 100644 --- a/stubs/mysqlclient/MySQLdb/times.pyi +++ b/stubs/mysqlclient/MySQLdb/times.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Unused +from _typeshed import FloatInt, Unused from datetime import date, datetime, time, timedelta from MySQLdb._mysql import string_literal as string_literal diff --git a/stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi b/stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi index cecdceebb014..1b96146e6669 100644 --- a/stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi +++ b/stubs/nanoleafapi/nanoleafapi/nanoleaf.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from typing import Any diff --git a/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi b/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi index 78b5f789d23d..b09719a275f9 100644 --- a/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections import defaultdict from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi b/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi index 67178473931f..711e4cde4c02 100644 --- a/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi b/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi index f9f71a03a8a0..c4dff21518c8 100644 --- a/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi +++ b/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsLenAndGetItem +from _typeshed import FloatInt, Incomplete, SupportsLenAndGetItem from collections.abc import Callable, Iterable, Mapping from typing import Any, Literal, TypeVar diff --git a/stubs/networkx/networkx/algorithms/bipartite/generators.pyi b/stubs/networkx/networkx/algorithms/bipartite/generators.pyi index 2f15f3111d90..c7e5747a73c8 100644 --- a/stubs/networkx/networkx/algorithms/bipartite/generators.pyi +++ b/stubs/networkx/networkx/algorithms/bipartite/generators.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi b/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi index 02b08474d882..7f05cf6c3a47 100644 --- a/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi b/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi index 5d694b1ced1a..cf12ea63297b 100644 --- a/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/dispersion.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi b/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi index c7a8631c066e..a1a3f3b361e3 100644 --- a/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Mapping from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/centrality/katz.pyi b/stubs/networkx/networkx/algorithms/centrality/katz.pyi index eb8813291ec5..b404dc3be818 100644 --- a/stubs/networkx/networkx/algorithms/centrality/katz.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/katz.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, Incomplete, SupportsItemAccess +from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, SupportsItemAccess from collections.abc import Iterable, Mapping from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi b/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi index 276777112812..0694b7bb2fe8 100644 --- a/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi +++ b/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Collection from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/chordal.pyi b/stubs/networkx/networkx/algorithms/chordal.pyi index d83b260de774..197fed5401fc 100644 --- a/stubs/networkx/networkx/algorithms/chordal.pyi +++ b/stubs/networkx/networkx/algorithms/chordal.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Generator from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/community/leiden.pyi b/stubs/networkx/networkx/algorithms/community/leiden.pyi index 8bcc8a0057f3..34b4b33e92af 100644 --- a/stubs/networkx/networkx/algorithms/community/leiden.pyi +++ b/stubs/networkx/networkx/algorithms/community/leiden.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/algorithms/community/louvain.pyi b/stubs/networkx/networkx/algorithms/community/louvain.pyi index 1190542f5860..baec68616ec7 100644 --- a/stubs/networkx/networkx/algorithms/community/louvain.pyi +++ b/stubs/networkx/networkx/algorithms/community/louvain.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Generator from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/community/lukes.pyi b/stubs/networkx/networkx/algorithms/community/lukes.pyi index 63c5668af1d9..709b1267163d 100644 --- a/stubs/networkx/networkx/algorithms/community/lukes.pyi +++ b/stubs/networkx/networkx/algorithms/community/lukes.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/community/modularity_max.pyi b/stubs/networkx/networkx/algorithms/community/modularity_max.pyi index d168c44dc68e..4a9ff7a51958 100644 --- a/stubs/networkx/networkx/algorithms/community/modularity_max.pyi +++ b/stubs/networkx/networkx/algorithms/community/modularity_max.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/algorithms/community/quality.pyi b/stubs/networkx/networkx/algorithms/community/quality.pyi index ea006fe6ce99..e97161bbe1f4 100644 --- a/stubs/networkx/networkx/algorithms/community/quality.pyi +++ b/stubs/networkx/networkx/algorithms/community/quality.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi b/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi index d000cf0a6520..75f45f9f7001 100644 --- a/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi +++ b/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsGetItem +from _typeshed import FloatInt, Incomplete, SupportsGetItem from collections.abc import Collection, Generator, Iterable from typing import NamedTuple diff --git a/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi b/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi index fb673d002ce9..6387ae3b1a6b 100644 --- a/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi +++ b/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi b/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi index 004d255e5452..370be5189f26 100644 --- a/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi +++ b/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi b/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi index 8e82ef11d3ce..1b9af19c3a20 100644 --- a/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi +++ b/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi b/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi index 9b132f8d1c92..393a749fb49c 100644 --- a/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi +++ b/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi b/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi index 56e740e67ac4..de3ba12284c5 100644 --- a/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi +++ b/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.digraph import DiGraph from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi b/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi index 2feea9b18d56..0e59a9d18755 100644 --- a/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi +++ b/stubs/networkx/networkx/algorithms/isomorphism/matchhelpers.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Iterable, Sequence from types import FunctionType diff --git a/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi b/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi index b5c140a44ecc..2cfb80b02c1c 100644 --- a/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi +++ b/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Generator from typing import NamedTuple diff --git a/stubs/networkx/networkx/algorithms/link_prediction.pyi b/stubs/networkx/networkx/algorithms/link_prediction.pyi index d9cb6a3ebaca..482fe81750ff 100644 --- a/stubs/networkx/networkx/algorithms/link_prediction.pyi +++ b/stubs/networkx/networkx/algorithms/link_prediction.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable, Iterator from networkx.classes.graph import Graph, _Node @@ -38,5 +37,8 @@ def ra_index_soundarajan_hopcroft( ) -> Iterator[Incomplete]: ... @_dispatchable def within_inter_cluster( - G: Graph[_Node], ebunch: Iterable[Incomplete] | None = None, delta: FloatInt | None = 0.001, community: str | None = "community" + G: Graph[_Node], + ebunch: Iterable[Incomplete] | None = None, + delta: FloatInt | None = 0.001, + community: str | None = "community", ) -> Iterator[Incomplete]: ... diff --git a/stubs/networkx/networkx/algorithms/node_classification.pyi b/stubs/networkx/networkx/algorithms/node_classification.pyi index 16d87389e8cb..f3c6ac794860 100644 --- a/stubs/networkx/networkx/algorithms/node_classification.pyi +++ b/stubs/networkx/networkx/algorithms/node_classification.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/algorithms/planarity.pyi b/stubs/networkx/networkx/algorithms/planarity.pyi index 32d2dea7ce0b..67de6b8e9ca2 100644 --- a/stubs/networkx/networkx/algorithms/planarity.pyi +++ b/stubs/networkx/networkx/algorithms/planarity.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from collections.abc import Generator, Iterable, Mapping, MutableSet, Reversible from decimal import Decimal from typing_extensions import Never diff --git a/stubs/networkx/networkx/algorithms/richclub.pyi b/stubs/networkx/networkx/algorithms/richclub.pyi index ef4d50d42aa3..2d4cd21e003c 100644 --- a/stubs/networkx/networkx/algorithms/richclub.pyi +++ b/stubs/networkx/networkx/algorithms/richclub.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi b/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi index ddc93f4f7c5f..8d0f19162c5b 100644 --- a/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi +++ b/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi @@ -64,11 +64,17 @@ def single_source_dijkstra( ) -> tuple[dict[_Node, float], dict[_Node, list[_Node]]] | tuple[float, list[_Node]]: ... # TODO: overload on target @_dispatchable def multi_source_dijkstra_path( - G: Graph[_Node], sources: Collection[_Node], cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], + sources: Collection[_Node], + cutoff: FloatInt | None = None, + weight: str | _WeightFunc[_Node] | None = "weight", ) -> dict[_Node, list[_Node]]: ... @_dispatchable def multi_source_dijkstra_path_length( - G: Graph[_Node], sources: Collection[_Node], cutoff: FloatInt | None = None, weight: str | _WeightFunc[_Node] | None = "weight" + G: Graph[_Node], + sources: Collection[_Node], + cutoff: FloatInt | None = None, + weight: str | _WeightFunc[_Node] | None = "weight", ) -> dict[_Node, float]: ... @_dispatchable def multi_source_dijkstra( diff --git a/stubs/networkx/networkx/algorithms/similarity.pyi b/stubs/networkx/networkx/algorithms/similarity.pyi index 2352fdd01873..de165fcb06da 100644 --- a/stubs/networkx/networkx/algorithms/similarity.pyi +++ b/stubs/networkx/networkx/algorithms/similarity.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsItemAccess +from _typeshed import FloatInt, Incomplete, SupportsItemAccess from collections.abc import Callable, Generator from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/algorithms/sparsifiers.pyi b/stubs/networkx/networkx/algorithms/sparsifiers.pyi index 381535f392c3..1a6097d3c977 100644 --- a/stubs/networkx/networkx/algorithms/sparsifiers.pyi +++ b/stubs/networkx/networkx/algorithms/sparsifiers.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/algorithms/tree/branchings.pyi b/stubs/networkx/networkx/algorithms/tree/branchings.pyi index 391680b654d2..017cc2cb1abf 100644 --- a/stubs/networkx/networkx/algorithms/tree/branchings.pyi +++ b/stubs/networkx/networkx/algorithms/tree/branchings.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from dataclasses import dataclass from typing import Final from typing_extensions import Self diff --git a/stubs/networkx/networkx/algorithms/tree/mst.pyi b/stubs/networkx/networkx/algorithms/tree/mst.pyi index 84b4e4d507aa..40a06497634a 100644 --- a/stubs/networkx/networkx/algorithms/tree/mst.pyi +++ b/stubs/networkx/networkx/algorithms/tree/mst.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Generator, Iterator from dataclasses import dataclass from enum import Enum diff --git a/stubs/networkx/networkx/algorithms/vitality.pyi b/stubs/networkx/networkx/algorithms/vitality.pyi index 8726f975379c..4c8510cc48c8 100644 --- a/stubs/networkx/networkx/algorithms/vitality.pyi +++ b/stubs/networkx/networkx/algorithms/vitality.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/convert.pyi b/stubs/networkx/networkx/convert.pyi index 15bb7ab7e973..9d093d389501 100644 --- a/stubs/networkx/networkx/convert.pyi +++ b/stubs/networkx/networkx/convert.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Collection, Iterable from networkx.classes.graph import Graph, _Data, _EdgeData, _Node, _NodeData diff --git a/stubs/networkx/networkx/convert_matrix.pyi b/stubs/networkx/networkx/convert_matrix.pyi index ae1f744c8708..6d94004d6a14 100644 --- a/stubs/networkx/networkx/convert_matrix.pyi +++ b/stubs/networkx/networkx/convert_matrix.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Collection, Hashable, Iterable from typing import Literal, TypeAlias, TypeVar, overload diff --git a/stubs/networkx/networkx/drawing/nx_pylab.pyi b/stubs/networkx/networkx/drawing/nx_pylab.pyi index 9822ac4c4a5c..815d4ad85757 100644 --- a/stubs/networkx/networkx/drawing/nx_pylab.pyi +++ b/stubs/networkx/networkx/drawing/nx_pylab.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsItems +from _typeshed import FloatInt, Incomplete, SupportsItems from collections.abc import Callable, Collection, Hashable, Iterable, Mapping, Sequence from typing import Any, Generic, Literal, TypeAlias, TypedDict, TypeVar, overload, type_check_only from typing_extensions import Unpack diff --git a/stubs/networkx/networkx/generators/community.pyi b/stubs/networkx/networkx/generators/community.pyi index 33a1439489a0..2126a6f302c6 100644 --- a/stubs/networkx/networkx/generators/community.pyi +++ b/stubs/networkx/networkx/generators/community.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Collection from networkx.classes.digraph import DiGraph diff --git a/stubs/networkx/networkx/generators/directed.pyi b/stubs/networkx/networkx/generators/directed.pyi index b2e6accdd34b..ea8fe7c8efd8 100644 --- a/stubs/networkx/networkx/generators/directed.pyi +++ b/stubs/networkx/networkx/generators/directed.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from networkx.classes.digraph import DiGraph diff --git a/stubs/networkx/networkx/generators/duplication.pyi b/stubs/networkx/networkx/generators/duplication.pyi index 25e5ccfa6fb9..b5016e441eaa 100644 --- a/stubs/networkx/networkx/generators/duplication.pyi +++ b/stubs/networkx/networkx/generators/duplication.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/generators/ego.pyi b/stubs/networkx/networkx/generators/ego.pyi index 703d7473aaef..1616894d98cc 100644 --- a/stubs/networkx/networkx/generators/ego.pyi +++ b/stubs/networkx/networkx/generators/ego.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/generators/expanders.pyi b/stubs/networkx/networkx/generators/expanders.pyi index 7d840e6793b0..2c2fc457e9a5 100644 --- a/stubs/networkx/networkx/generators/expanders.pyi +++ b/stubs/networkx/networkx/generators/expanders.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing_extensions import deprecated from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/generators/geometric.pyi b/stubs/networkx/networkx/generators/geometric.pyi index 5e1c7fbefa27..9bd5016147b8 100644 --- a/stubs/networkx/networkx/generators/geometric.pyi +++ b/stubs/networkx/networkx/generators/geometric.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Iterable from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/generators/internet_as_graphs.pyi b/stubs/networkx/networkx/generators/internet_as_graphs.pyi index a7551205b9a6..bb8778174463 100644 --- a/stubs/networkx/networkx/generators/internet_as_graphs.pyi +++ b/stubs/networkx/networkx/generators/internet_as_graphs.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Mapping from networkx.classes.graph import Graph diff --git a/stubs/networkx/networkx/generators/intersection.pyi b/stubs/networkx/networkx/generators/intersection.pyi index 14aecc5e593f..d9d1970bf37b 100644 --- a/stubs/networkx/networkx/generators/intersection.pyi +++ b/stubs/networkx/networkx/generators/intersection.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from networkx.utils.backends import _dispatchable __all__ = ["uniform_random_intersection_graph", "k_random_intersection_graph", "general_random_intersection_graph"] diff --git a/stubs/networkx/networkx/generators/lattice.pyi b/stubs/networkx/networkx/generators/lattice.pyi index 5edccb05c375..fe2c3468bdeb 100644 --- a/stubs/networkx/networkx/generators/lattice.pyi +++ b/stubs/networkx/networkx/generators/lattice.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable from networkx.classes.graph import Graph @@ -12,7 +11,9 @@ def grid_2d_graph( m, n, periodic: bool = False, create_using: Graph[Incomplete] | type[Graph[Incomplete]] | None = None ) -> Graph[Incomplete]: ... @_dispatchable -def grid_graph(dim: list[FloatInt] | tuple[FloatInt, ...] | Iterable[Incomplete], periodic: bool = False) -> Graph[Incomplete]: ... +def grid_graph( + dim: list[FloatInt] | tuple[FloatInt, ...] | Iterable[Incomplete], periodic: bool = False +) -> Graph[Incomplete]: ... @_dispatchable def hypercube_graph(n: int) -> Graph[Incomplete]: ... @_dispatchable diff --git a/stubs/networkx/networkx/generators/random_graphs.pyi b/stubs/networkx/networkx/generators/random_graphs.pyi index da952395a0a0..d865fc64eec6 100644 --- a/stubs/networkx/networkx/generators/random_graphs.pyi +++ b/stubs/networkx/networkx/generators/random_graphs.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Iterable from typing_extensions import deprecated @@ -59,7 +58,9 @@ def dual_barabasi_albert_graph( n: int, m1: int, m2: int, p: FloatInt, seed=None, initial_graph: Graph[Incomplete] | None = None, *, create_using=None ) -> Graph[Incomplete]: ... @_dispatchable -def extended_barabasi_albert_graph(n: int, m: int, p: FloatInt, q: FloatInt, seed=None, *, create_using=None) -> Graph[Incomplete]: ... +def extended_barabasi_albert_graph( + n: int, m: int, p: FloatInt, q: FloatInt, seed=None, *, create_using=None +) -> Graph[Incomplete]: ... @_dispatchable def powerlaw_cluster_graph(n: int, m: int, p: FloatInt, seed=None, *, create_using=None): ... @_dispatchable diff --git a/stubs/networkx/networkx/generators/spectral_graph_forge.pyi b/stubs/networkx/networkx/generators/spectral_graph_forge.pyi index eb96ba759d27..d3cbf13eca86 100644 --- a/stubs/networkx/networkx/generators/spectral_graph_forge.pyi +++ b/stubs/networkx/networkx/generators/spectral_graph_forge.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from networkx.classes.graph import Graph, _Node from networkx.utils.backends import _dispatchable diff --git a/stubs/networkx/networkx/linalg/spectrum.pyi b/stubs/networkx/networkx/linalg/spectrum.pyi index 6ef6232f90ba..381b203ad642 100644 --- a/stubs/networkx/networkx/linalg/spectrum.pyi +++ b/stubs/networkx/networkx/linalg/spectrum.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + import numpy as np from networkx._typing import Array1D from networkx.classes.graph import Graph, _Node diff --git a/stubs/networkx/networkx/utils/random_sequence.pyi b/stubs/networkx/networkx/utils/random_sequence.pyi index 1b972020d57a..1d415b9afd31 100644 --- a/stubs/networkx/networkx/utils/random_sequence.pyi +++ b/stubs/networkx/networkx/utils/random_sequence.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable __all__ = [ diff --git a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi index 35ebdb7ac647..66cc761e1009 100644 --- a/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi +++ b/stubs/oauthlib/oauthlib/oauth2/rfc6749/clients/service_application.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from .base import Client, _TokenPlacement diff --git a/stubs/openpyxl/openpyxl/cell/cell.pyi b/stubs/openpyxl/openpyxl/cell/cell.pyi index 2220ca35174e..7cc1a885e1d0 100644 --- a/stubs/openpyxl/openpyxl/cell/cell.pyi +++ b/stubs/openpyxl/openpyxl/cell/cell.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from datetime import datetime from re import Pattern from typing import Final, Literal, overload diff --git a/stubs/openpyxl/openpyxl/chart/_3d.pyi b/stubs/openpyxl/openpyxl/chart/_3d.pyi index 728203b6731a..7ab86e8aa97f 100644 --- a/stubs/openpyxl/openpyxl/chart/_3d.pyi +++ b/stubs/openpyxl/openpyxl/chart/_3d.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Unused from typing import ClassVar, Literal from openpyxl.chart.picture import PictureOptions diff --git a/stubs/openpyxl/openpyxl/chart/_chart.pyi b/stubs/openpyxl/openpyxl/chart/_chart.pyi index 3206a68223f7..e4abbdce36fe 100644 --- a/stubs/openpyxl/openpyxl/chart/_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/_chart.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToInt, Incomplete, Unused +from _typeshed import ConvertibleToInt, FloatInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.chart.layout import Layout diff --git a/stubs/openpyxl/openpyxl/chart/axis.pyi b/stubs/openpyxl/openpyxl/chart/axis.pyi index 563ce3df52d1..53509b3b0ce6 100644 --- a/stubs/openpyxl/openpyxl/chart/axis.pyi +++ b/stubs/openpyxl/openpyxl/chart/axis.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload from typing_extensions import Self diff --git a/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi b/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi index 7a120a5fc1cd..33bdcba91a23 100644 --- a/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, Incomplete, Unused +from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.chart.axis import NumericAxis diff --git a/stubs/openpyxl/openpyxl/chart/chartspace.pyi b/stubs/openpyxl/openpyxl/chart/chartspace.pyi index 88d06f72b104..4d3f78aac998 100644 --- a/stubs/openpyxl/openpyxl/chart/chartspace.pyi +++ b/stubs/openpyxl/openpyxl/chart/chartspace.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, Incomplete, Unused +from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload from openpyxl.chart._3d import Surface, View3D diff --git a/stubs/openpyxl/openpyxl/chart/layout.pyi b/stubs/openpyxl/openpyxl/chart/layout.pyi index 4131e189be71..104df0760512 100644 --- a/stubs/openpyxl/openpyxl/chart/layout.pyi +++ b/stubs/openpyxl/openpyxl/chart/layout.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, Unused +from _typeshed import ConvertibleToFloat, FloatInt, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Typed diff --git a/stubs/openpyxl/openpyxl/chart/marker.pyi b/stubs/openpyxl/openpyxl/chart/marker.pyi index 953685ed1292..cb3f9279d392 100644 --- a/stubs/openpyxl/openpyxl/chart/marker.pyi +++ b/stubs/openpyxl/openpyxl/chart/marker.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.chart.picture import PictureOptions diff --git a/stubs/openpyxl/openpyxl/chart/pie_chart.pyi b/stubs/openpyxl/openpyxl/chart/pie_chart.pyi index 488987cca7b5..8fcaea4774ce 100644 --- a/stubs/openpyxl/openpyxl/chart/pie_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/pie_chart.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, Incomplete, Unused +from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.chart.axis import ChartLines diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index 7081215aba01..2e9b58890468 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, ReadableBuffer, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, ReadableBuffer, Unused from collections.abc import Iterable, Sized from datetime import datetime from re import Pattern @@ -117,7 +116,9 @@ class Convertible(Typed[_T, _N]): self: Convertible[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None ) -> None: ... @overload - def __set__(self: Convertible[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... + def __set__( + self: Convertible[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat + ) -> None: ... # Anything else @overload def __set__(self: Convertible[_T, Literal[True]], instance: Serialisable | Strict, value: _T | int | Any | None) -> None: ... @@ -133,12 +134,20 @@ class Max(Convertible[_M, _N]): ) -> None: ... @overload def __init__( - self: Max[int, Literal[False]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, max: FloatInt + self: Max[int, Literal[False]], + *, + expected_type: _ExpectedTypeParam[int], + allow_none: Literal[False] = False, + max: FloatInt, ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: Max[FloatInt, Literal[True]], *, expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[True], max: FloatInt + self: Max[FloatInt, Literal[True]], + *, + expected_type: _ExpectedTypeParam[FloatInt] = ..., + allow_none: Literal[True], + max: FloatInt, ) -> None: ... @overload def __init__( @@ -154,7 +163,9 @@ class Max(Convertible[_M, _N]): @overload def __set__(self: Max[int, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToInt) -> None: ... @overload - def __set__(self: Max[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None) -> None: ... + def __set__( + self: Max[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None + ) -> None: ... @overload def __set__(self: Max[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... @@ -169,12 +180,20 @@ class Min(Convertible[_M, _N]): ) -> None: ... @overload def __init__( - self: Min[int, Literal[False]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, min: FloatInt + self: Min[int, Literal[False]], + *, + expected_type: _ExpectedTypeParam[int], + allow_none: Literal[False] = False, + min: FloatInt, ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: Min[FloatInt, Literal[True]], *, expected_type: _ExpectedTypeParam[FloatInt] = ..., allow_none: Literal[True], min: FloatInt + self: Min[FloatInt, Literal[True]], + *, + expected_type: _ExpectedTypeParam[FloatInt] = ..., + allow_none: Literal[True], + min: FloatInt, ) -> None: ... @overload def __init__( @@ -190,7 +209,9 @@ class Min(Convertible[_M, _N]): @overload def __set__(self: Min[int, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToInt) -> None: ... @overload - def __set__(self: Min[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None) -> None: ... + def __set__( + self: Min[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None + ) -> None: ... @overload def __set__(self: Min[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... diff --git a/stubs/openpyxl/openpyxl/descriptors/excel.pyi b/stubs/openpyxl/openpyxl/descriptors/excel.pyi index 445afca4e335..90c32e0867a1 100644 --- a/stubs/openpyxl/openpyxl/descriptors/excel.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/excel.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import ClassVar, Literal from . import Integer, MatchPattern, MinMax, Strict, String diff --git a/stubs/openpyxl/openpyxl/descriptors/nested.pyi b/stubs/openpyxl/openpyxl/descriptors/nested.pyi index 0ff84c27c430..1f48fd84192c 100644 --- a/stubs/openpyxl/openpyxl/descriptors/nested.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/nested.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Unused from collections.abc import Iterable from typing import Any, ClassVar, Literal, TypeAlias, overload from typing_extensions import Never diff --git a/stubs/openpyxl/openpyxl/drawing/colors.pyi b/stubs/openpyxl/openpyxl/drawing/colors.pyi index 58cfc017c81d..ddbd44045fe2 100644 --- a/stubs/openpyxl/openpyxl/drawing/colors.pyi +++ b/stubs/openpyxl/openpyxl/drawing/colors.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete from typing import ClassVar, Final, Literal, TypeAlias, overload from openpyxl.descriptors import Strict, Typed diff --git a/stubs/openpyxl/openpyxl/drawing/fill.pyi b/stubs/openpyxl/openpyxl/drawing/fill.pyi index 5963d0d98062..a5e8b3315d70 100644 --- a/stubs/openpyxl/openpyxl/drawing/fill.pyi +++ b/stubs/openpyxl/openpyxl/drawing/fill.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete from typing import ClassVar, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Bool, Integer, MinMax, NoneSet, Set, Typed, _ConvertibleToBool diff --git a/stubs/openpyxl/openpyxl/drawing/geometry.pyi b/stubs/openpyxl/openpyxl/drawing/geometry.pyi index 4881295149ec..c05bb2e54a8c 100644 --- a/stubs/openpyxl/openpyxl/drawing/geometry.pyi +++ b/stubs/openpyxl/openpyxl/drawing/geometry.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload from openpyxl.descriptors.base import Alias, Bool, Float, Integer, MinMax, NoneSet, Set, String, Typed, _ConvertibleToBool diff --git a/stubs/openpyxl/openpyxl/drawing/line.pyi b/stubs/openpyxl/openpyxl/drawing/line.pyi index d34283e8df59..17ddab0dde60 100644 --- a/stubs/openpyxl/openpyxl/drawing/line.pyi +++ b/stubs/openpyxl/openpyxl/drawing/line.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Integer, MinMax, NoneSet, Typed, _ConvertibleToBool diff --git a/stubs/openpyxl/openpyxl/drawing/text.pyi b/stubs/openpyxl/openpyxl/drawing/text.pyi index f5815932bc59..24b64c6c9ab9 100644 --- a/stubs/openpyxl/openpyxl/drawing/text.pyi +++ b/stubs/openpyxl/openpyxl/drawing/text.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Bool, Integer, MinMax, NoneSet, Set, String, Typed, _ConvertibleToBool diff --git a/stubs/openpyxl/openpyxl/styles/alignment.pyi b/stubs/openpyxl/openpyxl/styles/alignment.pyi index f7079fc8c542..e372ab523722 100644 --- a/stubs/openpyxl/openpyxl/styles/alignment.pyi +++ b/stubs/openpyxl/openpyxl/styles/alignment.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat +from _typeshed import ConvertibleToFloat, FloatInt from collections.abc import Iterator from typing import ClassVar, Final, Literal, TypeAlias diff --git a/stubs/openpyxl/openpyxl/styles/colors.pyi b/stubs/openpyxl/openpyxl/styles/colors.pyi index 822e90b67228..fcadccd51002 100644 --- a/stubs/openpyxl/openpyxl/styles/colors.pyi +++ b/stubs/openpyxl/openpyxl/styles/colors.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused from collections.abc import Iterator from re import Pattern from typing import ClassVar, Final, Literal, TypeVar, overload diff --git a/stubs/openpyxl/openpyxl/styles/fills.pyi b/stubs/openpyxl/openpyxl/styles/fills.pyi index 05a020279bef..05fb3843a895 100644 --- a/stubs/openpyxl/openpyxl/styles/fills.pyi +++ b/stubs/openpyxl/openpyxl/styles/fills.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, Incomplete, Unused +from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, Unused from collections.abc import Iterable, Iterator, Sequence as ABCSequence from typing import ClassVar, Final, Literal, TypeAlias diff --git a/stubs/openpyxl/openpyxl/styles/fonts.pyi b/stubs/openpyxl/openpyxl/styles/fonts.pyi index 1f3515b6ece6..22d09444666d 100644 --- a/stubs/openpyxl/openpyxl/styles/fonts.pyi +++ b/stubs/openpyxl/openpyxl/styles/fonts.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt from typing import ClassVar, Final, Literal, TypeAlias from typing_extensions import Self diff --git a/stubs/openpyxl/openpyxl/worksheet/filters.pyi b/stubs/openpyxl/openpyxl/worksheet/filters.pyi index 06833df12258..cb848107b6a9 100644 --- a/stubs/openpyxl/openpyxl/worksheet/filters.pyi +++ b/stubs/openpyxl/openpyxl/worksheet/filters.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused from datetime import datetime from typing import ClassVar, Final, Literal, TypeAlias, overload diff --git a/stubs/paramiko/paramiko/channel.pyi b/stubs/paramiko/paramiko/channel.pyi index 0bdf5f7035b7..5c790ffcc507 100644 --- a/stubs/paramiko/paramiko/channel.pyi +++ b/stubs/paramiko/paramiko/channel.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsItems +from _typeshed import FloatInt, SupportsItems from collections.abc import Callable from logging import Logger from threading import Condition, Event, Lock diff --git a/stubs/paramiko/paramiko/client.pyi b/stubs/paramiko/paramiko/client.pyi index 283ec7d360a4..2c0d8709a81e 100644 --- a/stubs/paramiko/paramiko/client.pyi +++ b/stubs/paramiko/paramiko/client.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptorOrPath +from _typeshed import FileDescriptorOrPath, FloatInt from collections.abc import Iterable, Mapping from typing import Protocol, type_check_only from typing_extensions import Never diff --git a/stubs/paramiko/paramiko/common.pyi b/stubs/paramiko/paramiko/common.pyi index 285cec219451..378cf79f1a03 100644 --- a/stubs/paramiko/paramiko/common.pyi +++ b/stubs/paramiko/paramiko/common.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import logging +from _typeshed import FloatInt from typing import Final def byte_ord(c: int | str) -> int: ... diff --git a/stubs/paramiko/paramiko/packet.pyi b/stubs/paramiko/paramiko/packet.pyi index d93b254ffb7c..c11d26eff28f 100644 --- a/stubs/paramiko/paramiko/packet.pyi +++ b/stubs/paramiko/paramiko/packet.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections.abc import Callable from hashlib import _Hash from logging import Logger diff --git a/stubs/paramiko/paramiko/proxy.pyi b/stubs/paramiko/paramiko/proxy.pyi index b3eae8947db3..135804f82f97 100644 --- a/stubs/paramiko/paramiko/proxy.pyi +++ b/stubs/paramiko/paramiko/proxy.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from subprocess import Popen from typing import Any diff --git a/stubs/paramiko/paramiko/sftp_client.pyi b/stubs/paramiko/paramiko/sftp_client.pyi index 0a0ede9ac5f0..63dd75ff39b5 100644 --- a/stubs/paramiko/paramiko/sftp_client.pyi +++ b/stubs/paramiko/paramiko/sftp_client.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import StrOrBytesPath +from _typeshed import FloatInt, StrOrBytesPath from collections.abc import Callable, Iterator from logging import Logger from typing import IO, TypeAlias diff --git a/stubs/paramiko/paramiko/transport.pyi b/stubs/paramiko/paramiko/transport.pyi index 5b46f586194f..78339eeaf0c0 100644 --- a/stubs/paramiko/paramiko/transport.pyi +++ b/stubs/paramiko/paramiko/transport.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptorOrPath +from _typeshed import FileDescriptorOrPath, FloatInt from collections.abc import Callable, Iterable, Mapping, Sequence from logging import Logger from socket import socket diff --git a/stubs/parsimonious/parsimonious/expressions.pyi b/stubs/parsimonious/parsimonious/expressions.pyi index f17da85038ab..b720b9dd1779 100644 --- a/stubs/parsimonious/parsimonious/expressions.pyi +++ b/stubs/parsimonious/parsimonious/expressions.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import collections.abc +from _typeshed import FloatInt from collections.abc import Callable, Mapping from re import Pattern from typing import Any, TypeAlias diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi index b8cd08e556c8..941809bbd55e 100644 --- a/stubs/peewee/peewee.pyi +++ b/stubs/peewee/peewee.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import re import threading -from _typeshed import Incomplete, SupportsKeysAndGetItem +from _typeshed import FloatInt, Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Generator, Iterable, Iterator from datetime import date, datetime, time from decimal import Decimal diff --git a/stubs/pexpect/pexpect/_async.pyi b/stubs/pexpect/pexpect/_async.pyi index 3ef7f209566b..aa2522777edf 100644 --- a/stubs/pexpect/pexpect/_async.pyi +++ b/stubs/pexpect/pexpect/_async.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import asyncio +from _typeshed import FloatInt from typing import AnyStr, Generic from .expect import Expecter diff --git a/stubs/pexpect/pexpect/expect.pyi b/stubs/pexpect/pexpect/expect.pyi index ebbf7b2dbe5f..ae35378a45dd 100644 --- a/stubs/pexpect/pexpect/expect.pyi +++ b/stubs/pexpect/pexpect/expect.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import re +from _typeshed import FloatInt from collections.abc import Iterable from typing import AnyStr, Generic diff --git a/stubs/pexpect/pexpect/fdpexpect.pyi b/stubs/pexpect/pexpect/fdpexpect.pyi index 93abd6201b34..8a05b99f8207 100644 --- a/stubs/pexpect/pexpect/fdpexpect.pyi +++ b/stubs/pexpect/pexpect/fdpexpect.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptorLike +from _typeshed import FileDescriptorLike, FloatInt from collections.abc import Iterable from typing import AnyStr diff --git a/stubs/pexpect/pexpect/popen_spawn.pyi b/stubs/pexpect/pexpect/popen_spawn.pyi index 5ea4696f758e..42460e562d20 100644 --- a/stubs/pexpect/pexpect/popen_spawn.pyi +++ b/stubs/pexpect/pexpect/popen_spawn.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import subprocess -from _typeshed import StrOrBytesPath +from _typeshed import FloatInt, StrOrBytesPath from collections.abc import Callable from typing import AnyStr diff --git a/stubs/pexpect/pexpect/pty_spawn.pyi b/stubs/pexpect/pexpect/pty_spawn.pyi index 1502fd24e646..c80a31a63f97 100644 --- a/stubs/pexpect/pexpect/pty_spawn.pyi +++ b/stubs/pexpect/pexpect/pty_spawn.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptorOrPath +from _typeshed import FileDescriptorOrPath, FloatInt from collections.abc import Callable, Mapping from typing import AnyStr diff --git a/stubs/pexpect/pexpect/pxssh.pyi b/stubs/pexpect/pexpect/pxssh.pyi index 1a35266fb8ab..f3da71b83924 100644 --- a/stubs/pexpect/pexpect/pxssh.pyi +++ b/stubs/pexpect/pexpect/pxssh.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptorOrPath +from _typeshed import FileDescriptorOrPath, FloatInt from collections.abc import Mapping from typing import AnyStr, Literal diff --git a/stubs/pexpect/pexpect/replwrap.pyi b/stubs/pexpect/pexpect/replwrap.pyi index 1b1c8ade32d9..4f14de39e42f 100644 --- a/stubs/pexpect/pexpect/replwrap.pyi +++ b/stubs/pexpect/pexpect/replwrap.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete PY3: Incomplete basestring = str diff --git a/stubs/pexpect/pexpect/run.pyi b/stubs/pexpect/pexpect/run.pyi index 09978570bd35..c1dd27236808 100644 --- a/stubs/pexpect/pexpect/run.pyi +++ b/stubs/pexpect/pexpect/run.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import FileDescriptorOrPath +from _typeshed import FileDescriptorOrPath, FloatInt from collections.abc import Mapping from typing import AnyStr diff --git a/stubs/pexpect/pexpect/spawnbase.pyi b/stubs/pexpect/pexpect/spawnbase.pyi index 5ad178ad9e5e..b48a2a461350 100644 --- a/stubs/pexpect/pexpect/spawnbase.pyi +++ b/stubs/pexpect/pexpect/spawnbase.pyi @@ -141,7 +141,9 @@ class SpawnBase(Generic[AnyStr]): async_: Literal[True], ) -> Awaitable[int]: ... - def expect_loop(self, searcher: _Searcher[AnyStr], timeout: FloatInt | None = -1, searchwindowsize: int | None = -1) -> int: ... + def expect_loop( + self, searcher: _Searcher[AnyStr], timeout: FloatInt | None = -1, searchwindowsize: int | None = -1 + ) -> int: ... def read(self, size: int = -1) -> AnyStr: ... def readline(self, size: int = -1) -> AnyStr: ... def __iter__(self): ... diff --git a/stubs/pika/pika/adapters/asyncio_connection.pyi b/stubs/pika/pika/adapters/asyncio_connection.pyi index 01f640fd0783..8793f036b0c9 100644 --- a/stubs/pika/pika/adapters/asyncio_connection.pyi +++ b/stubs/pika/pika/adapters/asyncio_connection.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import asyncio -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Sequence from logging import Logger from typing_extensions import Self diff --git a/stubs/pika/pika/adapters/blocking_connection.pyi b/stubs/pika/pika/adapters/blocking_connection.pyi index ec4c8bdad001..6245e72640f9 100644 --- a/stubs/pika/pika/adapters/blocking_connection.pyi +++ b/stubs/pika/pika/adapters/blocking_connection.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections import deque from collections.abc import Callable, Generator, Mapping, Sequence from logging import Logger diff --git a/stubs/pika/pika/adapters/select_connection.pyi b/stubs/pika/pika/adapters/select_connection.pyi index 637345e7681f..541a9f462c5d 100644 --- a/stubs/pika/pika/adapters/select_connection.pyi +++ b/stubs/pika/pika/adapters/select_connection.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import abc import select +from _typeshed import FloatInt from collections.abc import Callable, Sequence from logging import Logger from typing import ClassVar, Final, Literal, TypeAlias, TypedDict diff --git a/stubs/pika/pika/adapters/utils/nbio_interface.pyi b/stubs/pika/pika/adapters/utils/nbio_interface.pyi index 6a63490f734d..d4af16f7f591 100644 --- a/stubs/pika/pika/adapters/utils/nbio_interface.pyi +++ b/stubs/pika/pika/adapters/utils/nbio_interface.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import abc +from _typeshed import FloatInt from collections.abc import Callable from socket import socket from ssl import SSLContext diff --git a/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi b/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi index 5a1019d8c954..db297c9d171c 100644 --- a/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi +++ b/stubs/pika/pika/adapters/utils/selector_ioloop_adapter.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import abc +from _typeshed import FloatInt from collections.abc import Callable from logging import Logger from typing import Final, Generic, Protocol, TypeVar, type_check_only diff --git a/stubs/pika/pika/connection.pyi b/stubs/pika/pika/connection.pyi index 83e2a2acb9fb..02a54ca9c82e 100644 --- a/stubs/pika/pika/connection.pyi +++ b/stubs/pika/pika/connection.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import abc import ssl -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from logging import Logger from typing import Final, Literal diff --git a/stubs/pony/pony/orm/dbapiprovider.pyi b/stubs/pony/pony/orm/dbapiprovider.pyi index c80378f9c5ea..f63c2c6dd4c0 100644 --- a/stubs/pony/pony/orm/dbapiprovider.pyi +++ b/stubs/pony/pony/orm/dbapiprovider.pyi @@ -1,8 +1,7 @@ -from _typeshed import FloatInt import json import re import types -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable from typing import ClassVar diff --git a/stubs/pony/pony/orm/dbproviders/sqlite.pyi b/stubs/pony/pony/orm/dbproviders/sqlite.pyi index 594504de25cc..0b35fd9c68fa 100644 --- a/stubs/pony/pony/orm/dbproviders/sqlite.pyi +++ b/stubs/pony/pony/orm/dbproviders/sqlite.pyi @@ -1,8 +1,7 @@ -from _typeshed import FloatInt import re import sys import types -from _typeshed import Incomplete, StrOrBytesPath +from _typeshed import FloatInt, Incomplete, StrOrBytesPath from sqlite3 import Connection as _Connection from typing import Any, ClassVar, overload diff --git a/stubs/pony/pony/utils/utils.pyi b/stubs/pony/pony/utils/utils.pyi index 6f50c3bba13c..a584dbc7e97f 100644 --- a/stubs/pony/pony/utils/utils.pyi +++ b/stubs/pony/pony/utils/utils.pyi @@ -1,9 +1,8 @@ -from _typeshed import FloatInt import ast import io import pickle import re -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from collections.abc import Callable, Iterable from datetime import datetime from threading import local as _localbase diff --git a/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi b/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi index c515a766ca89..94ef48ec939b 100644 --- a/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi +++ b/stubs/protobuf/google/protobuf/internal/testing_refleaks.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import OptExcInfo +from _typeshed import FloatInt, OptExcInfo from collections.abc import Callable from typing import TypeVar from unittest import TestCase as _TestCase, TestResult diff --git a/stubs/protobuf/google/protobuf/internal/well_known_types.pyi b/stubs/protobuf/google/protobuf/internal/well_known_types.pyi index cc3d7d1ace92..19f70150d0c8 100644 --- a/stubs/protobuf/google/protobuf/internal/well_known_types.pyi +++ b/stubs/protobuf/google/protobuf/internal/well_known_types.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsItems +from _typeshed import FloatInt, SupportsItems from collections.abc import Iterable, Iterator, KeysView, Mapping, Sequence from datetime import datetime, timedelta, tzinfo from typing import Any as tAny, TypeAlias diff --git a/stubs/protobuf/google/protobuf/internal/wire_format.pyi b/stubs/protobuf/google/protobuf/internal/wire_format.pyi index 1622982be2fb..924da1d5ee4a 100644 --- a/stubs/protobuf/google/protobuf/internal/wire_format.pyi +++ b/stubs/protobuf/google/protobuf/internal/wire_format.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from google.protobuf.message import Message TAG_TYPE_BITS: int diff --git a/stubs/psutil/psutil/__init__.pyi b/stubs/psutil/psutil/__init__.pyi index 68c33d9ab23c..d26f589d04c4 100644 --- a/stubs/psutil/psutil/__init__.pyi +++ b/stubs/psutil/psutil/__init__.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import Incomplete, StrOrBytesPath +from _typeshed import FloatInt, Incomplete, StrOrBytesPath from collections.abc import Callable, Collection, Iterable, Iterator from contextlib import AbstractContextManager from subprocess import _CMD, _ENV, _FILE diff --git a/stubs/psutil/psutil/_common.pyi b/stubs/psutil/psutil/_common.pyi index edfc586162f4..f716c28c9630 100644 --- a/stubs/psutil/psutil/_common.pyi +++ b/stubs/psutil/psutil/_common.pyi @@ -1,9 +1,8 @@ -from _typeshed import FloatInt import enum import io import sys import threading -from _typeshed import ConvertibleToFloat, FileDescriptorOrPath, Incomplete, StrOrBytesPath, SupportsWrite +from _typeshed import ConvertibleToFloat, FileDescriptorOrPath, FloatInt, Incomplete, StrOrBytesPath, SupportsWrite from collections import defaultdict from collections.abc import Callable from socket import AF_INET6 as AF_INET6, AddressFamily, SocketKind diff --git a/stubs/psutil/psutil/_ntuples.pyi b/stubs/psutil/psutil/_ntuples.pyi index b2444ba4ec55..4222846d99ff 100644 --- a/stubs/psutil/psutil/_ntuples.pyi +++ b/stubs/psutil/psutil/_ntuples.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from socket import AddressFamily, SocketKind from typing import Any, NamedTuple diff --git a/stubs/psutil/psutil/_psaix.pyi b/stubs/psutil/psutil/_psaix.pyi index e1fd1cb8e040..d2bb8c3b8ad3 100644 --- a/stubs/psutil/psutil/_psaix.pyi +++ b/stubs/psutil/psutil/_psaix.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt # sys.platform.startswith("aix"): if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin": diff --git a/stubs/psutil/psutil/_psbsd.pyi b/stubs/psutil/psutil/_psbsd.pyi index 1aceb127a1bc..7f5bed02c03a 100644 --- a/stubs/psutil/psutil/_psbsd.pyi +++ b/stubs/psutil/psutil/_psbsd.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt # sys.platform.startswith(("freebsd", "midnightbsd", "openbsd", "netbsd")): if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin": diff --git a/stubs/psutil/psutil/_pslinux.pyi b/stubs/psutil/psutil/_pslinux.pyi index 4c17811f5fc6..a90f331f0968 100644 --- a/stubs/psutil/psutil/_pslinux.pyi +++ b/stubs/psutil/psutil/_pslinux.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt if sys.platform == "linux": import enum diff --git a/stubs/psutil/psutil/_psosx.pyi b/stubs/psutil/psutil/_psosx.pyi index 4bd34899541c..6dab11a302c5 100644 --- a/stubs/psutil/psutil/_psosx.pyi +++ b/stubs/psutil/psutil/_psosx.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt if sys.platform == "darwin": from collections.abc import Callable diff --git a/stubs/psutil/psutil/_psposix.pyi b/stubs/psutil/psutil/_psposix.pyi index bd16b008846a..dbc8fd3f3e50 100644 --- a/stubs/psutil/psutil/_psposix.pyi +++ b/stubs/psutil/psutil/_psposix.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import enum import sys -from _typeshed import FileDescriptorOrPath, Incomplete, StrOrBytesPath, Unused +from _typeshed import FileDescriptorOrPath, FloatInt, Incomplete, StrOrBytesPath, Unused from collections.abc import Callable from . import _ntuples as ntp diff --git a/stubs/psutil/psutil/_pssunos.pyi b/stubs/psutil/psutil/_pssunos.pyi index 8d8155b3a0a5..76d97259310b 100644 --- a/stubs/psutil/psutil/_pssunos.pyi +++ b/stubs/psutil/psutil/_pssunos.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt # sys.platform.startswith(("sunos", "solaris")): if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin": diff --git a/stubs/psutil/psutil/_pswindows.pyi b/stubs/psutil/psutil/_pswindows.pyi index f0ac85815876..49b606e0e96a 100644 --- a/stubs/psutil/psutil/_pswindows.pyi +++ b/stubs/psutil/psutil/_pswindows.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt if sys.platform == "win32": import enum diff --git a/stubs/psycopg2/psycopg2/_psycopg.pyi b/stubs/psycopg2/psycopg2/_psycopg.pyi index 7897cea437ca..11a0d81d4167 100644 --- a/stubs/psycopg2/psycopg2/_psycopg.pyi +++ b/stubs/psycopg2/psycopg2/_psycopg.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime as dt -from _typeshed import ConvertibleToInt, Incomplete, SupportsRead, SupportsReadline, SupportsWrite, Unused +from _typeshed import ConvertibleToInt, FloatInt, Incomplete, SupportsRead, SupportsReadline, SupportsWrite, Unused from collections.abc import Callable, Iterable, Mapping, Sequence from types import TracebackType from typing import Any, Literal, Protocol, TextIO, TypeAlias, TypeVar, overload, type_check_only diff --git a/stubs/psycopg2/psycopg2/tz.pyi b/stubs/psycopg2/psycopg2/tz.pyi index 42cb04f0062a..7414b5a03225 100644 --- a/stubs/psycopg2/psycopg2/tz.pyi +++ b/stubs/psycopg2/psycopg2/tz.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from typing import Any from typing_extensions import Self diff --git a/stubs/pyaudio/pyaudio.pyi b/stubs/pyaudio/pyaudio.pyi index 9d226ea847ba..294514dfef3a 100644 --- a/stubs/pyaudio/pyaudio.pyi +++ b/stubs/pyaudio/pyaudio.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt from collections.abc import Callable, Mapping, Sequence from typing import ClassVar, Final, TypeAlias diff --git a/stubs/pycups/cups.pyi b/stubs/pycups/cups.pyi index 0f213dcb7c87..716646159772 100644 --- a/stubs/pycups/cups.pyi +++ b/stubs/pycups/cups.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Callable, Sequence from io import IOBase from typing import Final, Literal, TypeAlias, TypedDict, TypeVar, final, overload, type_check_only diff --git a/stubs/pycurl/pycurl/_pycurl.pyi b/stubs/pycurl/pycurl/_pycurl.pyi index ee268b691e18..812a77bd997d 100644 --- a/stubs/pycurl/pycurl/_pycurl.pyi +++ b/stubs/pycurl/pycurl/_pycurl.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt # Stub for the pycurl C extension (imported at runtime as `pycurl._pycurl`). import sys -from _typeshed import ReadableBuffer, Unused, WriteableBuffer +from _typeshed import FloatInt, ReadableBuffer, Unused, WriteableBuffer from collections.abc import Callable from datetime import datetime from types import TracebackType diff --git a/stubs/pyinstaller/PyInstaller/building/api.pyi b/stubs/pyinstaller/PyInstaller/building/api.pyi index 83159721257b..423bc7f870a9 100644 --- a/stubs/pyinstaller/PyInstaller/building/api.pyi +++ b/stubs/pyinstaller/PyInstaller/building/api.pyi @@ -1,10 +1,9 @@ -from _typeshed import FloatInt # PYZ, EXE and COLLECT referenced in https://pyinstaller.org/en/stable/spec-files.html#spec-file-operation # MERGE is referenced in https://pyinstaller.org/en/stable/spec-files.html#example-merge-spec-file # hide_console referenced in https://pyinstaller.org/en/stable/feature-notes.html#automatic-hiding-and-minimization-of-console-window-under-windows # Not to be imported during runtime, but is the type reference for spec files which are executed as python code import sys -from _typeshed import FileDescriptorOrPath, StrOrBytesPath, StrPath, Unused +from _typeshed import FileDescriptorOrPath, FloatInt, StrOrBytesPath, StrPath, Unused from collections.abc import Iterable, Mapping, Sequence from types import CodeType from typing import ClassVar, Final, Literal, TypeAlias diff --git a/stubs/pyinstaller/PyInstaller/compat.pyi b/stubs/pyinstaller/PyInstaller/compat.pyi index 3137c2a7ba76..f948e13904fa 100644 --- a/stubs/pyinstaller/PyInstaller/compat.pyi +++ b/stubs/pyinstaller/PyInstaller/compat.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt # https://pyinstaller.org/en/stable/hooks.html#module-PyInstaller.compat -from _typeshed import FileDescriptorOrPath +from _typeshed import FileDescriptorOrPath, FloatInt from collections.abc import Iterable from types import ModuleType from typing import Final, Literal, overload diff --git a/stubs/pyluach/pyluach/dates.pyi b/stubs/pyluach/pyluach/dates.pyi index 2a7aa00a4bb2..73ac3c4d7df2 100644 --- a/stubs/pyluach/pyluach/dates.pyi +++ b/stubs/pyluach/pyluach/dates.pyi @@ -1,7 +1,7 @@ -from _typeshed import FloatInt import abc import builtins import datetime +from _typeshed import FloatInt from collections.abc import Generator from enum import Enum from typing import TypedDict, overload, type_check_only diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index d56137eec766..e4a4c19edf49 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import threading -from _typeshed import OptExcInfo +from _typeshed import FloatInt, OptExcInfo from collections.abc import Callable from queue import Queue from types import ModuleType, TracebackType diff --git a/stubs/pynput/pynput/keyboard/__init__.pyi b/stubs/pynput/pynput/keyboard/__init__.pyi index 74b2b1582a1c..a830e51db97e 100644 --- a/stubs/pynput/pynput/keyboard/__init__.pyi +++ b/stubs/pynput/pynput/keyboard/__init__.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsItems +from _typeshed import FloatInt, SupportsItems from collections.abc import Callable from typing import Any diff --git a/stubs/pyogrio/pyogrio/geopandas.pyi b/stubs/pyogrio/pyogrio/geopandas.pyi index 5fc95f30983c..7c2950b8e033 100644 --- a/stubs/pyogrio/pyogrio/geopandas.pyi +++ b/stubs/pyogrio/pyogrio/geopandas.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import os +from _typeshed import FloatInt from collections.abc import Collection, Mapping from typing import Any, Literal, overload diff --git a/stubs/pyserial/serial/__init__.pyi b/stubs/pyserial/serial/__init__.pyi index 0d2238f89fc6..16b1ac59880b 100644 --- a/stubs/pyserial/serial/__init__.pyi +++ b/stubs/pyserial/serial/__init__.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt from serial.serialutil import * diff --git a/stubs/pyserial/serial/rfc2217.pyi b/stubs/pyserial/serial/rfc2217.pyi index f982f5cf4a89..d9749702cebf 100644 --- a/stubs/pyserial/serial/rfc2217.pyi +++ b/stubs/pyserial/serial/rfc2217.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import logging -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from collections.abc import Callable, Generator from typing import Any diff --git a/stubs/pyserial/serial/rs485.pyi b/stubs/pyserial/serial/rs485.pyi index d8d82a6057fb..c849820958ef 100644 --- a/stubs/pyserial/serial/rs485.pyi +++ b/stubs/pyserial/serial/rs485.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + import serial class RS485Settings: diff --git a/stubs/pyserial/serial/serialposix.pyi b/stubs/pyserial/serial/serialposix.pyi index 876483552466..9e3e279980e7 100644 --- a/stubs/pyserial/serial/serialposix.pyi +++ b/stubs/pyserial/serial/serialposix.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from typing_extensions import Never from serial.serialutil import SerialBase diff --git a/stubs/pyserial/serial/serialutil.pyi b/stubs/pyserial/serial/serialutil.pyi index 835373bd2cb3..04a0dbb78de8 100644 --- a/stubs/pyserial/serial/serialutil.pyi +++ b/stubs/pyserial/serial/serialutil.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import io -from _typeshed import ReadableBuffer, WriteableBuffer +from _typeshed import FloatInt, ReadableBuffer, WriteableBuffer from abc import abstractmethod from collections.abc import Callable, Generator from typing import Any, Final diff --git a/stubs/pyserial/serial/urlhandler/protocol_socket.pyi b/stubs/pyserial/serial/urlhandler/protocol_socket.pyi index aed50b1b9e89..ebed8bedb41a 100644 --- a/stubs/pyserial/serial/urlhandler/protocol_socket.pyi +++ b/stubs/pyserial/serial/urlhandler/protocol_socket.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import logging -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from serial.serialutil import SerialBase diff --git a/stubs/python-dateutil/dateutil/tz/tz.pyi b/stubs/python-dateutil/dateutil/tz/tz.pyi index 3ca2b0b8e432..294e5d98e55d 100644 --- a/stubs/python-dateutil/dateutil/tz/tz.pyi +++ b/stubs/python-dateutil/dateutil/tz/tz.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import Unused +from _typeshed import FloatInt, Unused from datetime import datetime, timedelta, tzinfo from typing import Any, ClassVar, Literal, Protocol, TypeVar, type_check_only from typing_extensions import Self diff --git a/stubs/python-jenkins/jenkins/__init__.pyi b/stubs/python-jenkins/jenkins/__init__.pyi index 5af60944671f..b5a0eaec1a96 100644 --- a/stubs/python-jenkins/jenkins/__init__.pyi +++ b/stubs/python-jenkins/jenkins/__init__.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Mapping, MutableMapping, Sequence from re import Pattern from typing import Any, Final, Literal, TypeAlias, TypedDict, overload, type_check_only diff --git a/stubs/python-xlib/Xlib/ext/nvcontrol.pyi b/stubs/python-xlib/Xlib/ext/nvcontrol.pyi index 99ed117dca29..9de75b964676 100644 --- a/stubs/python-xlib/Xlib/ext/nvcontrol.pyi +++ b/stubs/python-xlib/Xlib/ext/nvcontrol.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Unused +from _typeshed import FloatInt, Unused from typing import Final from Xlib.display import Display diff --git a/stubs/python-xlib/Xlib/ext/xinput.pyi b/stubs/python-xlib/Xlib/ext/xinput.pyi index 2ef87721a5e3..e5b2632a871b 100644 --- a/stubs/python-xlib/Xlib/ext/xinput.pyi +++ b/stubs/python-xlib/Xlib/ext/xinput.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToFloat, SliceableBuffer, Unused +from _typeshed import ConvertibleToFloat, FloatInt, SliceableBuffer, Unused from collections.abc import Iterable, Sequence from typing import Final, TypeVar @@ -183,7 +182,12 @@ def get_device_property( class XIChangeProperty(rq.Request): ... def change_device_property( - self: Display | resource.Resource, deviceid: int, property: int, type: int, mode: int, value: Sequence[FloatInt] | Sequence[str] + self: Display | resource.Resource, + deviceid: int, + property: int, + type: int, + mode: int, + value: Sequence[FloatInt] | Sequence[str], ) -> XIChangeProperty: ... class XIDeleteProperty(rq.Request): ... diff --git a/stubs/python-xlib/Xlib/protocol/rq.pyi b/stubs/python-xlib/Xlib/protocol/rq.pyi index 682371f6f3b9..118b99210db2 100644 --- a/stubs/python-xlib/Xlib/protocol/rq.pyi +++ b/stubs/python-xlib/Xlib/protocol/rq.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToInt, SliceableBuffer, Unused +from _typeshed import ConvertibleToInt, FloatInt, SliceableBuffer, Unused from array import array # Avoid name collision with List.type diff --git a/stubs/pytz/pytz/reference.pyi b/stubs/pytz/pytz/reference.pyi index ef286d17ff04..123586b25c61 100644 --- a/stubs/pytz/pytz/reference.pyi +++ b/stubs/pytz/pytz/reference.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from pytz import UTC as UTC diff --git a/stubs/pywin32/_win32typing.pyi b/stubs/pywin32/_win32typing.pyi index a8d05e1c6b0d..eff67334c240 100644 --- a/stubs/pywin32/_win32typing.pyi +++ b/stubs/pywin32/_win32typing.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt # Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module. -from _typeshed import Incomplete, ReadableBuffer, Unused +from _typeshed import FloatInt, Incomplete, ReadableBuffer, Unused from collections.abc import Callable, Iterable, Sequence from typing import Literal, SupportsIndex, TypeAlias, TypedDict, final, overload, type_check_only from typing_extensions import Never, NotRequired, Required, Self, deprecated, disjoint_base diff --git a/stubs/pywin32/win32/win32api.pyi b/stubs/pywin32/win32/win32api.pyi index 4f746f6e6d77..6b0a3ee978de 100644 --- a/stubs/pywin32/win32/win32api.pyi +++ b/stubs/pywin32/win32/win32api.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections.abc import Callable, Iterable from typing import Literal, TypedDict, overload, type_check_only from typing_extensions import deprecated diff --git a/stubs/pywin32/win32/win32gui.pyi b/stubs/pywin32/win32/win32gui.pyi index 55948cd24ca3..748f89c8fd90 100644 --- a/stubs/pywin32/win32/win32gui.pyi +++ b/stubs/pywin32/win32/win32gui.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer, WriteableBuffer from collections.abc import Callable, Iterable from typing import Any, Literal, TypeAlias, TypeVar diff --git a/stubs/pyxdg/xdg/IconTheme.pyi b/stubs/pyxdg/xdg/IconTheme.pyi index 790091eaffda..e9a2a71c581e 100644 --- a/stubs/pyxdg/xdg/IconTheme.pyi +++ b/stubs/pyxdg/xdg/IconTheme.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import StrPath +from _typeshed import FloatInt, StrPath from collections.abc import Collection from xdg.IniFile import IniFile diff --git a/stubs/qrbill/qrbill/bill.pyi b/stubs/qrbill/qrbill/bill.pyi index f55365724d48..d7c603f1b43d 100644 --- a/stubs/qrbill/qrbill/bill.pyi +++ b/stubs/qrbill/qrbill/bill.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsWrite +from _typeshed import FloatInt, SupportsWrite from collections.abc import Iterable, Iterator, Mapping from decimal import Decimal from pathlib import Path @@ -180,7 +179,9 @@ class QRBill: def qr_data(self) -> str: ... def qr_image(self) -> SvgPathImage: ... def draw_swiss_cross(self, dwg: _SvgDrawing, grp: _SvgGroup, origin: tuple[FloatInt, FloatInt], size: FloatInt) -> None: ... - def draw_blank_rect(self, dwg: _SvgDrawing, grp: _SvgGroup, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt) -> None: ... + def draw_blank_rect( + self, dwg: _SvgDrawing, grp: _SvgGroup, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt + ) -> None: ... def label(self, txt: str) -> str: ... def as_svg(self, file_out: str | Path | SupportsWrite[str], full_page: bool = False) -> None: ... def transform_to_full_page(self, dwg: _SvgDrawing, bill: _SvgGroup) -> None: ... diff --git a/stubs/qrcode/qrcode/image/styles/colormasks.pyi b/stubs/qrcode/qrcode/image/styles/colormasks.pyi index db7fd6643961..95f1577693e7 100644 --- a/stubs/qrcode/qrcode/image/styles/colormasks.pyi +++ b/stubs/qrcode/qrcode/image/styles/colormasks.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsRead +from _typeshed import FloatInt, SupportsRead from pathlib import Path from PIL import Image diff --git a/stubs/qrcode/qrcode/image/styles/moduledrawers/pil.pyi b/stubs/qrcode/qrcode/image/styles/moduledrawers/pil.pyi index d343ec03bd6b..51e282f71156 100644 --- a/stubs/qrcode/qrcode/image/styles/moduledrawers/pil.pyi +++ b/stubs/qrcode/qrcode/image/styles/moduledrawers/pil.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import abc +from _typeshed import FloatInt from typing import Literal from PIL import Image, ImageDraw diff --git a/stubs/qrcode/qrcode/image/styles/moduledrawers/svg.pyi b/stubs/qrcode/qrcode/image/styles/moduledrawers/svg.pyi index 6a72b0e301e1..acff01eb20c7 100644 --- a/stubs/qrcode/qrcode/image/styles/moduledrawers/svg.pyi +++ b/stubs/qrcode/qrcode/image/styles/moduledrawers/svg.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import abc +from _typeshed import FloatInt from decimal import Decimal from typing import Any, NamedTuple from xml.etree.ElementTree import Element, QName diff --git a/stubs/rasterio/rasterio/__init__.pyi b/stubs/rasterio/rasterio/__init__.pyi index 2175fe568c18..814f10a4230c 100644 --- a/stubs/rasterio/rasterio/__init__.pyi +++ b/stubs/rasterio/rasterio/__init__.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import logging import os +from _typeshed import FloatInt from collections.abc import Callable, Sequence from typing import Any, Final, Literal, NamedTuple, TypeAlias, overload diff --git a/stubs/rasterio/rasterio/_base.pyi b/stubs/rasterio/rasterio/_base.pyi index d906e64797ec..e95ea2b2a12c 100644 --- a/stubs/rasterio/rasterio/_base.pyi +++ b/stubs/rasterio/rasterio/_base.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import logging import os +from _typeshed import FloatInt from collections.abc import Iterable, Sequence from types import TracebackType from typing import Any, Final diff --git a/stubs/rasterio/rasterio/_io.pyi b/stubs/rasterio/rasterio/_io.pyi index c26e3eeda8b2..f3ceb83e3c5d 100644 --- a/stubs/rasterio/rasterio/_io.pyi +++ b/stubs/rasterio/rasterio/_io.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import os +from _typeshed import FloatInt from collections.abc import Iterator, Sequence from typing import Any, BinaryIO, Final from typing_extensions import Self, deprecated diff --git a/stubs/rasterio/rasterio/features.pyi b/stubs/rasterio/rasterio/features.pyi index 9464a15750e4..b65fabab28e2 100644 --- a/stubs/rasterio/rasterio/features.pyi +++ b/stubs/rasterio/rasterio/features.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import logging import os +from _typeshed import FloatInt from collections.abc import Iterable, Iterator from typing import Any, Final, overload from typing_extensions import deprecated diff --git a/stubs/rasterio/rasterio/io.pyi b/stubs/rasterio/rasterio/io.pyi index 903ec5e45148..ed7ac5b1b6a8 100644 --- a/stubs/rasterio/rasterio/io.pyi +++ b/stubs/rasterio/rasterio/io.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import logging +from _typeshed import FloatInt from types import TracebackType from typing import Any, Final from typing_extensions import Self, deprecated diff --git a/stubs/rasterio/rasterio/mask.pyi b/stubs/rasterio/rasterio/mask.pyi index 3a4e14895936..7513b07e788a 100644 --- a/stubs/rasterio/rasterio/mask.pyi +++ b/stubs/rasterio/rasterio/mask.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import logging +from _typeshed import FloatInt from collections.abc import Iterable from typing import Any, Final diff --git a/stubs/rasterio/rasterio/merge.pyi b/stubs/rasterio/rasterio/merge.pyi index bd845a2c2bc9..33c36585f54b 100644 --- a/stubs/rasterio/rasterio/merge.pyi +++ b/stubs/rasterio/rasterio/merge.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import logging import os +from _typeshed import FloatInt from collections.abc import Callable, Sequence from typing import Any, Final, Literal, TypeAlias, overload from typing_extensions import deprecated diff --git a/stubs/rasterio/rasterio/plot.pyi b/stubs/rasterio/rasterio/plot.pyi index 0673f8e4f692..5a9f5be6171f 100644 --- a/stubs/rasterio/rasterio/plot.pyi +++ b/stubs/rasterio/rasterio/plot.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import logging +from _typeshed import FloatInt from collections.abc import Mapping, Sequence from typing import Any, Final, Literal diff --git a/stubs/rasterio/rasterio/stack.pyi b/stubs/rasterio/rasterio/stack.pyi index 9194bd21fac8..587680b0ee0d 100644 --- a/stubs/rasterio/rasterio/stack.pyi +++ b/stubs/rasterio/rasterio/stack.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import logging import os +from _typeshed import FloatInt from collections.abc import Sequence from typing import Any, Final diff --git a/stubs/rasterio/rasterio/transform.pyi b/stubs/rasterio/rasterio/transform.pyi index 34e5b3dc19bd..fd0cab5b982c 100644 --- a/stubs/rasterio/rasterio/transform.pyi +++ b/stubs/rasterio/rasterio/transform.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import ConvertibleToInt +from _typeshed import ConvertibleToInt, FloatInt from collections.abc import Callable, Sequence from typing import Final, Literal, TypeAlias, overload from typing_extensions import Self, TypeVar, deprecated @@ -44,7 +43,9 @@ class TransformMethodsMixin: def tastes_like_gdal(seq: Affine | _Sextuple) -> bool: ... def guard_transform(transform: Affine | _Sextuple) -> Affine: ... def from_origin(west: FloatInt, north: FloatInt, xsize: FloatInt, ysize: FloatInt) -> Affine: ... -def from_bounds(west: FloatInt, south: FloatInt, east: FloatInt, north: FloatInt, width: FloatInt, height: FloatInt) -> Affine: ... +def from_bounds( + west: FloatInt, south: FloatInt, east: FloatInt, north: FloatInt, width: FloatInt, height: FloatInt +) -> Affine: ... def array_bounds(height: int, width: int, transform: Affine) -> tuple[float, float, float, float]: ... def from_gcps(gcps: Sequence[GroundControlPoint]) -> Affine: ... def xy( diff --git a/stubs/rasterio/rasterio/warp.pyi b/stubs/rasterio/rasterio/warp.pyi index f12d3a1e2300..e2456987d02e 100644 --- a/stubs/rasterio/rasterio/warp.pyi +++ b/stubs/rasterio/rasterio/warp.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Mapping, Sequence from typing import Any, Final, TypeAlias, overload from typing_extensions import deprecated diff --git a/stubs/rasterio/rasterio/windows.pyi b/stubs/rasterio/rasterio/windows.pyi index 36230e6487c9..5d632c2542d2 100644 --- a/stubs/rasterio/rasterio/windows.pyi +++ b/stubs/rasterio/rasterio/windows.pyi @@ -16,7 +16,9 @@ class WindowMethodsMixin: def window(self, left: FloatInt, bottom: FloatInt, right: FloatInt, top: FloatInt) -> Window: ... @overload @deprecated("The `precision` parameter is unused since rasterio 1.3 and will be removed in 2.0.0.") - def window(self, left: FloatInt, bottom: FloatInt, right: FloatInt, top: FloatInt, precision: int | None = None) -> Window: ... + def window( + self, left: FloatInt, bottom: FloatInt, right: FloatInt, top: FloatInt, precision: int | None = None + ) -> Window: ... def window_transform(self, window: Window) -> Affine: ... def window_bounds(self, window: Window) -> _Bounds: ... diff --git a/stubs/ratelimit/ratelimit/exception.pyi b/stubs/ratelimit/ratelimit/exception.pyi index bceee2163326..e4f5c35e56b1 100644 --- a/stubs/ratelimit/ratelimit/exception.pyi +++ b/stubs/ratelimit/ratelimit/exception.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + class RateLimitException(Exception): period_remaining: FloatInt def __init__(self, message: str, period_remaining: FloatInt) -> None: ... diff --git a/stubs/regex/regex/_main.pyi b/stubs/regex/regex/_main.pyi index ffedd312c218..0d648a77a8b7 100644 --- a/stubs/regex/regex/_main.pyi +++ b/stubs/regex/regex/_main.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import MaybeNone, ReadableBuffer, Unused +from _typeshed import FloatInt, MaybeNone, ReadableBuffer, Unused from collections.abc import Callable, Mapping from types import GenericAlias from typing import Any, AnyStr, Generic, Literal, TypeVar, final, overload diff --git a/stubs/reportlab/reportlab/graphics/barcode/code39.pyi b/stubs/reportlab/reportlab/graphics/barcode/code39.pyi index 1144849214b8..20f6b92d837d 100644 --- a/stubs/reportlab/reportlab/graphics/barcode/code39.pyi +++ b/stubs/reportlab/reportlab/graphics/barcode/code39.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from reportlab.graphics.barcode.common import Barcode diff --git a/stubs/reportlab/reportlab/graphics/barcode/common.pyi b/stubs/reportlab/reportlab/graphics/barcode/common.pyi index d4ba6461eb1e..138a80e36e9b 100644 --- a/stubs/reportlab/reportlab/graphics/barcode/common.pyi +++ b/stubs/reportlab/reportlab/graphics/barcode/common.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from reportlab.platypus.flowables import Flowable diff --git a/stubs/reportlab/reportlab/graphics/barcode/lto.pyi b/stubs/reportlab/reportlab/graphics/barcode/lto.pyi index aa1d6a7649ae..c0a44948ef0e 100644 --- a/stubs/reportlab/reportlab/graphics/barcode/lto.pyi +++ b/stubs/reportlab/reportlab/graphics/barcode/lto.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from reportlab.graphics.barcode.code39 import Standard39 diff --git a/stubs/reportlab/reportlab/graphics/charts/axes.pyi b/stubs/reportlab/reportlab/graphics/charts/axes.pyi index b080dd74e271..031beb1d1170 100644 --- a/stubs/reportlab/reportlab/graphics/charts/axes.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/axes.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.charts.textlabels import PMVLabel diff --git a/stubs/reportlab/reportlab/graphics/charts/barcharts.pyi b/stubs/reportlab/reportlab/graphics/charts/barcharts.pyi index 18ba700a01ac..8e107baae51b 100644 --- a/stubs/reportlab/reportlab/graphics/charts/barcharts.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/barcharts.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.charts.areas import PlotArea diff --git a/stubs/reportlab/reportlab/graphics/charts/dotbox.pyi b/stubs/reportlab/reportlab/graphics/charts/dotbox.pyi index 09305ff9ea74..21f9451a73f5 100644 --- a/stubs/reportlab/reportlab/graphics/charts/dotbox.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/dotbox.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from reportlab.graphics.widgetbase import Widget from reportlab.lib.attrmap import * diff --git a/stubs/reportlab/reportlab/graphics/charts/legends.pyi b/stubs/reportlab/reportlab/graphics/charts/legends.pyi index ed04425f2ed0..87bfc5609f1e 100644 --- a/stubs/reportlab/reportlab/graphics/charts/legends.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/legends.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.widgetbase import PropHolder, Widget diff --git a/stubs/reportlab/reportlab/graphics/charts/linecharts.pyi b/stubs/reportlab/reportlab/graphics/charts/linecharts.pyi index 74a2bb7d5d8d..88f0964401c0 100644 --- a/stubs/reportlab/reportlab/graphics/charts/linecharts.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/linecharts.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.charts.areas import PlotArea diff --git a/stubs/reportlab/reportlab/graphics/charts/lineplots.pyi b/stubs/reportlab/reportlab/graphics/charts/lineplots.pyi index e459c66198ca..8dace6886c02 100644 --- a/stubs/reportlab/reportlab/graphics/charts/lineplots.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/lineplots.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.charts.linecharts import AbstractLineChart diff --git a/stubs/reportlab/reportlab/graphics/charts/piecharts.pyi b/stubs/reportlab/reportlab/graphics/charts/piecharts.pyi index ef819072793c..e37e7e1e7d2b 100644 --- a/stubs/reportlab/reportlab/graphics/charts/piecharts.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/piecharts.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.charts.areas import PlotArea diff --git a/stubs/reportlab/reportlab/graphics/charts/slidebox.pyi b/stubs/reportlab/reportlab/graphics/charts/slidebox.pyi index 0e58871a8554..088d1a0361dc 100644 --- a/stubs/reportlab/reportlab/graphics/charts/slidebox.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/slidebox.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from reportlab.graphics.widgetbase import Widget from reportlab.lib.attrmap import * diff --git a/stubs/reportlab/reportlab/graphics/charts/spider.pyi b/stubs/reportlab/reportlab/graphics/charts/spider.pyi index 0c04ba3d8daf..3ab9adb5dafd 100644 --- a/stubs/reportlab/reportlab/graphics/charts/spider.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/spider.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.charts.areas import PlotArea diff --git a/stubs/reportlab/reportlab/graphics/charts/utils.pyi b/stubs/reportlab/reportlab/graphics/charts/utils.pyi index cec80df1b19e..468f9d26cbff 100644 --- a/stubs/reportlab/reportlab/graphics/charts/utils.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/utils.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Sequence from typing import Final, Literal @@ -70,4 +69,6 @@ class FillPairedData(list[Incomplete]): def angle2dir(angle: FloatInt) -> Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]: ... def angle2corner(angle: FloatInt) -> Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]: ... -def boxCornerCoords(bb: Sequence[FloatInt], cn: Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"]) -> tuple[float, float]: ... +def boxCornerCoords( + bb: Sequence[FloatInt], cn: Literal["n", "ne", "e", "se", "s", "sw", "w", "nw", "c"] +) -> tuple[float, float]: ... diff --git a/stubs/reportlab/reportlab/graphics/charts/utils3d.pyi b/stubs/reportlab/reportlab/graphics/charts/utils3d.pyi index 24fbc6faad2a..7fcf3de5c996 100644 --- a/stubs/reportlab/reportlab/graphics/charts/utils3d.pyi +++ b/stubs/reportlab/reportlab/graphics/charts/utils3d.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete class _YStrip: y0: Incomplete diff --git a/stubs/reportlab/reportlab/graphics/renderPDF.pyi b/stubs/reportlab/reportlab/graphics/renderPDF.pyi index 71d60e5d63be..2591e34b7803 100644 --- a/stubs/reportlab/reportlab/graphics/renderPDF.pyi +++ b/stubs/reportlab/reportlab/graphics/renderPDF.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import IO, Final from reportlab.graphics.renderbase import Renderer diff --git a/stubs/reportlab/reportlab/graphics/renderPM.pyi b/stubs/reportlab/reportlab/graphics/renderPM.pyi index e7ac68318fca..e8970108e539 100644 --- a/stubs/reportlab/reportlab/graphics/renderPM.pyi +++ b/stubs/reportlab/reportlab/graphics/renderPM.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import IO, Final from reportlab.graphics.renderbase import Renderer @@ -45,7 +44,13 @@ class PMCanvas: def bezierArcCCW(self, cx, cy, rx, ry, theta0, theta1): ... def addEllipsoidalArc(self, cx, cy, rx, ry, ang1, ang2) -> None: ... def drawCentredString( - self, x: FloatInt, y: FloatInt, text: str, text_anchor: str = "middle", direction: str | None = None, shaping: bool = False + self, + x: FloatInt, + y: FloatInt, + text: str, + text_anchor: str = "middle", + direction: str | None = None, + shaping: bool = False, ) -> None: ... def drawRightString(self, text: str, x: FloatInt, y: FloatInt, direction: str | None = None) -> None: ... def drawString( diff --git a/stubs/reportlab/reportlab/graphics/renderPS.pyi b/stubs/reportlab/reportlab/graphics/renderPS.pyi index 798eab669548..2eb79c9a0fa2 100644 --- a/stubs/reportlab/reportlab/graphics/renderPS.pyi +++ b/stubs/reportlab/reportlab/graphics/renderPS.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import IO, Final from reportlab.graphics.renderbase import Renderer diff --git a/stubs/reportlab/reportlab/graphics/renderSVG.pyi b/stubs/reportlab/reportlab/graphics/renderSVG.pyi index bc91407df5dc..5f903040600e 100644 --- a/stubs/reportlab/reportlab/graphics/renderSVG.pyi +++ b/stubs/reportlab/reportlab/graphics/renderSVG.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Sequence from math import cos as cos, pi as pi, sin as sin from typing import IO, Final diff --git a/stubs/reportlab/reportlab/graphics/shapes.pyi b/stubs/reportlab/reportlab/graphics/shapes.pyi index 9b32c5d6541e..592eefc3c0c2 100644 --- a/stubs/reportlab/reportlab/graphics/shapes.pyi +++ b/stubs/reportlab/reportlab/graphics/shapes.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsItems +from _typeshed import FloatInt, Incomplete, SupportsItems from abc import abstractmethod from collections.abc import Iterable, Sequence from typing import Any, Final, Literal, TypeAlias, TypedDict, type_check_only @@ -171,7 +170,12 @@ class Drawing(Group, Flowable): ): ... def asString(self, format: str, verbose: bool | None = None, preview: int = 0, **kw) -> str: ... def resized( - self, kind: Literal["fit", "fitx", "fity"] = "fit", lpad: FloatInt = 0, rpad: FloatInt = 0, bpad: FloatInt = 0, tpad: FloatInt = 0 + self, + kind: Literal["fit", "fitx", "fity"] = "fit", + lpad: FloatInt = 0, + rpad: FloatInt = 0, + bpad: FloatInt = 0, + tpad: FloatInt = 0, ) -> Drawing: ... class _DrawingEditorMixin: ... @@ -265,7 +269,11 @@ class ArcPath(Path): ) -> None: ... def definePath( - pathSegs: Iterable[_PathOp] = [], isClipPath: _BoolLike = 0, dx: FloatInt = 0, dy: FloatInt = 0, **kw: Unpack[_DefinePathKwArgs] + pathSegs: Iterable[_PathOp] = [], + isClipPath: _BoolLike = 0, + dx: FloatInt = 0, + dy: FloatInt = 0, + **kw: Unpack[_DefinePathKwArgs], ) -> Path: ... class Rect(SolidShape): @@ -276,7 +284,14 @@ class Rect(SolidShape): rx: FloatInt ry: FloatInt def __init__( - self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, rx: FloatInt = 0, ry: FloatInt = 0, **kw: _SolidShapeKwArgs + self, + x: FloatInt, + y: FloatInt, + width: FloatInt, + height: FloatInt, + rx: FloatInt = 0, + ry: FloatInt = 0, + **kw: _SolidShapeKwArgs, ) -> None: ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... @@ -287,7 +302,9 @@ class Image(SolidShape): width: FloatInt height: FloatInt path: Incomplete - def __init__(self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, path, **kw: Unpack[_SolidShapeKwArgs]) -> None: ... + def __init__( + self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, path, **kw: Unpack[_SolidShapeKwArgs] + ) -> None: ... def copy(self) -> Self: ... def getBounds(self) -> tuple[float, float, float, float]: ... diff --git a/stubs/reportlab/reportlab/graphics/transform.pyi b/stubs/reportlab/reportlab/graphics/transform.pyi index d66c6be9993f..7eaa10bd8fda 100644 --- a/stubs/reportlab/reportlab/graphics/transform.pyi +++ b/stubs/reportlab/reportlab/graphics/transform.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + def nullTransform(): ... def translate(dx: FloatInt, dy: FloatInt = 0): ... def scale(sx: FloatInt, sy: FloatInt = 1): ... diff --git a/stubs/reportlab/reportlab/graphics/widgetbase.pyi b/stubs/reportlab/reportlab/graphics/widgetbase.pyi index 28c777cd6815..94f87b7d7ff6 100644 --- a/stubs/reportlab/reportlab/graphics/widgetbase.pyi +++ b/stubs/reportlab/reportlab/graphics/widgetbase.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics import shapes diff --git a/stubs/reportlab/reportlab/graphics/widgets/signsandsymbols.pyi b/stubs/reportlab/reportlab/graphics/widgets/signsandsymbols.pyi index add1645d4248..537b5c23ada0 100644 --- a/stubs/reportlab/reportlab/graphics/widgets/signsandsymbols.pyi +++ b/stubs/reportlab/reportlab/graphics/widgets/signsandsymbols.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.widgetbase import Widget diff --git a/stubs/reportlab/reportlab/graphics/widgets/table.pyi b/stubs/reportlab/reportlab/graphics/widgets/table.pyi index 732cccac73c3..6d19cc56b158 100644 --- a/stubs/reportlab/reportlab/graphics/widgets/table.pyi +++ b/stubs/reportlab/reportlab/graphics/widgets/table.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final from reportlab.graphics.widgetbase import Widget diff --git a/stubs/reportlab/reportlab/lib/colors.pyi b/stubs/reportlab/reportlab/lib/colors.pyi index ed73b7dc33d4..eaf3e7e04a79 100644 --- a/stubs/reportlab/reportlab/lib/colors.pyi +++ b/stubs/reportlab/reportlab/lib/colors.pyi @@ -6,7 +6,9 @@ from typing_extensions import Self _ColorT = TypeVar("_ColorT", bound=Color) # NOTE: Reportlab is very inconsistent and sometimes uses the interpretation # used in reportlab.pdfgen.textobject instead, so we pick a different name -_ConvertibleToColor: TypeAlias = Color | list[FloatInt] | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | str | int +_ConvertibleToColor: TypeAlias = ( + Color | list[FloatInt] | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | str | int +) __version__: Final[str] diff --git a/stubs/reportlab/reportlab/lib/corp.pyi b/stubs/reportlab/reportlab/lib/corp.pyi index b1464abc667d..f2d584787a5a 100644 --- a/stubs/reportlab/reportlab/lib/corp.pyi +++ b/stubs/reportlab/reportlab/lib/corp.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable from typing import Final diff --git a/stubs/reportlab/reportlab/lib/rl_accel.pyi b/stubs/reportlab/reportlab/lib/rl_accel.pyi index 4eeee3101fbc..20cd9e79ce2a 100644 --- a/stubs/reportlab/reportlab/lib/rl_accel.pyi +++ b/stubs/reportlab/reportlab/lib/rl_accel.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Literal def fp_str(*a) -> str: ... diff --git a/stubs/reportlab/reportlab/lib/styles.pyi b/stubs/reportlab/reportlab/lib/styles.pyi index 64090de65889..b3632b428eec 100644 --- a/stubs/reportlab/reportlab/lib/styles.pyi +++ b/stubs/reportlab/reportlab/lib/styles.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Any, ClassVar, Literal, TypeAlias, TypeVar, overload from typing_extensions import Self diff --git a/stubs/reportlab/reportlab/lib/testutils.pyi b/stubs/reportlab/reportlab/lib/testutils.pyi index 7a67f4c465e6..ba66376c2ee4 100644 --- a/stubs/reportlab/reportlab/lib/testutils.pyi +++ b/stubs/reportlab/reportlab/lib/testutils.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import re import unittest -from _typeshed import Incomplete, StrPath, Unused +from _typeshed import FloatInt, Incomplete, StrPath, Unused from configparser import ConfigParser, _SectionName from types import ModuleType from typing import Final, Literal diff --git a/stubs/reportlab/reportlab/lib/textsplit.pyi b/stubs/reportlab/reportlab/lib/textsplit.pyi index 0f9419b4022b..11316e5dde34 100644 --- a/stubs/reportlab/reportlab/lib/textsplit.pyi +++ b/stubs/reportlab/reportlab/lib/textsplit.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import re -from _typeshed import Incomplete, ReadableBuffer +from _typeshed import FloatInt, Incomplete, ReadableBuffer from collections.abc import Sequence from typing import Final diff --git a/stubs/reportlab/reportlab/lib/utils.pyi b/stubs/reportlab/reportlab/lib/utils.pyi index ef8211fa3648..308d448fe12a 100644 --- a/stubs/reportlab/reportlab/lib/utils.pyi +++ b/stubs/reportlab/reportlab/lib/utils.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import datetime as _datetime import zipimport -from _typeshed import Incomplete, SupportsItems +from _typeshed import FloatInt, Incomplete, SupportsItems from builtins import _ClassInfo from collections.abc import Generator, Iterable, MutableMapping from os import PathLike diff --git a/stubs/reportlab/reportlab/pdfbase/acroform.pyi b/stubs/reportlab/reportlab/pdfbase/acroform.pyi index 1674288fe1dc..df0aef2426a4 100644 --- a/stubs/reportlab/reportlab/pdfbase/acroform.pyi +++ b/stubs/reportlab/reportlab/pdfbase/acroform.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from weakref import ReferenceType from reportlab.lib.colors import Color diff --git a/stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi b/stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi index fe0d96530043..136d40185389 100644 --- a/stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi +++ b/stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, StrOrBytesPath +from _typeshed import FloatInt, Incomplete, StrOrBytesPath from typing import ClassVar, Final, Literal from reportlab.lib.rl_accel import unicode2T1 as unicode2T1 diff --git a/stubs/reportlab/reportlab/pdfbase/ttfonts.pyi b/stubs/reportlab/reportlab/pdfbase/ttfonts.pyi index 0cfeedf29926..02d2fd6df0df 100644 --- a/stubs/reportlab/reportlab/pdfbase/ttfonts.pyi +++ b/stubs/reportlab/reportlab/pdfbase/ttfonts.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, ReadableBuffer, StrOrBytesPath +from _typeshed import FloatInt, Incomplete, ReadableBuffer, StrOrBytesPath from collections.abc import Sequence from typing import Final, Literal, NamedTuple from typing_extensions import Self diff --git a/stubs/reportlab/reportlab/pdfgen/canvas.pyi b/stubs/reportlab/reportlab/pdfgen/canvas.pyi index 072f71bd4bfa..276d95a96e43 100644 --- a/stubs/reportlab/reportlab/pdfgen/canvas.pyi +++ b/stubs/reportlab/reportlab/pdfgen/canvas.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from typing import IO, Literal @@ -201,19 +200,44 @@ class Canvas(_PDFColorSetter): fontSize: FloatInt = 3, ) -> None: ... def grid(self, xlist, ylist) -> None: ... - def bezier(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, x3: FloatInt, y3: FloatInt, x4: FloatInt, y4: FloatInt) -> None: ... - def arc(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, startAng: FloatInt = 0, extent: FloatInt = 90) -> None: ... - def rect(self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0) -> None: ... - def ellipse(self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0) -> None: ... + def bezier( + self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, x3: FloatInt, y3: FloatInt, x4: FloatInt, y4: FloatInt + ) -> None: ... + def arc( + self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, startAng: FloatInt = 0, extent: FloatInt = 90 + ) -> None: ... + def rect( + self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0 + ) -> None: ... + def ellipse( + self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0 + ) -> None: ... def wedge( - self, x1: FloatInt, y1: FloatInt, x2: FloatInt, y2: FloatInt, startAng: FloatInt, extent: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0 + self, + x1: FloatInt, + y1: FloatInt, + x2: FloatInt, + y2: FloatInt, + startAng: FloatInt, + extent: FloatInt, + stroke: FloatInt = 1, + fill: FloatInt = 0, ) -> None: ... def circle(self, x_cen: FloatInt, y_cen: FloatInt, r: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0) -> None: ... def roundRect( - self, x: FloatInt, y: FloatInt, width: FloatInt, height: FloatInt, radius: FloatInt, stroke: FloatInt = 1, fill: FloatInt = 0 + self, + x: FloatInt, + y: FloatInt, + width: FloatInt, + height: FloatInt, + radius: FloatInt, + stroke: FloatInt = 1, + fill: FloatInt = 0, ) -> None: ... def shade(self, shading) -> None: ... - def linearGradient(self, x0: FloatInt, y0: FloatInt, x1: FloatInt, y1: FloatInt, colors, positions=None, extend: bool = True) -> None: ... + def linearGradient( + self, x0: FloatInt, y0: FloatInt, x1: FloatInt, y1: FloatInt, colors, positions=None, extend: bool = True + ) -> None: ... def radialGradient(self, x: FloatInt, y: FloatInt, radius: FloatInt, colors, positions=None, extend: bool = True) -> None: ... def drawString( self, @@ -278,7 +302,12 @@ class Canvas(_PDFColorSetter): def setPageCompression(self, pageCompression: bool | Literal[0, 1] | None = 1) -> None: ... def setPageDuration(self, duration=None) -> None: ... def setPageTransition( - self, effectname: str | None = None, duration: FloatInt = 1, direction: FloatInt = 0, dimension: str = "H", motion: str = "I" + self, + effectname: str | None = None, + duration: FloatInt = 1, + direction: FloatInt = 0, + dimension: str = "H", + motion: str = "I", ) -> None: ... def getCurrentPageContent(self) -> str: ... def setViewerPreference(self, pref, value) -> None: ... diff --git a/stubs/reportlab/reportlab/pdfgen/textobject.pyi b/stubs/reportlab/reportlab/pdfgen/textobject.pyi index bd6c9556b259..a2c68a90a384 100644 --- a/stubs/reportlab/reportlab/pdfgen/textobject.pyi +++ b/stubs/reportlab/reportlab/pdfgen/textobject.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from collections.abc import Callable from typing import Final, Literal, TypeAlias @@ -8,7 +7,9 @@ from reportlab.pdfbase.ttfonts import ShapedStr from reportlab.pdfgen.canvas import Canvas # NOTE: This is slightly different from what toColor accepts and interprets -_Color: TypeAlias = Color | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | list[FloatInt] | str +_Color: TypeAlias = ( + Color | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | list[FloatInt] | str +) __version__: Final[str] log2vis: Callable[..., str | None] @@ -49,7 +50,9 @@ class _PDFColorSetter: class PDFTextObject(_PDFColorSetter): direction: Literal["LTR", "RTL"] - def __init__(self, canvas: Canvas, x: FloatInt = 0, y: FloatInt = 0, direction: Literal["LTR", "RTL"] | None = None) -> None: ... + def __init__( + self, canvas: Canvas, x: FloatInt = 0, y: FloatInt = 0, direction: Literal["LTR", "RTL"] | None = None + ) -> None: ... def getCode(self) -> str: ... def setTextOrigin(self, x: FloatInt, y: FloatInt) -> None: ... def setTextTransform(self, a: FloatInt, b: FloatInt, c: FloatInt, d: FloatInt, e: FloatInt, f: FloatInt) -> None: ... diff --git a/stubs/reportlab/reportlab/platypus/doctemplate.pyi b/stubs/reportlab/reportlab/platypus/doctemplate.pyi index fd8a06d661d2..9777827b9fd0 100644 --- a/stubs/reportlab/reportlab/platypus/doctemplate.pyi +++ b/stubs/reportlab/reportlab/platypus/doctemplate.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from abc import abstractmethod from collections.abc import Callable from typing import IO, Any, Literal, Protocol, TypeAlias, TypedDict, type_check_only diff --git a/stubs/reportlab/reportlab/platypus/flowables.pyi b/stubs/reportlab/reportlab/platypus/flowables.pyi index 5b85bfcb9175..138f9ae18459 100644 --- a/stubs/reportlab/reportlab/platypus/flowables.pyi +++ b/stubs/reportlab/reportlab/platypus/flowables.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsRead, Unused +from _typeshed import FloatInt, Incomplete, SupportsRead, Unused from collections.abc import Callable, Iterable, Sequence from typing import Any, Literal, Protocol, TypeAlias, type_check_only from typing_extensions import Never, Self diff --git a/stubs/reportlab/reportlab/platypus/para.pyi b/stubs/reportlab/reportlab/platypus/para.pyi index 692dfa5b5d72..584c53ed8e96 100644 --- a/stubs/reportlab/reportlab/platypus/para.pyi +++ b/stubs/reportlab/reportlab/platypus/para.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from collections.abc import Callable, Mapping from typing import Any, Final, Literal, Protocol, TypeAlias, TypedDict, TypeVar, overload, type_check_only from typing_extensions import Unpack diff --git a/stubs/reportlab/reportlab/platypus/paragraph.pyi b/stubs/reportlab/reportlab/platypus/paragraph.pyi index a059a0c87f7c..51c1f9b57eb7 100644 --- a/stubs/reportlab/reportlab/platypus/paragraph.pyi +++ b/stubs/reportlab/reportlab/platypus/paragraph.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from reportlab.lib.abag import ABag from reportlab.lib.styles import ParagraphStyle, PropertySet from reportlab.pdfgen.textobject import PDFTextObject diff --git a/stubs/reportlab/reportlab/platypus/tableofcontents.pyi b/stubs/reportlab/reportlab/platypus/tableofcontents.pyi index 5cf11ed8ac58..e88ddc5c7c0a 100644 --- a/stubs/reportlab/reportlab/platypus/tableofcontents.pyi +++ b/stubs/reportlab/reportlab/platypus/tableofcontents.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Callable, Iterable, Sequence from typing import Any, Final, Literal, TypeAlias, TypedDict, TypeVar, overload, type_check_only from typing_extensions import Unpack diff --git a/stubs/reportlab/reportlab/platypus/tables.pyi b/stubs/reportlab/reportlab/platypus/tables.pyi index 377da47c5fe2..60e7e087d28e 100644 --- a/stubs/reportlab/reportlab/platypus/tables.pyi +++ b/stubs/reportlab/reportlab/platypus/tables.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from abc import abstractmethod from collections.abc import Collection, Iterable, Sequence from typing import Any, Literal, NamedTuple, TypeAlias, overload @@ -12,7 +11,9 @@ from reportlab.platypus.flowables import Flowable, _HAlignment, _VAlignment __all__ = ("Table", "TableStyle", "CellStyle", "LongTable") -_Color: TypeAlias = Color | list[FloatInt] | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | str | int +_Color: TypeAlias = ( + Color | list[FloatInt] | tuple[FloatInt, FloatInt, FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] | str | int +) # TODO: consider creating a tagged union of all the possible commands, although # this would restrict us to passing cmds to TableStyle.__init__ in a tuple # since a list would not be able to be inferred correctly diff --git a/stubs/reportlab/reportlab/platypus/xpreformatted.pyi b/stubs/reportlab/reportlab/platypus/xpreformatted.pyi index 6b6ce1c7df86..283edd765c00 100644 --- a/stubs/reportlab/reportlab/platypus/xpreformatted.pyi +++ b/stubs/reportlab/reportlab/platypus/xpreformatted.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from reportlab.lib.styles import PropertySet from reportlab.platypus.paragraph import Paragraph, ParaLines from reportlab.platypus.paraparser import ParaFrag diff --git a/stubs/reportlab/reportlab/rl_config.pyi b/stubs/reportlab/reportlab/rl_config.pyi index dff99e3c7496..c62e125eb897 100644 --- a/stubs/reportlab/reportlab/rl_config.pyi +++ b/stubs/reportlab/reportlab/rl_config.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from typing import Any, Literal from weakref import ReferenceType diff --git a/stubs/reportlab/reportlab/rl_settings.pyi b/stubs/reportlab/reportlab/rl_settings.pyi index f290d0f2abbc..15a671e68b5d 100644 --- a/stubs/reportlab/reportlab/rl_settings.pyi +++ b/stubs/reportlab/reportlab/rl_settings.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from typing import Final, Literal __version__: Final[str] diff --git a/stubs/requests/requests/adapters.pyi b/stubs/requests/requests/adapters.pyi index 430b88bc9d3c..397331dc355c 100644 --- a/stubs/requests/requests/adapters.pyi +++ b/stubs/requests/requests/adapters.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Mapping from ssl import SSLContext from typing import Any, Literal, TypedDict, type_check_only diff --git a/stubs/requests/requests/sessions.pyi b/stubs/requests/requests/sessions.pyi index ebf38518fb4c..81db1b773a75 100644 --- a/stubs/requests/requests/sessions.pyi +++ b/stubs/requests/requests/sessions.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsItems, SupportsRead, Unused +from _typeshed import FloatInt, SupportsItems, SupportsRead, Unused from collections.abc import Callable, Iterable, Mapping, MutableMapping from typing import Any, TypeAlias, TypedDict, type_check_only from typing_extensions import Self diff --git a/stubs/retry/retry/api.pyi b/stubs/retry/retry/api.pyi index 2844b8589ff0..78346a7c8023 100644 --- a/stubs/retry/retry/api.pyi +++ b/stubs/retry/retry/api.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import IdentityFunction +from _typeshed import FloatInt, IdentityFunction from collections.abc import Callable, Sequence from logging import Logger from typing import Any, TypeVar diff --git a/stubs/seaborn/seaborn/_core/moves.pyi b/stubs/seaborn/seaborn/_core/moves.pyi index 09ff26c54557..2f2099dc0508 100644 --- a/stubs/seaborn/seaborn/_core/moves.pyi +++ b/stubs/seaborn/seaborn/_core/moves.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from dataclasses import dataclass from typing import ClassVar diff --git a/stubs/seaborn/seaborn/_core/plot.pyi b/stubs/seaborn/seaborn/_core/plot.pyi index 611b28d6ba10..09d12783ddbd 100644 --- a/stubs/seaborn/seaborn/_core/plot.pyi +++ b/stubs/seaborn/seaborn/_core/plot.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import inspect import os -from _typeshed import Incomplete, SupportsKeysAndGetItem +from _typeshed import FloatInt, Incomplete, SupportsKeysAndGetItem from collections.abc import Callable, Generator from contextlib import contextmanager from typing import IO, Any, Literal, TypedDict, TypeVar diff --git a/stubs/seaborn/seaborn/_core/properties.pyi b/stubs/seaborn/seaborn/_core/properties.pyi index 09decb78b31e..981f75615b2a 100644 --- a/stubs/seaborn/seaborn/_core/properties.pyi +++ b/stubs/seaborn/seaborn/_core/properties.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable from typing import Any, TypeAlias diff --git a/stubs/seaborn/seaborn/_core/scales.pyi b/stubs/seaborn/seaborn/_core/scales.pyi index 07fbdc16163e..6722325907df 100644 --- a/stubs/seaborn/seaborn/_core/scales.pyi +++ b/stubs/seaborn/seaborn/_core/scales.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Sequence from dataclasses import dataclass from typing import Any, ClassVar, TypeAlias diff --git a/stubs/seaborn/seaborn/_core/typing.pyi b/stubs/seaborn/seaborn/_core/typing.pyi index 2e9bb350b00e..ef18c0e1bbdb 100644 --- a/stubs/seaborn/seaborn/_core/typing.pyi +++ b/stubs/seaborn/seaborn/_core/typing.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable, Mapping from datetime import date, datetime, timedelta from typing import Any, Protocol, TypeAlias, type_check_only diff --git a/stubs/seaborn/seaborn/_marks/base.pyi b/stubs/seaborn/seaborn/_marks/base.pyi index 8e7ecbc427f0..883222f69bb7 100644 --- a/stubs/seaborn/seaborn/_marks/base.pyi +++ b/stubs/seaborn/seaborn/_marks/base.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from dataclasses import dataclass from typing import Any, TypeAlias, TypeVar diff --git a/stubs/seaborn/seaborn/axisgrid.pyi b/stubs/seaborn/seaborn/axisgrid.pyi index 4611933427fe..f5ed78310879 100644 --- a/stubs/seaborn/seaborn/axisgrid.pyi +++ b/stubs/seaborn/seaborn/axisgrid.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import os -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Generator, Iterable, Mapping from typing import IO, Any, Concatenate, Literal, ParamSpec, TypeAlias, TypeVar from typing_extensions import Self, deprecated diff --git a/stubs/seaborn/seaborn/matrix.pyi b/stubs/seaborn/seaborn/matrix.pyi index de97ec62e78d..7d033edab769 100644 --- a/stubs/seaborn/seaborn/matrix.pyi +++ b/stubs/seaborn/seaborn/matrix.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Hashable, Iterable, Mapping, Sequence from typing import Literal, TypeAlias, TypedDict, type_check_only from typing_extensions import Self diff --git a/stubs/seaborn/seaborn/palettes.pyi b/stubs/seaborn/seaborn/palettes.pyi index 968df4c6df8a..3a5e4260a8fa 100644 --- a/stubs/seaborn/seaborn/palettes.pyi +++ b/stubs/seaborn/seaborn/palettes.pyi @@ -40,7 +40,11 @@ _SeabornPaletteName: TypeAlias = Literal[ @overload def color_palette( # type: ignore[overload-overlap] - palette: _SeabornPaletteName | None = None, n_colors: int | None = None, desat: FloatInt | None = None, *, as_cmap: Literal[True] + palette: _SeabornPaletteName | None = None, + n_colors: int | None = None, + desat: FloatInt | None = None, + *, + as_cmap: Literal[True], ) -> list[str]: ... # this might be a bug in seaborn because we expect the return type to be a Colormap instance @overload def color_palette( diff --git a/stubs/seaborn/seaborn/rcmod.pyi b/stubs/seaborn/seaborn/rcmod.pyi index 6dff65954317..64c57801f101 100644 --- a/stubs/seaborn/seaborn/rcmod.pyi +++ b/stubs/seaborn/seaborn/rcmod.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Callable, Sequence from typing import Any, Literal, TypeVar from typing_extensions import deprecated @@ -71,5 +70,8 @@ class _AxesStyle(_RCAesthetics[_KT, _VT]): ... class _PlottingContext(_RCAesthetics[_KT, _VT]): ... def set_palette( - palette: str | Sequence[ColorType] | None, n_colors: int | None = None, desat: FloatInt | None = None, color_codes: bool = False + palette: str | Sequence[ColorType] | None, + n_colors: int | None = None, + desat: FloatInt | None = None, + color_codes: bool = False, ) -> None: ... diff --git a/stubs/seaborn/seaborn/regression.pyi b/stubs/seaborn/seaborn/regression.pyi index d6c9d7deace6..0dff6ab606e8 100644 --- a/stubs/seaborn/seaborn/regression.pyi +++ b/stubs/seaborn/seaborn/regression.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Iterable from typing import Any, Literal, TypeAlias, overload diff --git a/stubs/seaborn/seaborn/utils.pyi b/stubs/seaborn/seaborn/utils.pyi index a2389a6cd981..3a3d321c54d9 100644 --- a/stubs/seaborn/seaborn/utils.pyi +++ b/stubs/seaborn/seaborn/utils.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime as dt -from _typeshed import Incomplete, SupportsGetItem +from _typeshed import FloatInt, Incomplete, SupportsGetItem from collections.abc import Callable, Iterable, Mapping, Sequence from typing import Any, Literal, SupportsIndex, TypeAlias, TypeVar, overload from typing_extensions import deprecated diff --git a/stubs/setuptools/setuptools/msvc.pyi b/stubs/setuptools/setuptools/msvc.pyi index df9a67cb7345..8b79725683f7 100644 --- a/stubs/setuptools/setuptools/msvc.pyi +++ b/stubs/setuptools/setuptools/msvc.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import sys +from _typeshed import FloatInt from typing import Final, TypedDict, overload from typing_extensions import LiteralString, NotRequired diff --git a/stubs/shapely/shapely/_coverage.pyi b/stubs/shapely/shapely/_coverage.pyi index 8ae731e108b5..085462576240 100644 --- a/stubs/shapely/shapely/_coverage.pyi +++ b/stubs/shapely/shapely/_coverage.pyi @@ -14,4 +14,6 @@ def coverage_invalid_edges(geometry: OptGeoArrayLike, gap_width: FloatInt = 0.0, @overload def coverage_simplify(geometry: Polygon, tolerance: ArrayLike[FloatInt], *, simplify_boundary: bool = True) -> Polygon: ... @overload -def coverage_simplify(geometry: GeoArrayLikeSeq, tolerance: ArrayLike[FloatInt], *, simplify_boundary: bool = True) -> GeoArray: ... +def coverage_simplify( + geometry: GeoArrayLikeSeq, tolerance: ArrayLike[FloatInt], *, simplify_boundary: bool = True +) -> GeoArray: ... diff --git a/stubs/shapely/shapely/_geometry.pyi b/stubs/shapely/shapely/_geometry.pyi index 52af53ea25e7..a44a434d0ccb 100644 --- a/stubs/shapely/shapely/_geometry.pyi +++ b/stubs/shapely/shapely/_geometry.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import MaybeNone +from _typeshed import FloatInt, MaybeNone from enum import IntEnum from typing import Literal, SupportsIndex, TypeAlias, overload diff --git a/stubs/shapely/shapely/_ragged_array.pyi b/stubs/shapely/shapely/_ragged_array.pyi index de7bfa1c6423..1dba864716ab 100644 --- a/stubs/shapely/shapely/_ragged_array.pyi +++ b/stubs/shapely/shapely/_ragged_array.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + import numpy as np from numpy.typing import NDArray diff --git a/stubs/shapely/shapely/affinity.pyi b/stubs/shapely/shapely/affinity.pyi index 7f68eb068469..73893d748785 100644 --- a/stubs/shapely/shapely/affinity.pyi +++ b/stubs/shapely/shapely/affinity.pyi @@ -20,6 +20,8 @@ def interpret_origin(geom: Geometry, origin: _Origin, ndim: Literal[3]) -> tuple def interpret_origin(geom: Geometry, origin: _Origin, ndim: int) -> tuple[float, float] | tuple[float, float, float]: ... def rotate(geom: GeoT, angle: FloatInt, origin: _Origin = "center", use_radians: bool = False) -> GeoT: ... -def scale(geom: GeoT, xfact: FloatInt = 1.0, yfact: FloatInt = 1.0, zfact: FloatInt = 1.0, origin: _Origin = "center") -> GeoT: ... +def scale( + geom: GeoT, xfact: FloatInt = 1.0, yfact: FloatInt = 1.0, zfact: FloatInt = 1.0, origin: _Origin = "center" +) -> GeoT: ... def skew(geom: GeoT, xs: FloatInt = 0.0, ys: FloatInt = 0.0, origin: _Origin = "center", use_radians: bool = False) -> GeoT: ... def translate(geom: GeoT, xoff: FloatInt = 0.0, yoff: FloatInt = 0.0, zoff: FloatInt = 0.0) -> GeoT: ... diff --git a/stubs/shapely/shapely/algorithms/polylabel.pyi b/stubs/shapely/shapely/algorithms/polylabel.pyi index 36ec7a8e6fa1..a26746a31a96 100644 --- a/stubs/shapely/shapely/algorithms/polylabel.pyi +++ b/stubs/shapely/shapely/algorithms/polylabel.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from ..geometry import Point, Polygon def polylabel(polygon: Polygon, tolerance: FloatInt = 1.0) -> Point: ... diff --git a/stubs/shapely/shapely/constructive.pyi b/stubs/shapely/shapely/constructive.pyi index 8926cb261117..5da86665b8d1 100644 --- a/stubs/shapely/shapely/constructive.pyi +++ b/stubs/shapely/shapely/constructive.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import MaybeNone +from _typeshed import FloatInt, MaybeNone from collections.abc import Sequence from typing import Literal, SupportsIndex, overload from typing_extensions import Unpack @@ -184,7 +183,9 @@ def clip_by_rect( geometry: Geometry, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry: ... @overload -def clip_by_rect(geometry: None, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def clip_by_rect( + geometry: None, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, **kwargs: Unpack[UFuncKwargs] +) -> None: ... @overload def clip_by_rect( geometry: Geometry | None, xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, **kwargs: Unpack[UFuncKwargs] @@ -248,11 +249,18 @@ def delaunay_triangles( ) -> GeoArray: ... @overload def delaunay_triangles( - geometry: OptGeoArrayLike, tolerance: ArrayLike[FloatInt] = 0.0, *, only_edges: ArrayLikeSeq[bool], **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, + tolerance: ArrayLike[FloatInt] = 0.0, + *, + only_edges: ArrayLikeSeq[bool], + **kwargs: Unpack[UFuncKwargs], ) -> GeoArray: ... @overload def delaunay_triangles( - geometry: OptGeoArrayLike, tolerance: ArrayLikeSeq[FloatInt], only_edges: ArrayLike[bool] = False, **kwargs: Unpack[UFuncKwargs] + geometry: OptGeoArrayLike, + tolerance: ArrayLikeSeq[FloatInt], + only_edges: ArrayLike[bool] = False, + **kwargs: Unpack[UFuncKwargs], ) -> GeoArray: ... @overload def delaunay_triangles( @@ -412,7 +420,9 @@ def polygonize_full( @overload def remove_repeated_points(geometry: OptGeoT, tolerance: FloatInt = 0.0, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... @overload -def remove_repeated_points(geometry: OptGeoArrayLikeSeq, tolerance: FloatInt = 0.0, **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... +def remove_repeated_points( + geometry: OptGeoArrayLikeSeq, tolerance: FloatInt = 0.0, **kwargs: Unpack[UFuncKwargs] +) -> GeoArray: ... @overload def reverse(geometry: OptGeoT, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... @@ -422,12 +432,18 @@ def reverse(geometry: OptGeoArrayLikeSeq, **kwargs: Unpack[UFuncKwargs]) -> GeoA @overload def segmentize(geometry: OptGeoT, max_segment_length: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... @overload -def segmentize(geometry: OptGeoArrayLike, max_segment_length: ArrayLikeSeq[FloatInt], **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... +def segmentize( + geometry: OptGeoArrayLike, max_segment_length: ArrayLikeSeq[FloatInt], **kwargs: Unpack[UFuncKwargs] +) -> GeoArray: ... @overload -def segmentize(geometry: OptGeoArrayLikeSeq, max_segment_length: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs]) -> GeoArray: ... +def segmentize( + geometry: OptGeoArrayLikeSeq, max_segment_length: ArrayLike[FloatInt], **kwargs: Unpack[UFuncKwargs] +) -> GeoArray: ... @overload -def simplify(geometry: OptGeoT, tolerance: FloatInt, preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs]) -> OptGeoT: ... +def simplify( + geometry: OptGeoT, tolerance: FloatInt, preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs] +) -> OptGeoT: ... @overload def simplify( geometry: OptGeoArrayLike, tolerance: ArrayLikeSeq[FloatInt], preserve_topology: bool = True, **kwargs: Unpack[UFuncKwargs] diff --git a/stubs/shapely/shapely/creation.pyi b/stubs/shapely/shapely/creation.pyi index c872c1eb61c8..590a73759771 100644 --- a/stubs/shapely/shapely/creation.pyi +++ b/stubs/shapely/shapely/creation.pyi @@ -220,7 +220,9 @@ def polygons( ) -> Polygon | GeoArray: ... @overload -def box(xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, ccw: bool = True, **kwargs: Unpack[UFuncKwargsNoOut]) -> Polygon: ... +def box( + xmin: FloatInt, ymin: FloatInt, xmax: FloatInt, ymax: FloatInt, ccw: bool = True, **kwargs: Unpack[UFuncKwargsNoOut] +) -> Polygon: ... @overload def box( xmin: ArrayLikeSeq[FloatInt], diff --git a/stubs/shapely/shapely/geometry/base.pyi b/stubs/shapely/shapely/geometry/base.pyi index 29489e134bfc..7e740a88aa28 100644 --- a/stubs/shapely/shapely/geometry/base.pyi +++ b/stubs/shapely/shapely/geometry/base.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import MaybeNone +from _typeshed import FloatInt, MaybeNone from array import array from collections.abc import Iterator from typing import Any, Generic, Literal, overload diff --git a/stubs/shapely/shapely/measurement.pyi b/stubs/shapely/shapely/measurement.pyi index 0263f6b3123a..aa79689cb9ab 100644 --- a/stubs/shapely/shapely/measurement.pyi +++ b/stubs/shapely/shapely/measurement.pyi @@ -42,7 +42,9 @@ def length(geometry: OptGeoArrayLikeSeq, **kwargs) -> NDArray[np.float64]: ... @overload def hausdorff_distance(a: Geometry | None, b: Geometry | None, densify: FloatInt | None = None, **kwargs) -> np.float64: ... @overload -def hausdorff_distance(a: OptGeoArrayLike, b: OptGeoArrayLike, densify: ArrayLikeSeq[FloatInt], **kwargs) -> NDArray[np.float64]: ... +def hausdorff_distance( + a: OptGeoArrayLike, b: OptGeoArrayLike, densify: ArrayLikeSeq[FloatInt], **kwargs +) -> NDArray[np.float64]: ... @overload def hausdorff_distance( a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, densify: ArrayLike[FloatInt] | None = None, **kwargs @@ -55,7 +57,9 @@ def hausdorff_distance( @overload def frechet_distance(a: Geometry | None, b: Geometry | None, densify: FloatInt | None = None, **kwargs) -> np.float64: ... @overload -def frechet_distance(a: OptGeoArrayLike, b: OptGeoArrayLike, densify: ArrayLikeSeq[FloatInt], **kwargs) -> NDArray[np.float64]: ... +def frechet_distance( + a: OptGeoArrayLike, b: OptGeoArrayLike, densify: ArrayLikeSeq[FloatInt], **kwargs +) -> NDArray[np.float64]: ... @overload def frechet_distance( a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, densify: ArrayLike[FloatInt] | None = None, **kwargs diff --git a/stubs/shapely/shapely/predicates.pyi b/stubs/shapely/shapely/predicates.pyi index 74bfa85be852..c9282eb4c4f7 100644 --- a/stubs/shapely/shapely/predicates.pyi +++ b/stubs/shapely/shapely/predicates.pyi @@ -261,9 +261,13 @@ def relate_pattern( @overload def dwithin(a: Geometry | None, b: Geometry | None, distance: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> np.bool_: ... @overload -def dwithin(a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, distance: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> NDArray[np.bool_]: ... +def dwithin( + a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, distance: FloatInt, **kwargs: Unpack[UFuncKwargs] +) -> NDArray[np.bool_]: ... @overload -def dwithin(a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, distance: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> NDArray[np.bool_]: ... +def dwithin( + a: OptGeoArrayLike, b: OptGeoArrayLikeSeq, distance: FloatInt, **kwargs: Unpack[UFuncKwargs] +) -> NDArray[np.bool_]: ... @overload def contains_xy(geom: Geometry | None, x: FloatInt, y: FloatInt, **kwargs: Unpack[UFuncKwargs]) -> np.bool_: ... diff --git a/stubs/shapely/shapely/set_operations.pyi b/stubs/shapely/shapely/set_operations.pyi index 4572f72b13e6..bb219c5e40cc 100644 --- a/stubs/shapely/shapely/set_operations.pyi +++ b/stubs/shapely/shapely/set_operations.pyi @@ -61,9 +61,13 @@ def symmetric_difference( a: Geometry, b: Geometry, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] ) -> BaseGeometry: ... @overload -def symmetric_difference(a: None, b: Geometry | None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def symmetric_difference( + a: None, b: Geometry | None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] +) -> None: ... @overload -def symmetric_difference(a: Geometry | None, b: None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs]) -> None: ... +def symmetric_difference( + a: Geometry | None, b: None, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] +) -> None: ... @overload def symmetric_difference( a: OptGeoArrayLikeSeq, b: OptGeoArrayLike, grid_size: FloatInt | None = None, **kwargs: Unpack[UFuncKwargs] diff --git a/stubs/shapely/shapely/strtree.pyi b/stubs/shapely/shapely/strtree.pyi index 2ce943d49a59..9c379a91357a 100644 --- a/stubs/shapely/shapely/strtree.pyi +++ b/stubs/shapely/shapely/strtree.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import MaybeNone +from _typeshed import FloatInt, MaybeNone from typing import Literal, SupportsIndex, TypeAlias, overload import numpy as np diff --git a/stubs/shapely/shapely/testing.pyi b/stubs/shapely/shapely/testing.pyi index 0260d0429e4b..a24631f9800c 100644 --- a/stubs/shapely/shapely/testing.pyi +++ b/stubs/shapely/shapely/testing.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + from ._typing import ArrayLike, OptGeoArrayLike __all__ = ["assert_geometries_equal"] diff --git a/stubs/simple-websocket/simple_websocket/aiows.pyi b/stubs/simple-websocket/simple_websocket/aiows.pyi index 99f7ee40a405..223b5eea40d0 100644 --- a/stubs/simple-websocket/simple_websocket/aiows.pyi +++ b/stubs/simple-websocket/simple_websocket/aiows.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import asyncio import socket -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from _typeshed.wsgi import WSGIEnvironment from collections.abc import Awaitable, Callable from ssl import SSLContext diff --git a/stubs/simple-websocket/simple_websocket/ws.pyi b/stubs/simple-websocket/simple_websocket/ws.pyi index ccf6fe852f6e..53a8b653a368 100644 --- a/stubs/simple-websocket/simple_websocket/ws.pyi +++ b/stubs/simple-websocket/simple_websocket/ws.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import socket import threading -from _typeshed import FileDescriptorLike +from _typeshed import FileDescriptorLike, FloatInt from _typeshed.wsgi import WSGIEnvironment from collections.abc import Callable from selectors import SelectorKey diff --git a/stubs/tensorflow/tensorflow/__init__.pyi b/stubs/tensorflow/tensorflow/__init__.pyi index d1e275d4abda..44e3ccb6de57 100644 --- a/stubs/tensorflow/tensorflow/__init__.pyi +++ b/stubs/tensorflow/tensorflow/__init__.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import abc -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from abc import ABC, ABCMeta, abstractmethod from builtins import bool as _bool, slice as _slice from collections.abc import Callable, Generator, Iterable, Iterator, Sequence diff --git a/stubs/tensorflow/tensorflow/_aliases.pyi b/stubs/tensorflow/tensorflow/_aliases.pyi index 5b66491f7725..166723cda8a0 100644 --- a/stubs/tensorflow/tensorflow/_aliases.pyi +++ b/stubs/tensorflow/tensorflow/_aliases.pyi @@ -1,7 +1,7 @@ from _typeshed import FloatInt + # Commonly used type aliases. # Everything in this module is private for stubs. There is no runtime equivalent. - from collections.abc import Iterable, Mapping, Sequence from typing import Any, Protocol, TypeAlias, TypeVar, type_check_only diff --git a/stubs/tensorflow/tensorflow/feature_column/__init__.pyi b/stubs/tensorflow/tensorflow/feature_column/__init__.pyi index 7d2ebd9ee19d..9d9670a10698 100644 --- a/stubs/tensorflow/tensorflow/feature_column/__init__.pyi +++ b/stubs/tensorflow/tensorflow/feature_column/__init__.pyi @@ -12,7 +12,9 @@ def numeric_column( dtype: tf.DType = ..., normalizer_fn: Callable[[tf.Tensor], tf.Tensor] | None = None, ) -> fc.NumericColumn: ... -def bucketized_column(source_column: fc.NumericColumn, boundaries: list[FloatInt] | tuple[FloatInt, ...]) -> fc.BucketizedColumn: ... +def bucketized_column( + source_column: fc.NumericColumn, boundaries: list[FloatInt] | tuple[FloatInt, ...] +) -> fc.BucketizedColumn: ... def embedding_column( categorical_column: fc.CategoricalColumn, dimension: int, diff --git a/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi b/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi index 3b58fa29e292..ac74b004de7d 100644 --- a/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi +++ b/stubs/tensorflow/tensorflow/keras/layers/__init__.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Iterable, Sequence from typing import Any, Generic, Literal, TypeAlias, TypeVar, overload, type_check_only from typing_extensions import Self diff --git a/stubs/tensorflow/tensorflow/keras/losses.pyi b/stubs/tensorflow/tensorflow/keras/losses.pyi index 88b0895a90fe..b056d885094c 100644 --- a/stubs/tensorflow/tensorflow/keras/losses.pyi +++ b/stubs/tensorflow/tensorflow/keras/losses.pyi @@ -85,7 +85,11 @@ class Hinge(Loss): class Huber(Loss): def __init__( - self, delta: FloatInt = 1.0, reduction: _ReductionValues = "sum_over_batch_size", name: str | None = "huber_loss", dtype=None + self, + delta: FloatInt = 1.0, + reduction: _ReductionValues = "sum_over_batch_size", + name: str | None = "huber_loss", + dtype=None, ) -> None: ... def call(self, y_true: Tensor, y_pred: Tensor) -> Tensor: ... diff --git a/stubs/tensorflow/tensorflow/keras/metrics.pyi b/stubs/tensorflow/tensorflow/keras/metrics.pyi index b362232a2786..a5854edc3da7 100644 --- a/stubs/tensorflow/tensorflow/keras/metrics.pyi +++ b/stubs/tensorflow/tensorflow/keras/metrics.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from abc import ABCMeta, abstractmethod from collections.abc import Callable, Iterable, Sequence from enum import Enum @@ -94,7 +93,9 @@ class MeanMetricWrapper(Metric): def result(self) -> tf.Tensor: ... class BinaryAccuracy(MeanMetricWrapper): - def __init__(self, name: str | None = "binary_accuracy", dtype: DTypeLike | None = None, threshold: FloatInt = 0.5) -> None: ... + def __init__( + self, name: str | None = "binary_accuracy", dtype: DTypeLike | None = None, threshold: FloatInt = 0.5 + ) -> None: ... class Accuracy(MeanMetricWrapper): def __init__(self, name: str | None = "accuracy", dtype: DTypeLike | None = None) -> None: ... diff --git a/stubs/tensorflow/tensorflow/keras/models.pyi b/stubs/tensorflow/tensorflow/keras/models.pyi index 108ee4691b38..615a7df5b7a3 100644 --- a/stubs/tensorflow/tensorflow/keras/models.pyi +++ b/stubs/tensorflow/tensorflow/keras/models.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Callable, Container, Iterator from pathlib import Path from typing import Any, Literal, TypeAlias diff --git a/stubs/tensorflow/tensorflow/keras/optimizers/legacy/__init__.pyi b/stubs/tensorflow/tensorflow/keras/optimizers/legacy/__init__.pyi index cd805bfcdf0e..6497e0bb936a 100644 --- a/stubs/tensorflow/tensorflow/keras/optimizers/legacy/__init__.pyi +++ b/stubs/tensorflow/tensorflow/keras/optimizers/legacy/__init__.pyi @@ -55,7 +55,12 @@ class Adagrad(Optimizer): class SGD(Optimizer): def __init__( - self, learning_rate: _LearningRate = 0.01, momentum: FloatInt = 0.0, nesterov: bool = False, name: str = "SGD", **kwargs: Any + self, + learning_rate: _LearningRate = 0.01, + momentum: FloatInt = 0.0, + nesterov: bool = False, + name: str = "SGD", + **kwargs: Any, ) -> None: ... def __getattr__(name: str): ... # incomplete module diff --git a/stubs/tensorflow/tensorflow/python/feature_column/feature_column_v2.pyi b/stubs/tensorflow/tensorflow/python/feature_column/feature_column_v2.pyi index 0417bc306559..ecc8f4a49728 100644 --- a/stubs/tensorflow/tensorflow/python/feature_column/feature_column_v2.pyi +++ b/stubs/tensorflow/tensorflow/python/feature_column/feature_column_v2.pyi @@ -1,9 +1,7 @@ -from _typeshed import FloatInt # The types here are all undocumented, but all feature columns are return types of the # public functions in tf.feature_column. As they are undocumented internals while some # common methods are included, they are incomplete and do not have getattr Incomplete fallback. - -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from abc import ABC, ABCMeta, abstractmethod from collections.abc import Callable, Sequence from typing import Literal, TypeAlias diff --git a/stubs/tensorflow/tensorflow/summary.pyi b/stubs/tensorflow/tensorflow/summary.pyi index a5df27120b66..2b91059bfd8f 100644 --- a/stubs/tensorflow/tensorflow/summary.pyi +++ b/stubs/tensorflow/tensorflow/summary.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import abc +from _typeshed import FloatInt from collections.abc import Callable, Generator from contextlib import AbstractContextManager, contextmanager from typing import Literal @@ -50,7 +50,9 @@ def image( ) -> bool: ... @contextmanager def record_if(condition: bool | tf.Tensor | Callable[[], bool]) -> Generator[None]: ... -def scalar(name: str, data: FloatInt | tf.Tensor, step: int | tf.Tensor | None = None, description: str | None = None) -> bool: ... +def scalar( + name: str, data: FloatInt | tf.Tensor, step: int | tf.Tensor | None = None, description: str | None = None +) -> bool: ... def should_record_summaries() -> bool: ... def text(name: str, data: str | tf.Tensor, step: int | tf.Tensor | None = None, description: str | None = None) -> bool: ... def trace_export(name: str, step: int | tf.Tensor | None = None, profiler_outdir: str | None = None) -> None: ... diff --git a/stubs/tinycss2/tinycss2/ast.pyi b/stubs/tinycss2/tinycss2/ast.pyi index 4155b2a440ca..2d8a50184f33 100644 --- a/stubs/tinycss2/tinycss2/ast.pyi +++ b/stubs/tinycss2/tinycss2/ast.pyi @@ -105,7 +105,9 @@ class DimensionToken(Node): unit: str lower_unit: str repr_format: str - def __init__(self, line: int, column: int, value: FloatInt, int_value: int | None, representation: str, unit: str) -> None: ... + def __init__( + self, line: int, column: int, value: FloatInt, int_value: int | None, representation: str, unit: str + ) -> None: ... class ParenthesesBlock(Node): type: Literal["() block"] diff --git a/stubs/tqdm/tqdm/_monitor.pyi b/stubs/tqdm/tqdm/_monitor.pyi index d955494912ed..939c4d61e0ea 100644 --- a/stubs/tqdm/tqdm/_monitor.pyi +++ b/stubs/tqdm/tqdm/_monitor.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from threading import Thread __all__ = ["TMonitor", "TqdmSynchronisationWarning"] diff --git a/stubs/tqdm/tqdm/asyncio.pyi b/stubs/tqdm/tqdm/asyncio.pyi index 9f767adc7e17..c657ca643a9f 100644 --- a/stubs/tqdm/tqdm/asyncio.pyi +++ b/stubs/tqdm/tqdm/asyncio.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsWrite +from _typeshed import FloatInt, SupportsWrite from asyncio import Future from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Iterator, Mapping from typing import TypeVar, overload diff --git a/stubs/tqdm/tqdm/contrib/concurrent.pyi b/stubs/tqdm/tqdm/contrib/concurrent.pyi index 08229468b593..2d1893e39d44 100644 --- a/stubs/tqdm/tqdm/contrib/concurrent.pyi +++ b/stubs/tqdm/tqdm/contrib/concurrent.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import SupportsWrite +from _typeshed import FloatInt, SupportsWrite from collections.abc import Callable, Generator, Iterable, Mapping from contextlib import contextmanager from multiprocessing.context import BaseContext diff --git a/stubs/tqdm/tqdm/contrib/discord.pyi b/stubs/tqdm/tqdm/contrib/discord.pyi index 686ff22b6b7f..07dcd6bf3be8 100644 --- a/stubs/tqdm/tqdm/contrib/discord.pyi +++ b/stubs/tqdm/tqdm/contrib/discord.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from concurrent.futures import Future from typing import TypeVar, overload diff --git a/stubs/tqdm/tqdm/contrib/slack.pyi b/stubs/tqdm/tqdm/contrib/slack.pyi index e1895fc5ec77..a752fd6620c2 100644 --- a/stubs/tqdm/tqdm/contrib/slack.pyi +++ b/stubs/tqdm/tqdm/contrib/slack.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from typing import TypeVar, overload from typing_extensions import Never diff --git a/stubs/tqdm/tqdm/contrib/telegram.pyi b/stubs/tqdm/tqdm/contrib/telegram.pyi index ced64b0d51c6..12b9bb44a601 100644 --- a/stubs/tqdm/tqdm/contrib/telegram.pyi +++ b/stubs/tqdm/tqdm/contrib/telegram.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from typing import TypeVar, overload from typing_extensions import Never diff --git a/stubs/tqdm/tqdm/gui.pyi b/stubs/tqdm/tqdm/gui.pyi index f553e7d7b599..2ed509e8cf3f 100644 --- a/stubs/tqdm/tqdm/gui.pyi +++ b/stubs/tqdm/tqdm/gui.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from typing import TypeVar, overload from typing_extensions import Never diff --git a/stubs/tqdm/tqdm/notebook.pyi b/stubs/tqdm/tqdm/notebook.pyi index df4f3d6d70b4..8989b56744bd 100644 --- a/stubs/tqdm/tqdm/notebook.pyi +++ b/stubs/tqdm/tqdm/notebook.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsWrite from collections.abc import Iterable, Iterator, Mapping from typing import TypeVar, overload from typing_extensions import Never diff --git a/stubs/tqdm/tqdm/rich.pyi b/stubs/tqdm/tqdm/rich.pyi index 148fe813bee8..94f5f9ad2c44 100644 --- a/stubs/tqdm/tqdm/rich.pyi +++ b/stubs/tqdm/tqdm/rich.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsWrite from abc import ABC, abstractmethod from collections.abc import Iterable, Mapping from typing import TypeVar, overload, type_check_only diff --git a/stubs/tqdm/tqdm/std.pyi b/stubs/tqdm/tqdm/std.pyi index 67221a906083..69dfa3c85a1c 100644 --- a/stubs/tqdm/tqdm/std.pyi +++ b/stubs/tqdm/tqdm/std.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import contextlib -from _typeshed import Incomplete, SupportsRead, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsRead, SupportsWrite from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping from types import TracebackType from typing import Any, ClassVar, Generic, Literal, TypeVar, overload diff --git a/stubs/tqdm/tqdm/tk.pyi b/stubs/tqdm/tqdm/tk.pyi index 9a0afabcb354..12b732adc127 100644 --- a/stubs/tqdm/tqdm/tk.pyi +++ b/stubs/tqdm/tqdm/tk.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete, SupportsWrite +from _typeshed import FloatInt, Incomplete, SupportsWrite from collections.abc import Iterable, Mapping from typing import TypeVar, overload from typing_extensions import Never diff --git a/stubs/ttkthemes/ttkthemes/_widget.pyi b/stubs/ttkthemes/ttkthemes/_widget.pyi index 60fd8e5f29a3..eb9babcca064 100644 --- a/stubs/ttkthemes/ttkthemes/_widget.pyi +++ b/stubs/ttkthemes/ttkthemes/_widget.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import _tkinter -from _typeshed import StrPath +from _typeshed import FloatInt, StrPath from typing import ClassVar class ThemedWidget: diff --git a/stubs/ttkthemes/ttkthemes/themed_tk.pyi b/stubs/ttkthemes/ttkthemes/themed_tk.pyi index bfad19060bef..f742355ada5a 100644 --- a/stubs/ttkthemes/ttkthemes/themed_tk.pyi +++ b/stubs/ttkthemes/ttkthemes/themed_tk.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import tkinter +from _typeshed import FloatInt from collections.abc import Callable from typing import Any, Literal diff --git a/stubs/uWSGI/uwsgi.pyi b/stubs/uWSGI/uwsgi.pyi index 8c58e5ec61ea..90e1285a8b98 100644 --- a/stubs/uWSGI/uwsgi.pyi +++ b/stubs/uWSGI/uwsgi.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import HasFileno, OptExcInfo, ReadOnlyBuffer +from _typeshed import FloatInt, HasFileno, OptExcInfo, ReadOnlyBuffer from _typeshed.wsgi import WSGIApplication from collections.abc import Callable from types import ModuleType diff --git a/stubs/vobject/vobject/icalendar.pyi b/stubs/vobject/vobject/icalendar.pyi index 94e267e13318..72287e03803b 100644 --- a/stubs/vobject/vobject/icalendar.pyi +++ b/stubs/vobject/vobject/icalendar.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Iterable from datetime import timedelta, tzinfo from typing import Final, Literal, overload diff --git a/stubs/waitress/waitress/wasyncore.pyi b/stubs/waitress/waitress/wasyncore.pyi index 3e4ff9ae2b50..252625fb075b 100644 --- a/stubs/waitress/waitress/wasyncore.pyi +++ b/stubs/waitress/waitress/wasyncore.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import ReadableBuffer +from _typeshed import FloatInt, ReadableBuffer from collections.abc import Mapping from io import BytesIO from logging import Logger diff --git a/stubs/workalendar/workalendar/skyfield_astronomy.pyi b/stubs/workalendar/workalendar/skyfield_astronomy.pyi index b37b58ceef4d..6b3232554293 100644 --- a/stubs/workalendar/workalendar/skyfield_astronomy.pyi +++ b/stubs/workalendar/workalendar/skyfield_astronomy.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import datetime -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from math import _SupportsFloatOrIndex from typing import Final diff --git a/stubs/wurlitzer/wurlitzer.pyi b/stubs/wurlitzer/wurlitzer.pyi index 3d2a8feea576..e21ec9066efc 100644 --- a/stubs/wurlitzer/wurlitzer.pyi +++ b/stubs/wurlitzer/wurlitzer.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + __all__ = ["STDOUT", "PIPE", "Wurlitzer", "pipes", "sys_pipes", "sys_pipes_forever", "stop_sys_pipes"] import contextlib diff --git a/stubs/xlrd/xlrd/book.pyi b/stubs/xlrd/xlrd/book.pyi index f5fda73f7589..7e92c47af7ce 100644 --- a/stubs/xlrd/xlrd/book.pyi +++ b/stubs/xlrd/xlrd/book.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import sys -from _typeshed import SupportsWrite +from _typeshed import FloatInt, SupportsWrite from collections.abc import Iterator from types import TracebackType from typing import Final, Literal diff --git a/stubs/xlrd/xlrd/formula.pyi b/stubs/xlrd/xlrd/formula.pyi index 44dd7f1921a3..4f78102508f3 100644 --- a/stubs/xlrd/xlrd/formula.pyi +++ b/stubs/xlrd/xlrd/formula.pyi @@ -53,7 +53,9 @@ class Operand: kind: int text: str rank: int - def __init__(self, akind: int | None = None, avalue: FloatInt | str | None = None, arank: int = 0, atext: str = "?") -> None: ... + def __init__( + self, akind: int | None = None, avalue: FloatInt | str | None = None, arank: int = 0, atext: str = "?" + ) -> None: ... class Ref3D(tuple[int, int, int, int, int, int, int, int, int, int, int, int]): coords: tuple[int, int, int, int, int, int] diff --git a/stubs/xlrd/xlrd/sheet.pyi b/stubs/xlrd/xlrd/sheet.pyi index 473355ea7484..97aa3c141f18 100644 --- a/stubs/xlrd/xlrd/sheet.pyi +++ b/stubs/xlrd/xlrd/sheet.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import SupportsWrite +from _typeshed import FloatInt, SupportsWrite from array import array from collections.abc import Callable, Generator, Sequence from typing import Any, Final, Literal, overload diff --git a/stubs/xlrd/xlrd/xldate.pyi b/stubs/xlrd/xlrd/xldate.pyi index 0ace80aad1f9..bf275a18caaf 100644 --- a/stubs/xlrd/xlrd/xldate.pyi +++ b/stubs/xlrd/xlrd/xldate.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from typing import Final, Literal _JDN_delta: Final[tuple[int, int]] diff --git a/stubs/xmldiff/xmldiff/diff.pyi b/stubs/xmldiff/xmldiff/diff.pyi index 00bb30656f9d..b50cd965e3ed 100644 --- a/stubs/xmldiff/xmldiff/diff.pyi +++ b/stubs/xmldiff/xmldiff/diff.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete from collections.abc import Generator from typing import Literal diff --git a/stubs/xmldiff/xmldiff/diff_match_patch.pyi b/stubs/xmldiff/xmldiff/diff_match_patch.pyi index d862e7f432b7..04d5be651864 100644 --- a/stubs/xmldiff/xmldiff/diff_match_patch.pyi +++ b/stubs/xmldiff/xmldiff/diff_match_patch.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import Incomplete +from _typeshed import FloatInt, Incomplete class diff_match_patch: Diff_Timeout: FloatInt diff --git a/stubs/yt-dlp/yt_dlp/compat/__init__.pyi b/stubs/yt-dlp/yt_dlp/compat/__init__.pyi index a30bda112e74..2afd237ec79e 100644 --- a/stubs/yt-dlp/yt_dlp/compat/__init__.pyi +++ b/stubs/yt-dlp/yt_dlp/compat/__init__.pyi @@ -1,7 +1,7 @@ -from _typeshed import FloatInt import datetime import urllib.request import xml.etree.ElementTree as etree +from _typeshed import FloatInt from yt_dlp.networking import Request diff --git a/stubs/yt-dlp/yt_dlp/downloader/common.pyi b/stubs/yt-dlp/yt_dlp/downloader/common.pyi index 1146fc906d0f..f3c2f7bb898e 100644 --- a/stubs/yt-dlp/yt_dlp/downloader/common.pyi +++ b/stubs/yt-dlp/yt_dlp/downloader/common.pyi @@ -1,5 +1,4 @@ -from _typeshed import FloatInt -from _typeshed import OpenBinaryMode, OpenTextMode +from _typeshed import FloatInt, OpenBinaryMode, OpenTextMode from collections.abc import Callable, Mapping from typing import IO, Any, AnyStr, TypedDict, type_check_only diff --git a/stubs/yt-dlp/yt_dlp/extractor/common.pyi b/stubs/yt-dlp/yt_dlp/extractor/common.pyi index cb57d87c9265..0c4d564df4e4 100644 --- a/stubs/yt-dlp/yt_dlp/extractor/common.pyi +++ b/stubs/yt-dlp/yt_dlp/extractor/common.pyi @@ -1,6 +1,5 @@ -from _typeshed import FloatInt import re -from _typeshed import Incomplete, Unused +from _typeshed import FloatInt, Incomplete, Unused from collections.abc import Callable, Collection, Iterable, Iterator, Mapping, Sequence from functools import cached_property from json.decoder import JSONDecoder diff --git a/stubs/yt-dlp/yt_dlp/jsinterp.pyi b/stubs/yt-dlp/yt_dlp/jsinterp.pyi index 2ec8009d8dcf..0476af1b4bb5 100644 --- a/stubs/yt-dlp/yt_dlp/jsinterp.pyi +++ b/stubs/yt-dlp/yt_dlp/jsinterp.pyi @@ -1,6 +1,6 @@ -from _typeshed import FloatInt import collections import types +from _typeshed import FloatInt from collections.abc import Callable, Collection, Iterable, Mapping from typing import Any, TypeAlias from typing_extensions import Never diff --git a/stubs/yt-dlp/yt_dlp/networking/_helper.pyi b/stubs/yt-dlp/yt_dlp/networking/_helper.pyi index 74af6bb85415..9e142072e16f 100644 --- a/stubs/yt-dlp/yt_dlp/networking/_helper.pyi +++ b/stubs/yt-dlp/yt_dlp/networking/_helper.pyi @@ -1,7 +1,6 @@ -from _typeshed import FloatInt import ssl from _socket import _Address -from _typeshed import StrOrBytesPath +from _typeshed import FloatInt, StrOrBytesPath from collections.abc import Callable, Iterable, Mapping from socket import AddressFamily, SocketKind from typing import Any, TypeAlias @@ -36,7 +35,11 @@ _IPAddress: TypeAlias = tuple[ ] def create_socks_proxy_socket( - dest_addr: _Address, proxy_args: Mapping[str, Any], proxy_ip_addr: _IPAddress, timeout: FloatInt | None, source_address: _Address + dest_addr: _Address, + proxy_args: Mapping[str, Any], + proxy_ip_addr: _IPAddress, + timeout: FloatInt | None, + source_address: _Address, ) -> sockssocket: ... def create_connection( address: tuple[str, int], diff --git a/stubs/yt-dlp/yt_dlp/networking/common.pyi b/stubs/yt-dlp/yt_dlp/networking/common.pyi index 99636168fcd6..61c2b41a12ad 100644 --- a/stubs/yt-dlp/yt_dlp/networking/common.pyi +++ b/stubs/yt-dlp/yt_dlp/networking/common.pyi @@ -1,8 +1,7 @@ -from _typeshed import FloatInt import abc import enum import io -from _typeshed import Unused +from _typeshed import FloatInt, Unused from collections.abc import Callable, Iterable, Mapping from email.message import Message from logging import Logger diff --git a/stubs/yt-dlp/yt_dlp/utils/_utils.pyi b/stubs/yt-dlp/yt_dlp/utils/_utils.pyi index 675b18284ad9..ee9045b81510 100644 --- a/stubs/yt-dlp/yt_dlp/utils/_utils.pyi +++ b/stubs/yt-dlp/yt_dlp/utils/_utils.pyi @@ -1,4 +1,3 @@ -from _typeshed import FloatInt import enum import html.parser import json @@ -11,6 +10,7 @@ from _typeshed import ( ExcInfo, FileDescriptorLike, FileDescriptorOrPath, + FloatInt, MaybeNone, OpenBinaryMode, OpenTextMode, diff --git a/stubs/yt-dlp/yt_dlp/utils/progress.pyi b/stubs/yt-dlp/yt_dlp/utils/progress.pyi index 342088a389a9..55f7eae0710e 100644 --- a/stubs/yt-dlp/yt_dlp/utils/progress.pyi +++ b/stubs/yt-dlp/yt_dlp/utils/progress.pyi @@ -1,4 +1,5 @@ from _typeshed import FloatInt + class ProgressCalculator: SAMPLING_WINDOW: int SAMPLING_RATE: FloatInt diff --git a/stubs/zxcvbn/zxcvbn/__init__.pyi b/stubs/zxcvbn/zxcvbn/__init__.pyi index ea924421fc39..b1d0be7fc2a9 100644 --- a/stubs/zxcvbn/zxcvbn/__init__.pyi +++ b/stubs/zxcvbn/zxcvbn/__init__.pyi @@ -1,5 +1,5 @@ -from _typeshed import FloatInt import datetime +from _typeshed import FloatInt from collections.abc import Iterable from decimal import Decimal from typing import TypedDict, type_check_only From 4a5bd65d2d3815e86264734f45fdd8799301bf76 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 13 Nov 2026 17:09:09 +0100 Subject: [PATCH 03/11] Various changes --- .../integrations/django_oauth1/nonce.pyi | 2 +- stubs/channels/channels/generic/websocket.pyi | 4 +-- stubs/croniter/croniter/croniter.pyi | 4 +-- stubs/docker/docker/_types.pyi | 2 +- stubs/gdb/gdb/__init__.pyi | 2 +- stubs/openpyxl/openpyxl/descriptors/base.pyi | 32 +++++++++---------- .../protobuf/internal/extension_dict.pyi | 3 +- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/stubs/Authlib/authlib/integrations/django_oauth1/nonce.pyi b/stubs/Authlib/authlib/integrations/django_oauth1/nonce.pyi index 19cfe5b2e926..9570a0a05b9b 100644 --- a/stubs/Authlib/authlib/integrations/django_oauth1/nonce.pyi +++ b/stubs/Authlib/authlib/integrations/django_oauth1/nonce.pyi @@ -1 +1 @@ -def exists_nonce_in_cache(nonce, request, timeout: int | float | None) -> bool: ... +def exists_nonce_in_cache(nonce, request, timeout: float | int | None) -> bool: ... diff --git a/stubs/channels/channels/generic/websocket.pyi b/stubs/channels/channels/generic/websocket.pyi index f19d406e1e5d..22c7cb0ea2de 100644 --- a/stubs/channels/channels/generic/websocket.pyi +++ b/stubs/channels/channels/generic/websocket.pyi @@ -23,7 +23,7 @@ class WebsocketConsumer(SyncConsumer): class JsonWebsocketConsumer(WebsocketConsumer): def receive(self, text_data: str | None = None, bytes_data: bytes | None = None, **kwargs: Any) -> None: ... # content is typed as Any to match json.loads() return type - JSON can represent - # various Python types (dict, list, str, int, float, bool, None) + # various Python types (dict, list, str, float, int, bool, None) def receive_json(self, content: Any, **kwargs: Any) -> None: ... # content is typed as Any to match json.dumps() input type - accepts any JSON-serializable object def send_json(self, content: Any, close: bool = False) -> None: ... @@ -51,7 +51,7 @@ class AsyncWebsocketConsumer(AsyncConsumer): class AsyncJsonWebsocketConsumer(AsyncWebsocketConsumer): async def receive(self, text_data: str | None = None, bytes_data: bytes | None = None, **kwargs: Any) -> None: ... # content is typed as Any to match json.loads() return type - JSON can represent - # various Python types (dict, list, str, int, float, bool, None) + # various Python types (dict, list, str, float, int, bool, None) async def receive_json(self, content: Any, **kwargs: Any) -> None: ... # content is typed as Any to match json.dumps() input type - accepts any JSON-serializable object async def send_json(self, content: Any, close: bool = False) -> None: ... diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index 8f0119cb1d6f..09c368c35c68 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -5,8 +5,8 @@ from re import Match, Pattern from typing import Any, Final, Generic, Literal, Protocol, TypeAlias, TypeVar, overload, type_check_only from typing_extensions import Never, Self -_R_co = TypeVar("_R_co", float, datetime.datetime, default=float, covariant=True) -_R2_co = TypeVar("_R2_co", float, datetime.datetime, covariant=True) +_R_co = TypeVar("_R_co", FloatInt, datetime.datetime, default=FloatInt, covariant=True) +_R2_co = TypeVar("_R2_co", FloatInt, datetime.datetime, covariant=True) _Expressions: TypeAlias = list[str] # fixed-length list of 5 or 6 strings ExpandedExpression: TypeAlias = list[int | Literal["*", "l"]] diff --git a/stubs/docker/docker/_types.pyi b/stubs/docker/docker/_types.pyi index 5500470c6fa5..78acaf31c753 100644 --- a/stubs/docker/docker/_types.pyi +++ b/stubs/docker/docker/_types.pyi @@ -7,7 +7,7 @@ from typing_extensions import NotRequired # Type alias for JSON, explained at: # https://github.com/python/typing/issues/182#issuecomment-1320974824. -JSON: TypeAlias = dict[str, JSON] | list[JSON] | str | int | float | bool | None +JSON: TypeAlias = dict[str, JSON] | list[JSON] | str | float | int | bool | None @type_check_only class ContainerWeightDevice(TypedDict): diff --git a/stubs/gdb/gdb/__init__.pyi b/stubs/gdb/gdb/__init__.pyi index 5911d37ab914..b95fc89224cf 100644 --- a/stubs/gdb/gdb/__init__.pyi +++ b/stubs/gdb/gdb/__init__.pyi @@ -72,7 +72,7 @@ class GdbError(Exception): ... # Values -_ValueOrNative: TypeAlias = bool | int | float | str | Value | LazyString +_ValueOrNative: TypeAlias = bool | float | int | str | Value | LazyString _ValueOrInt: TypeAlias = Value | int @disjoint_base diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index 2e9b58890468..3d4585f55b89 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -113,11 +113,11 @@ class Convertible(Typed[_T, _N]): # float @overload def __set__( - self: Convertible[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None + self: Convertible[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None ) -> None: ... @overload def __set__( - self: Convertible[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat + self: Convertible[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat ) -> None: ... # Anything else @overload @@ -126,7 +126,7 @@ class Convertible(Typed[_T, _N]): class Max(Convertible[_M, _N]): expected_type: type[_M] allow_none: _N - max: FloatInt + max: float | int @overload def __init__( @@ -143,17 +143,17 @@ class Max(Convertible[_M, _N]): # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: Max[FloatInt, Literal[True]], + self: Max[float, Literal[True]], *, - expected_type: _ExpectedTypeParam[FloatInt] = ..., + expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], max: FloatInt, ) -> None: ... @overload def __init__( - self: Max[FloatInt, Literal[False]], + self: Max[float, Literal[False]], *, - expected_type: _ExpectedTypeParam[FloatInt] = ..., + expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[False] = False, max: FloatInt, ) -> None: ... @@ -172,7 +172,7 @@ class Max(Convertible[_M, _N]): class Min(Convertible[_M, _N]): expected_type: type[_M] allow_none: _N - min: FloatInt + min: float | int @overload def __init__( @@ -189,17 +189,17 @@ class Min(Convertible[_M, _N]): # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: Min[FloatInt, Literal[True]], + self: Min[float, Literal[True]], *, - expected_type: _ExpectedTypeParam[FloatInt] = ..., + expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], min: FloatInt, ) -> None: ... @overload def __init__( - self: Min[FloatInt, Literal[False]], + self: Min[float, Literal[False]], *, - expected_type: _ExpectedTypeParam[FloatInt] = ..., + expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[False] = False, min: FloatInt, ) -> None: ... @@ -240,18 +240,18 @@ class MinMax(Min[_M, _N], Max[_M, _N]): # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: MinMax[FloatInt, Literal[True]], + self: MinMax[float, Literal[True]], *, - expected_type: _ExpectedTypeParam[FloatInt] = ..., + expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], min: FloatInt, max: FloatInt, ) -> None: ... @overload def __init__( - self: MinMax[FloatInt, Literal[False]], + self: MinMax[float, Literal[False]], *, - expected_type: _ExpectedTypeParam[FloatInt] = ..., + expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[False] = False, min: FloatInt, max: FloatInt, diff --git a/stubs/protobuf/google/protobuf/internal/extension_dict.pyi b/stubs/protobuf/google/protobuf/internal/extension_dict.pyi index f2a4c1290a8e..628f1810c3c5 100644 --- a/stubs/protobuf/google/protobuf/internal/extension_dict.pyi +++ b/stubs/protobuf/google/protobuf/internal/extension_dict.pyi @@ -1,3 +1,4 @@ +from _typeshed import FloatInt from collections.abc import Iterator from typing import Any, Generic, TypeVar, type_check_only @@ -8,7 +9,7 @@ from google.protobuf.message import Message _ContainerMessageT = TypeVar("_ContainerMessageT", bound=Message) _ExtenderMessageT = TypeVar( "_ExtenderMessageT", - bound=Message | RepeatedScalarFieldContainer[Any] | RepeatedCompositeFieldContainer[Any] | bool | float | str | bytes, + bound=Message | RepeatedScalarFieldContainer[Any] | RepeatedCompositeFieldContainer[Any] | bool | FloatInt | str | bytes, ) @type_check_only From 6c87d4d7f6c648fecbc927c380a32839357a594d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 16:11:25 +0000 Subject: [PATCH 04/11] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/openpyxl/openpyxl/descriptors/base.pyi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index 3d4585f55b89..5b1d17b427eb 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -116,9 +116,7 @@ class Convertible(Typed[_T, _N]): self: Convertible[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None ) -> None: ... @overload - def __set__( - self: Convertible[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat - ) -> None: ... + def __set__(self: Convertible[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... # Anything else @overload def __set__(self: Convertible[_T, Literal[True]], instance: Serialisable | Strict, value: _T | int | Any | None) -> None: ... From df89b7af55207f6458cf12ea1c5e416d39943195 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 13 Nov 2026 17:14:22 +0100 Subject: [PATCH 05/11] Fix croniter --- stubs/croniter/croniter/croniter.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/croniter/croniter/croniter.pyi b/stubs/croniter/croniter/croniter.pyi index 09c368c35c68..8f0119cb1d6f 100644 --- a/stubs/croniter/croniter/croniter.pyi +++ b/stubs/croniter/croniter/croniter.pyi @@ -5,8 +5,8 @@ from re import Match, Pattern from typing import Any, Final, Generic, Literal, Protocol, TypeAlias, TypeVar, overload, type_check_only from typing_extensions import Never, Self -_R_co = TypeVar("_R_co", FloatInt, datetime.datetime, default=FloatInt, covariant=True) -_R2_co = TypeVar("_R2_co", FloatInt, datetime.datetime, covariant=True) +_R_co = TypeVar("_R_co", float, datetime.datetime, default=float, covariant=True) +_R2_co = TypeVar("_R2_co", float, datetime.datetime, covariant=True) _Expressions: TypeAlias = list[str] # fixed-length list of 5 or 6 strings ExpandedExpression: TypeAlias = list[int | Literal["*", "l"]] From 342853b817333d6665516aeae0aaf9167429ebdb Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 13 Nov 2026 17:14:57 +0100 Subject: [PATCH 06/11] Fix grpc --- stubs/grpcio/grpc/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/grpcio/grpc/__init__.pyi b/stubs/grpcio/grpc/__init__.pyi index 05f3e0d10449..ab095fb58b8d 100644 --- a/stubs/grpcio/grpc/__init__.pyi +++ b/stubs/grpcio/grpc/__init__.pyi @@ -362,7 +362,7 @@ class Call(RpcContext, metaclass=abc.ABCMeta): class ClientCallDetails(abc.ABC): method: str - timeout: FloatInt | None + timeout: float | None metadata: _Metadata | None credentials: CallCredentials | None From 26863ea25bdde0dd15845d875a7a9828d089fb15 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 13 Nov 2026 17:19:21 +0100 Subject: [PATCH 07/11] Fix noqa position --- stubs/geopandas/geopandas/base.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/geopandas/geopandas/base.pyi b/stubs/geopandas/geopandas/base.pyi index 635ab7105cd4..67ed7fdf96f1 100644 --- a/stubs/geopandas/geopandas/base.pyi +++ b/stubs/geopandas/geopandas/base.pyi @@ -31,9 +31,9 @@ _ConvertibleToCRS: TypeAlias = str | int | tuple[str, str] | list[str] | dict[st _AffinityOrigin: TypeAlias = ( Literal["center", "centroid"] | Point | tuple[FloatInt, FloatInt] | tuple[FloatInt, FloatInt, FloatInt] ) -_ClipMask: TypeAlias = ( +_ClipMask: TypeAlias = ( # noqa: Y047 GeoDataFrame | GeoSeries | Polygon | MultiPolygon | tuple[FloatInt, FloatInt, FloatInt, FloatInt] -) # noqa: Y047 +) # np.floating[Any] because precision is not important _BboxLike: TypeAlias = Sequence[FloatInt] | NDArray[np.floating[Any]] | Geometry | GeoDataFrame | GeoSeries # noqa: Y047 _MaskLike: TypeAlias = dict[str, Incomplete] | Geometry | GeoDataFrame | GeoSeries # noqa: Y047 From e2bc83d43d677f2b00b143347e577ba78bcc95bb Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 13 Nov 2026 17:26:30 +0100 Subject: [PATCH 08/11] Work around openpyxl problem --- stubs/openpyxl/openpyxl/descriptors/base.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index 5b1d17b427eb..609501df4a1f 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -13,7 +13,7 @@ _T = TypeVar("_T") _P = TypeVar("_P", str, ReadableBuffer) _N = TypeVar("_N", bound=bool, default=Literal[False]) _L = TypeVar("_L", bound=Sized) -_M = TypeVar("_M", int, float) +_M = TypeVar("_M", int, float, FloatInt) # TODO: remove FloatInt, update users _ExpectedTypeParam: TypeAlias = type[_T] | tuple[type[_T], ...] _ConvertibleToMultiCellRange: TypeAlias = MultiCellRange | str | Iterable[CellRange] From fc26f6d1e827675e172f9d415b004b5915e4193d Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 13 Nov 2026 17:33:14 +0100 Subject: [PATCH 09/11] Fix convertdate --- stubs/convertdate/convertdate/utils.pyi | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/stubs/convertdate/convertdate/utils.pyi b/stubs/convertdate/convertdate/utils.pyi index d628b57c88e4..692a6fd999da 100644 --- a/stubs/convertdate/convertdate/utils.pyi +++ b/stubs/convertdate/convertdate/utils.pyi @@ -1,54 +1,53 @@ -from _typeshed import FloatInt from typing import Final, Literal, overload -TROPICALYEAR: Final[FloatInt] +TROPICALYEAR: Final[float] @overload -def amod(a: FloatInt, b: int) -> int: ... +def amod(a: float | int, b: int) -> int: ... @overload -def amod(a: FloatInt, b: FloatInt) -> float: ... +def amod(a: float | int, b: float) -> float: ... -def jwday(j: FloatInt) -> int: ... +def jwday(j: float | int) -> int: ... @overload def weekday_before(weekday: int, jd: int) -> int: ... @overload -def weekday_before(weekday: int, jd: FloatInt) -> float: ... +def weekday_before(weekday: int, jd: float) -> float: ... @overload def search_weekday(weekday: int, jd: int, direction: Literal[-1, 1], offset: int) -> int: ... @overload -def search_weekday(weekday: int, jd: FloatInt, direction: Literal[-1, 1], offset: int) -> float: ... +def search_weekday(weekday: int, jd: float, direction: Literal[-1, 1], offset: int) -> float: ... @overload def nearest_weekday(weekday: int, jd: int) -> int: ... @overload -def nearest_weekday(weekday: int, jd: FloatInt) -> float: ... +def nearest_weekday(weekday: int, jd: float) -> float: ... @overload def next_weekday(weekday: int, jd: int) -> int: ... @overload -def next_weekday(weekday: int, jd: FloatInt) -> float: ... +def next_weekday(weekday: int, jd: float) -> float: ... @overload def next_or_current_weekday(weekday: int, jd: int) -> int: ... @overload -def next_or_current_weekday(weekday: int, jd: FloatInt) -> float: ... +def next_or_current_weekday(weekday: int, jd: float) -> float: ... @overload def previous_weekday(weekday: int, jd: int) -> int: ... @overload -def previous_weekday(weekday: int, jd: FloatInt) -> float: ... +def previous_weekday(weekday: int, jd: float) -> float: ... @overload def previous_or_current_weekday(weekday: int, jd: int) -> int: ... @overload -def previous_or_current_weekday(weekday: int, jd: FloatInt) -> float: ... +def previous_or_current_weekday(weekday: int, jd: float) -> float: ... @overload def n_weeks(weekday: int, jd: int, nthweek: int) -> int: ... @overload -def n_weeks(weekday: int, jd: FloatInt, nthweek: int) -> float: ... +def n_weeks(weekday: int, jd: float, nthweek: int) -> float: ... def monthcalendarhelper(start_weekday: int, month_length: int) -> list[list[int | None]]: ... def nth_day_of_month(n: int, weekday: int, month: int, year: int) -> tuple[int, int, int]: ... From 27e0391b78d9e1192e1a4b2864dc5e44afba3a0c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 13 Nov 2026 17:53:12 +0100 Subject: [PATCH 10/11] Replace `FloatInt` in openpyxl --- stubs/openpyxl/openpyxl/cell/__init__.pyi | 4 +- stubs/openpyxl/openpyxl/cell/cell.pyi | 4 +- stubs/openpyxl/openpyxl/chart/_3d.pyi | 6 +-- stubs/openpyxl/openpyxl/chart/_chart.pyi | 6 +-- stubs/openpyxl/openpyxl/chart/axis.pyi | 4 +- .../openpyxl/openpyxl/chart/bubble_chart.pyi | 4 +- stubs/openpyxl/openpyxl/chart/chartspace.pyi | 4 +- stubs/openpyxl/openpyxl/chart/descriptors.pyi | 9 ++-- stubs/openpyxl/openpyxl/chart/layout.pyi | 10 ++--- stubs/openpyxl/openpyxl/chart/marker.pyi | 4 +- stubs/openpyxl/openpyxl/chart/pie_chart.pyi | 10 ++--- stubs/openpyxl/openpyxl/descriptors/base.pyi | 44 +++++++++---------- stubs/openpyxl/openpyxl/descriptors/excel.pyi | 10 ++--- .../openpyxl/openpyxl/descriptors/nested.pyi | 34 +++++++------- stubs/openpyxl/openpyxl/drawing/colors.pyi | 12 ++--- stubs/openpyxl/openpyxl/drawing/fill.pyi | 4 +- stubs/openpyxl/openpyxl/drawing/geometry.pyi | 4 +- stubs/openpyxl/openpyxl/drawing/line.pyi | 4 +- stubs/openpyxl/openpyxl/drawing/text.pyi | 6 +-- stubs/openpyxl/openpyxl/styles/alignment.pyi | 8 ++-- stubs/openpyxl/openpyxl/styles/colors.pyi | 4 +- stubs/openpyxl/openpyxl/styles/fills.pyi | 4 +- stubs/openpyxl/openpyxl/styles/fonts.pyi | 4 +- stubs/openpyxl/openpyxl/utils/units.pyi | 9 ++-- stubs/openpyxl/openpyxl/worksheet/filters.pyi | 10 ++--- 25 files changed, 110 insertions(+), 112 deletions(-) diff --git a/stubs/openpyxl/openpyxl/cell/__init__.pyi b/stubs/openpyxl/openpyxl/cell/__init__.pyi index 9b3e5386092a..d8bd0b360e37 100644 --- a/stubs/openpyxl/openpyxl/cell/__init__.pyi +++ b/stubs/openpyxl/openpyxl/cell/__init__.pyi @@ -1,4 +1,3 @@ -from _typeshed import FloatInt from datetime import date, datetime, time, timedelta from decimal import Decimal from typing import Any, TypeAlias @@ -13,7 +12,8 @@ _TimeTypes: TypeAlias = datetime | date | time | timedelta _CellGetValue: TypeAlias = ( # noqa: Y047 # Used in other modules # if numpy is installed also numpy bool and number types bool - | FloatInt + | float + | int | Decimal | str | CellRichText diff --git a/stubs/openpyxl/openpyxl/cell/cell.pyi b/stubs/openpyxl/openpyxl/cell/cell.pyi index 7cc1a885e1d0..78a47e8e4d40 100644 --- a/stubs/openpyxl/openpyxl/cell/cell.pyi +++ b/stubs/openpyxl/openpyxl/cell/cell.pyi @@ -1,4 +1,4 @@ -from _typeshed import FloatInt, ReadableBuffer +from _typeshed import ReadableBuffer from datetime import datetime from re import Pattern from typing import Final, Literal, overload @@ -106,4 +106,4 @@ class MergedCell(StyleableObject): # The value of a MergedCell is always None. value: None -def WriteOnlyCell(ws: _WorkbookChild | ReadOnlyWorksheet, value: str | FloatInt | datetime | None = None) -> Cell: ... +def WriteOnlyCell(ws: _WorkbookChild | ReadOnlyWorksheet, value: str | float | int | datetime | None = None) -> Cell: ... diff --git a/stubs/openpyxl/openpyxl/chart/_3d.pyi b/stubs/openpyxl/openpyxl/chart/_3d.pyi index 7ab86e8aa97f..6c12831498f8 100644 --- a/stubs/openpyxl/openpyxl/chart/_3d.pyi +++ b/stubs/openpyxl/openpyxl/chart/_3d.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused from typing import ClassVar, Literal from openpyxl.chart.picture import PictureOptions @@ -12,9 +12,9 @@ from ..xml._functions_overloads import _HasTagAndGet class View3D(Serialisable): tagname: ClassVar[str] - rotX: NestedMinMax[FloatInt, Literal[True]] + rotX: NestedMinMax[float, Literal[True]] x_rotation: Alias - hPercent: NestedMinMax[FloatInt, Literal[True]] + hPercent: NestedMinMax[float, Literal[True]] height_percent: Alias rotY: NestedInteger[Literal[True]] y_rotation: Alias diff --git a/stubs/openpyxl/openpyxl/chart/_chart.pyi b/stubs/openpyxl/openpyxl/chart/_chart.pyi index e4abbdce36fe..491d0977c8e7 100644 --- a/stubs/openpyxl/openpyxl/chart/_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/_chart.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToInt, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.chart.layout import Layout @@ -29,8 +29,8 @@ class ChartBase(Serialisable): title: TitleDescriptor anchor: str width: int - height: FloatInt - style: MinMax[FloatInt, Literal[True]] + height: float | int + style: MinMax[float, Literal[True]] mime_type: str graphical_properties: Typed[GraphicalProperties, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/stubs/openpyxl/openpyxl/chart/axis.pyi b/stubs/openpyxl/openpyxl/chart/axis.pyi index 53509b3b0ce6..b98f29d87c35 100644 --- a/stubs/openpyxl/openpyxl/chart/axis.pyi +++ b/stubs/openpyxl/openpyxl/chart/axis.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload from typing_extensions import Self @@ -221,7 +221,7 @@ class TextAxis(_BaseAxis): # crossesAt = _BaseAxis.crossesAt auto: NestedBool[Literal[True]] lblAlgn: NestedNoneSet[_TextAxisLblAlgn] - lblOffset: NestedMinMax[FloatInt, Literal[False]] + lblOffset: NestedMinMax[float, Literal[False]] tickLblSkip: NestedInteger[Literal[True]] tickMarkSkip: NestedInteger[Literal[True]] noMultiLvlLbl: NestedBool[Literal[True]] diff --git a/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi b/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi index 33bdcba91a23..d9e1cd4dc4f8 100644 --- a/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/bubble_chart.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.chart.axis import NumericAxis @@ -19,7 +19,7 @@ class BubbleChart(ChartBase): dLbls: Typed[DataLabelList, Literal[True]] dataLabels: Alias bubble3D: NestedBool[Literal[True]] - bubbleScale: NestedMinMax[FloatInt, Literal[True]] + bubbleScale: NestedMinMax[float, Literal[True]] showNegBubbles: NestedBool[Literal[True]] sizeRepresents: NestedNoneSet[_BubbleChartSizeRepresents] extLst: Typed[ExtensionList, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/chart/chartspace.pyi b/stubs/openpyxl/openpyxl/chart/chartspace.pyi index 4d3f78aac998..5e21bb8397a7 100644 --- a/stubs/openpyxl/openpyxl/chart/chartspace.pyi +++ b/stubs/openpyxl/openpyxl/chart/chartspace.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload from openpyxl.chart._3d import Surface, View3D @@ -91,7 +91,7 @@ class ChartSpace(Serialisable): date1904: NestedBool[Literal[True]] lang: NestedString[Literal[True]] roundedCorners: NestedBool[Literal[True]] - style: NestedMinMax[FloatInt, Literal[True]] + style: NestedMinMax[float, Literal[True]] clrMapOvr: Typed[ColorMapping, Literal[True]] pivotSource: Typed[PivotSource, Literal[True]] protection: Typed[Protection, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/chart/descriptors.pyi b/stubs/openpyxl/openpyxl/chart/descriptors.pyi index ec684e3f8335..29b6b9cd82e2 100644 --- a/stubs/openpyxl/openpyxl/chart/descriptors.pyi +++ b/stubs/openpyxl/openpyxl/chart/descriptors.pyi @@ -1,4 +1,3 @@ -from _typeshed import FloatInt from typing import Literal from openpyxl.chart.data_source import NumFmt @@ -8,13 +7,13 @@ from openpyxl.descriptors.serialisable import Serialisable class NestedGapAmount(NestedMinMax[float, bool]): allow_none: bool - min: FloatInt - max: FloatInt + min: float | int + max: float | int class NestedOverlap(NestedMinMax[float, bool]): allow_none: bool - min: FloatInt - max: FloatInt + min: float | int + max: float | int class NumberFormatDescriptor(Typed[NumFmt, Literal[True]]): expected_type: type[NumFmt] diff --git a/stubs/openpyxl/openpyxl/chart/layout.pyi b/stubs/openpyxl/openpyxl/chart/layout.pyi index 104df0760512..dde22b10a1d7 100644 --- a/stubs/openpyxl/openpyxl/chart/layout.pyi +++ b/stubs/openpyxl/openpyxl/chart/layout.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, FloatInt, Unused +from _typeshed import ConvertibleToFloat, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Typed @@ -18,11 +18,11 @@ class ManualLayout(Serialisable): yMode: NestedNoneSet[_ManualLayoutMode] wMode: NestedSet[_ManualLayoutMode] hMode: NestedSet[_ManualLayoutMode] - x: NestedMinMax[FloatInt, Literal[True]] - y: NestedMinMax[FloatInt, Literal[True]] - w: NestedMinMax[FloatInt, Literal[True]] + x: NestedMinMax[float, Literal[True]] + y: NestedMinMax[float, Literal[True]] + w: NestedMinMax[float, Literal[True]] width: Alias - h: NestedMinMax[FloatInt, Literal[True]] + h: NestedMinMax[float, Literal[True]] height: Alias extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] diff --git a/stubs/openpyxl/openpyxl/chart/marker.pyi b/stubs/openpyxl/openpyxl/chart/marker.pyi index cb3f9279d392..bd526ee90985 100644 --- a/stubs/openpyxl/openpyxl/chart/marker.pyi +++ b/stubs/openpyxl/openpyxl/chart/marker.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.chart.picture import PictureOptions @@ -17,7 +17,7 @@ _MarkerSymbol: TypeAlias = Literal[ class Marker(Serialisable): tagname: ClassVar[str] symbol: NestedNoneSet[_MarkerSymbol] - size: NestedMinMax[FloatInt, Literal[True]] + size: NestedMinMax[float, Literal[True]] spPr: Typed[GraphicalProperties, Literal[True]] graphicalProperties: Alias extLst: Typed[ExtensionList, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/chart/pie_chart.pyi b/stubs/openpyxl/openpyxl/chart/pie_chart.pyi index 8fcaea4774ce..c43e6f1dafe6 100644 --- a/stubs/openpyxl/openpyxl/chart/pie_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/pie_chart.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.chart.axis import ChartLines @@ -33,7 +33,7 @@ class PieChart(_PieChartBase): # varyColors = _PieChartBase.varyColors # ser = _PieChartBase.ser # dLbls = _PieChartBase.dLbls - firstSliceAng: NestedMinMax[FloatInt, Literal[False]] + firstSliceAng: NestedMinMax[float, Literal[False]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( @@ -55,8 +55,8 @@ class DoughnutChart(_PieChartBase): # varyColors = _PieChartBase.varyColors # ser = _PieChartBase.ser # dLbls = _PieChartBase.dLbls - firstSliceAng: NestedMinMax[FloatInt, Literal[False]] - holeSize: NestedMinMax[FloatInt, Literal[True]] + firstSliceAng: NestedMinMax[float, Literal[False]] + holeSize: NestedMinMax[float, Literal[True]] extLst: Typed[ExtensionList, Literal[True]] __elements__: ClassVar[tuple[str, ...]] def __init__( @@ -85,7 +85,7 @@ class ProjectedPieChart(_PieChartBase): splitType: NestedNoneSet[_ProjectedPieChartSplitType] splitPos: NestedFloat[Literal[True]] custSplit: Typed[CustomSplit, Literal[True]] - secondPieSize: NestedMinMax[FloatInt, Literal[True]] + secondPieSize: NestedMinMax[float, Literal[True]] serLines: Typed[ChartLines, Literal[True]] join_lines: Alias extLst: Typed[ExtensionList, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index 609501df4a1f..58e157a1070e 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, ReadableBuffer, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, ReadableBuffer, Unused from collections.abc import Iterable, Sized from datetime import datetime from re import Pattern @@ -13,7 +13,7 @@ _T = TypeVar("_T") _P = TypeVar("_P", str, ReadableBuffer) _N = TypeVar("_N", bound=bool, default=Literal[False]) _L = TypeVar("_L", bound=Sized) -_M = TypeVar("_M", int, float, FloatInt) # TODO: remove FloatInt, update users +_M = TypeVar("_M", int, float) _ExpectedTypeParam: TypeAlias = type[_T] | tuple[type[_T], ...] _ConvertibleToMultiCellRange: TypeAlias = MultiCellRange | str | Iterable[CellRange] @@ -128,7 +128,7 @@ class Max(Convertible[_M, _N]): @overload def __init__( - self: Max[int, Literal[True]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], max: FloatInt + self: Max[int, Literal[True]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], max: float | int ) -> None: ... @overload def __init__( @@ -136,7 +136,7 @@ class Max(Convertible[_M, _N]): *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, - max: FloatInt, + max: float | int, ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload @@ -145,7 +145,7 @@ class Max(Convertible[_M, _N]): *, expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], - max: FloatInt, + max: float | int, ) -> None: ... @overload def __init__( @@ -153,7 +153,7 @@ class Max(Convertible[_M, _N]): *, expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[False] = False, - max: FloatInt, + max: float | int, ) -> None: ... @overload # type: ignore[override] # Different restrictions @@ -162,10 +162,10 @@ class Max(Convertible[_M, _N]): def __set__(self: Max[int, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToInt) -> None: ... @overload def __set__( - self: Max[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None + self: Max[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None ) -> None: ... @overload - def __set__(self: Max[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... + def __set__(self: Max[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... class Min(Convertible[_M, _N]): expected_type: type[_M] @@ -174,7 +174,7 @@ class Min(Convertible[_M, _N]): @overload def __init__( - self: Min[int, Literal[True]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], min: FloatInt + self: Min[int, Literal[True]], *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], min: float | int ) -> None: ... @overload def __init__( @@ -182,7 +182,7 @@ class Min(Convertible[_M, _N]): *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, - min: FloatInt, + min: float | int, ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload @@ -191,7 +191,7 @@ class Min(Convertible[_M, _N]): *, expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], - min: FloatInt, + min: float | int, ) -> None: ... @overload def __init__( @@ -199,7 +199,7 @@ class Min(Convertible[_M, _N]): *, expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[False] = False, - min: FloatInt, + min: float | int, ) -> None: ... @overload # type: ignore[override] # Different restrictions @@ -208,10 +208,10 @@ class Min(Convertible[_M, _N]): def __set__(self: Min[int, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToInt) -> None: ... @overload def __set__( - self: Min[FloatInt, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None + self: Min[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None ) -> None: ... @overload - def __set__(self: Min[FloatInt, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... + def __set__(self: Min[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... class MinMax(Min[_M, _N], Max[_M, _N]): expected_type: type[_M] @@ -223,8 +223,8 @@ class MinMax(Min[_M, _N], Max[_M, _N]): *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], - min: FloatInt, - max: FloatInt, + min: float | int, + max: float | int, ) -> None: ... @overload def __init__( @@ -232,8 +232,8 @@ class MinMax(Min[_M, _N], Max[_M, _N]): *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, - min: FloatInt, - max: FloatInt, + min: float | int, + max: float | int, ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload @@ -242,8 +242,8 @@ class MinMax(Min[_M, _N], Max[_M, _N]): *, expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], - min: FloatInt, - max: FloatInt, + min: float | int, + max: float | int, ) -> None: ... @overload def __init__( @@ -251,8 +251,8 @@ class MinMax(Min[_M, _N], Max[_M, _N]): *, expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[False] = False, - min: FloatInt, - max: FloatInt, + min: float | int, + max: float | int, ) -> None: ... class Set(Descriptor[_T]): diff --git a/stubs/openpyxl/openpyxl/descriptors/excel.pyi b/stubs/openpyxl/openpyxl/descriptors/excel.pyi index 90c32e0867a1..a468f33a3fe1 100644 --- a/stubs/openpyxl/openpyxl/descriptors/excel.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/excel.pyi @@ -1,4 +1,4 @@ -from _typeshed import FloatInt, Incomplete +from _typeshed import Incomplete from typing import ClassVar, Literal from . import Integer, MatchPattern, MinMax, Strict, String @@ -13,15 +13,15 @@ class UniversalMeasure(MatchPattern[str, Incomplete]): class TextPoint(MinMax[_M, _N]): expected_type: type[_M] - min: FloatInt - max: FloatInt + min: float | int + max: float | int Coordinate = Integer class Percentage(MinMax[float, Incomplete]): pattern: str - min: FloatInt - max: FloatInt + min: float | int + max: float | int def __set__(self, instance: Serialisable | Strict, value) -> None: ... class Extension(Serialisable): diff --git a/stubs/openpyxl/openpyxl/descriptors/nested.pyi b/stubs/openpyxl/openpyxl/descriptors/nested.pyi index 1f48fd84192c..abadbbd0f5a2 100644 --- a/stubs/openpyxl/openpyxl/descriptors/nested.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/nested.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Unused from collections.abc import Iterable from typing import Any, ClassVar, Literal, TypeAlias, overload from typing_extensions import Never @@ -97,13 +97,13 @@ class NestedValue(Nested[_T], Convertible[_T, _N]): # type: ignore[misc] # float @overload def __set__( - self: NestedValue[FloatInt, Literal[True]], + self: NestedValue[float, Literal[True]], instance: Serialisable | Strict, value: _HasTagAndGet[ConvertibleToFloat | None] | ConvertibleToFloat | None, ) -> None: ... @overload def __set__( - self: NestedValue[FloatInt, Literal[False]], + self: NestedValue[float, Literal[False]], instance: Serialisable | Strict, value: _HasTagAndGet[ConvertibleToFloat] | ConvertibleToFloat, ) -> None: ... @@ -207,8 +207,8 @@ class NestedMinMax(Nested[_M], MinMax[_M, _N]): # type: ignore[misc] # pyrefly *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[True], - min: FloatInt, - max: FloatInt, + min: float | int, + max: float | int, ) -> None: ... @overload def __init__( @@ -216,27 +216,27 @@ class NestedMinMax(Nested[_M], MinMax[_M, _N]): # type: ignore[misc] # pyrefly *, expected_type: _ExpectedTypeParam[int], allow_none: Literal[False] = False, - min: FloatInt, - max: FloatInt, + min: float | int, + max: float | int, ) -> None: ... # mypy can't infer type from `expected_type = float` (pyright can), so we have to add extra overloads @overload def __init__( - self: NestedMinMax[FloatInt, Literal[True]], + self: NestedMinMax[float, Literal[True]], *, - expected_type: _ExpectedTypeParam[FloatInt] = ..., + expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[True], - min: FloatInt, - max: FloatInt, + min: float | int, + max: float | int, ) -> None: ... @overload def __init__( - self: NestedMinMax[FloatInt, Literal[False]], + self: NestedMinMax[float, Literal[False]], *, - expected_type: _ExpectedTypeParam[FloatInt] = ..., + expected_type: _ExpectedTypeParam[float] = ..., allow_none: Literal[False] = False, - min: FloatInt, - max: FloatInt, + min: float | int, + max: float | int, ) -> None: ... @overload @@ -258,13 +258,13 @@ class NestedMinMax(Nested[_M], MinMax[_M, _N]): # type: ignore[misc] # pyrefly ) -> None: ... @overload def __set__( - self: NestedMinMax[FloatInt, Literal[True]], + self: NestedMinMax[float, Literal[True]], instance: Serialisable | Strict, value: _HasTagAndGet[ConvertibleToFloat | None] | ConvertibleToFloat | None, ) -> None: ... @overload def __set__( - self: NestedMinMax[FloatInt, Literal[False]], + self: NestedMinMax[float, Literal[False]], instance: Serialisable | Strict, value: _HasTagAndGet[ConvertibleToFloat] | ConvertibleToFloat, ) -> None: ... diff --git a/stubs/openpyxl/openpyxl/drawing/colors.pyi b/stubs/openpyxl/openpyxl/drawing/colors.pyi index ddbd44045fe2..872589fbb8dc 100644 --- a/stubs/openpyxl/openpyxl/drawing/colors.pyi +++ b/stubs/openpyxl/openpyxl/drawing/colors.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete from typing import ClassVar, Final, Literal, TypeAlias, overload from openpyxl.descriptors import Strict, Typed @@ -332,15 +332,15 @@ class SystemColor(Serialisable): class HSLColor(Serialisable): tagname: ClassVar[str] hue: Integer[Literal[False]] - sat: MinMax[FloatInt, Literal[False]] - lum: MinMax[FloatInt, Literal[False]] + sat: MinMax[float, Literal[False]] + lum: MinMax[float, Literal[False]] def __init__(self, hue: ConvertibleToInt, sat: ConvertibleToFloat, lum: ConvertibleToFloat) -> None: ... class RGBPercent(Serialisable): tagname: ClassVar[str] - r: MinMax[FloatInt, Literal[False]] - g: MinMax[FloatInt, Literal[False]] - b: MinMax[FloatInt, Literal[False]] + r: MinMax[float, Literal[False]] + g: MinMax[float, Literal[False]] + b: MinMax[float, Literal[False]] def __init__(self, r: ConvertibleToFloat, g: ConvertibleToFloat, b: ConvertibleToFloat) -> None: ... _RGBPercent: TypeAlias = RGBPercent diff --git a/stubs/openpyxl/openpyxl/drawing/fill.pyi b/stubs/openpyxl/openpyxl/drawing/fill.pyi index a5e8b3315d70..6ee8f5964c6d 100644 --- a/stubs/openpyxl/openpyxl/drawing/fill.pyi +++ b/stubs/openpyxl/openpyxl/drawing/fill.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete from typing import ClassVar, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Bool, Integer, MinMax, NoneSet, Set, Typed, _ConvertibleToBool @@ -128,7 +128,7 @@ class StretchInfoProperties(Serialisable): class GradientStop(Serialisable): tagname: ClassVar[str] namespace: ClassVar[str] - pos: MinMax[FloatInt, Literal[True]] + pos: MinMax[float, Literal[True]] scrgbClr: Typed[_RGBPercent, Literal[True]] RGBPercent: Alias srgbClr: NestedValue[_RGBPercent, Literal[True]] diff --git a/stubs/openpyxl/openpyxl/drawing/geometry.pyi b/stubs/openpyxl/openpyxl/drawing/geometry.pyi index c05bb2e54a8c..a15293e0c663 100644 --- a/stubs/openpyxl/openpyxl/drawing/geometry.pyi +++ b/stubs/openpyxl/openpyxl/drawing/geometry.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias, overload from openpyxl.descriptors.base import Alias, Bool, Float, Integer, MinMax, NoneSet, Set, String, Typed, _ConvertibleToBool @@ -504,7 +504,7 @@ class AdjPoint2D(Serialisable): def __init__(self, x=None, y=None) -> None: ... class ConnectionSite(Serialisable): - ang: MinMax[FloatInt, Literal[False]] + ang: MinMax[float, Literal[False]] pos: Typed[AdjPoint2D, Literal[False]] def __init__(self, ang: ConvertibleToFloat, pos: AdjPoint2D) -> None: ... diff --git a/stubs/openpyxl/openpyxl/drawing/line.pyi b/stubs/openpyxl/openpyxl/drawing/line.pyi index 17ddab0dde60..209d8165ea15 100644 --- a/stubs/openpyxl/openpyxl/drawing/line.pyi +++ b/stubs/openpyxl/openpyxl/drawing/line.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Integer, MinMax, NoneSet, Typed, _ConvertibleToBool @@ -48,7 +48,7 @@ class DashStopList(Serialisable): class LineProperties(Serialisable): tagname: ClassVar[str] namespace: ClassVar[str] - w: MinMax[FloatInt, Literal[True]] + w: MinMax[float, Literal[True]] width: Alias cap: NoneSet[_LinePropertiesCap] cmpd: NoneSet[_LinePropertiesCmpd] diff --git a/stubs/openpyxl/openpyxl/drawing/text.pyi b/stubs/openpyxl/openpyxl/drawing/text.pyi index 24b64c6c9ab9..3ead43febde6 100644 --- a/stubs/openpyxl/openpyxl/drawing/text.pyi +++ b/stubs/openpyxl/openpyxl/drawing/text.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from typing import ClassVar, Literal, TypeAlias from openpyxl.descriptors.base import Alias, Bool, Integer, MinMax, NoneSet, Set, String, Typed, _ConvertibleToBool @@ -168,7 +168,7 @@ class Font(Serialisable): namespace: ClassVar[str] typeface: String[Literal[False]] panose: Incomplete - pitchFamily: MinMax[FloatInt, Literal[True]] + pitchFamily: MinMax[float, Literal[True]] charset: Integer[Literal[True]] def __init__( self, typeface: str, panose=None, pitchFamily: ConvertibleToFloat | None = None, charset: ConvertibleToInt | None = None @@ -180,7 +180,7 @@ class CharacterProperties(Serialisable): kumimoji: Bool[Literal[True]] lang: String[Literal[True]] altLang: String[Literal[True]] - sz: MinMax[FloatInt, Literal[True]] + sz: MinMax[float, Literal[True]] b: Bool[Literal[True]] i: Bool[Literal[True]] u: NoneSet[_CharacterPropertiesU] diff --git a/stubs/openpyxl/openpyxl/styles/alignment.pyi b/stubs/openpyxl/openpyxl/styles/alignment.pyi index e372ab523722..40f69c4e46cd 100644 --- a/stubs/openpyxl/openpyxl/styles/alignment.pyi +++ b/stubs/openpyxl/openpyxl/styles/alignment.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, FloatInt +from _typeshed import ConvertibleToFloat from collections.abc import Iterator from typing import ClassVar, Final, Literal, TypeAlias @@ -23,10 +23,10 @@ class Alignment(Serialisable): wrap_text: Alias shrinkToFit: Bool[Literal[True]] shrink_to_fit: Alias - indent: MinMax[FloatInt, Literal[False]] - relativeIndent: MinMax[FloatInt, Literal[False]] + indent: MinMax[float, Literal[False]] + relativeIndent: MinMax[float, Literal[False]] justifyLastLine: Bool[Literal[True]] - readingOrder: Min[FloatInt, Literal[False]] + readingOrder: Min[float, Literal[False]] def __init__( self, horizontal=None, diff --git a/stubs/openpyxl/openpyxl/styles/colors.pyi b/stubs/openpyxl/openpyxl/styles/colors.pyi index fcadccd51002..be92324686c0 100644 --- a/stubs/openpyxl/openpyxl/styles/colors.pyi +++ b/stubs/openpyxl/openpyxl/styles/colors.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from collections.abc import Iterator from re import Pattern from typing import ClassVar, Final, Literal, TypeVar, overload @@ -35,7 +35,7 @@ class Color(Serialisable): indexed: Integer[Literal[False]] auto: Bool[Literal[False]] theme: Integer[Literal[False]] - tint: MinMax[FloatInt, Literal[False]] + tint: MinMax[float, Literal[False]] type: String[Literal[False]] def __init__( self, diff --git a/stubs/openpyxl/openpyxl/styles/fills.pyi b/stubs/openpyxl/openpyxl/styles/fills.pyi index 05fb3843a895..498f9d1a7c15 100644 --- a/stubs/openpyxl/openpyxl/styles/fills.pyi +++ b/stubs/openpyxl/openpyxl/styles/fills.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, Incomplete, Unused from collections.abc import Iterable, Iterator, Sequence as ABCSequence from typing import ClassVar, Final, Literal, TypeAlias @@ -83,7 +83,7 @@ DEFAULT_GRAY_FILL: Final[PatternFill] class Stop(Serialisable): tagname: ClassVar[str] - position: MinMax[FloatInt, Literal[False]] + position: MinMax[float, Literal[False]] color: Incomplete def __init__(self, color, position: ConvertibleToFloat) -> None: ... diff --git a/stubs/openpyxl/openpyxl/styles/fonts.pyi b/stubs/openpyxl/openpyxl/styles/fonts.pyi index 22d09444666d..48aeeb27d9b3 100644 --- a/stubs/openpyxl/openpyxl/styles/fonts.pyi +++ b/stubs/openpyxl/openpyxl/styles/fonts.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt +from _typeshed import ConvertibleToFloat, ConvertibleToInt from typing import ClassVar, Final, Literal, TypeAlias from typing_extensions import Self @@ -28,7 +28,7 @@ class Font(Serialisable): UNDERLINE_SINGLE_ACCOUNTING: Final = "singleAccounting" name: NestedString[Literal[True]] charset: NestedInteger[Literal[True]] - family: NestedMinMax[FloatInt, Literal[True]] + family: NestedMinMax[float, Literal[True]] sz: NestedFloat[Literal[True]] size: Alias b: NestedBool[Literal[False]] diff --git a/stubs/openpyxl/openpyxl/utils/units.pyi b/stubs/openpyxl/openpyxl/utils/units.pyi index 371ee672dbec..6a799ed06424 100644 --- a/stubs/openpyxl/openpyxl/utils/units.pyi +++ b/stubs/openpyxl/openpyxl/utils/units.pyi @@ -1,12 +1,11 @@ -from _typeshed import FloatInt from typing import Final -DEFAULT_ROW_HEIGHT: Final[FloatInt] +DEFAULT_ROW_HEIGHT: Final[float] BASE_COL_WIDTH: Final = 8 DEFAULT_COLUMN_WIDTH: Final = 13 -DEFAULT_LEFT_MARGIN: Final[FloatInt] -DEFAULT_TOP_MARGIN: Final[FloatInt] -DEFAULT_HEADER: Final[FloatInt] +DEFAULT_LEFT_MARGIN: Final[float] +DEFAULT_TOP_MARGIN: Final[float] +DEFAULT_HEADER: Final[float] def inch_to_dxa(value): ... def dxa_to_inch(value): ... diff --git a/stubs/openpyxl/openpyxl/worksheet/filters.pyi b/stubs/openpyxl/openpyxl/worksheet/filters.pyi index cb848107b6a9..932b53b604d7 100644 --- a/stubs/openpyxl/openpyxl/worksheet/filters.pyi +++ b/stubs/openpyxl/openpyxl/worksheet/filters.pyi @@ -1,4 +1,4 @@ -from _typeshed import ConvertibleToFloat, ConvertibleToInt, FloatInt, Incomplete, Unused +from _typeshed import ConvertibleToFloat, ConvertibleToInt, Incomplete, Unused from datetime import datetime from typing import ClassVar, Final, Literal, TypeAlias, overload @@ -228,10 +228,10 @@ class Top10(Serialisable): class DateGroupItem(Serialisable): tagname: ClassVar[str] year: Integer[Literal[False]] - month: MinMax[FloatInt, Literal[True]] - day: MinMax[FloatInt, Literal[True]] - hour: MinMax[FloatInt, Literal[True]] - minute: MinMax[FloatInt, Literal[True]] + month: MinMax[float, Literal[True]] + day: MinMax[float, Literal[True]] + hour: MinMax[float, Literal[True]] + minute: MinMax[float, Literal[True]] second: Integer[Literal[True]] dateTimeGrouping: Set[_DateGroupItemDateTimeGrouping] From 80b08371b628a08fd0ae12b5e48eefd962dc085c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Nov 2026 16:55:30 +0000 Subject: [PATCH 11/11] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/openpyxl/openpyxl/descriptors/base.pyi | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index 58e157a1070e..b27c27f4ea73 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -161,9 +161,7 @@ class Max(Convertible[_M, _N]): @overload def __set__(self: Max[int, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToInt) -> None: ... @overload - def __set__( - self: Max[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None - ) -> None: ... + def __set__(self: Max[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None) -> None: ... @overload def __set__(self: Max[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ... @@ -207,9 +205,7 @@ class Min(Convertible[_M, _N]): @overload def __set__(self: Min[int, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToInt) -> None: ... @overload - def __set__( - self: Min[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None - ) -> None: ... + def __set__(self: Min[float, Literal[True]], instance: Serialisable | Strict, value: ConvertibleToFloat | None) -> None: ... @overload def __set__(self: Min[float, Literal[False]], instance: Serialisable | Strict, value: ConvertibleToFloat) -> None: ...