basedpyright 1.28.3 → 1.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pyright-langserver.js +1 -1
- package/dist/pyright-langserver.js.map +1 -1
- package/dist/pyright.js +1 -1
- package/dist/pyright.js.map +1 -1
- package/dist/typeshed-fallback/commit.txt +1 -1
- package/dist/typeshed-fallback/stdlib/_hashlib.pyi +15 -2
- package/dist/typeshed-fallback/stdlib/_socket.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi +7 -4
- package/dist/typeshed-fallback/stdlib/asyncio/__init__.pyi +2 -178
- package/dist/typeshed-fallback/stdlib/asyncio/base_events.pyi +3 -2
- package/dist/typeshed-fallback/stdlib/asyncio/events.pyi +3 -2
- package/dist/typeshed-fallback/stdlib/builtins.pyi +51 -33
- package/dist/typeshed-fallback/stdlib/configparser.pyi +61 -42
- package/dist/typeshed-fallback/stdlib/contextlib.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/distutils/cmd.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/distutils/dist.pyi +3 -3
- package/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi +15 -5
- package/dist/typeshed-fallback/stdlib/functools.pyi +18 -13
- package/dist/typeshed-fallback/stdlib/getopt.pyi +15 -3
- package/dist/typeshed-fallback/stdlib/hashlib.pyi +2 -1
- package/dist/typeshed-fallback/stdlib/heapq.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/hmac.pyi +2 -2
- package/dist/typeshed-fallback/stdlib/http/server.pyi +2 -1
- package/dist/typeshed-fallback/stdlib/importlib/metadata/__init__.pyi +1 -1
- package/dist/typeshed-fallback/stdlib/importlib/readers.pyi +11 -7
- package/dist/typeshed-fallback/stdlib/inspect.pyi +10 -10
- package/dist/typeshed-fallback/stdlib/logging/config.pyi +6 -1
- package/dist/typeshed-fallback/stdlib/math.pyi +33 -3
- package/dist/typeshed-fallback/stdlib/multiprocessing/connection.pyi +9 -9
- package/dist/typeshed-fallback/stdlib/pathlib.pyi +13 -9
- package/dist/typeshed-fallback/stdlib/pkgutil.pyi +6 -6
- package/dist/typeshed-fallback/stdlib/shutil.pyi +9 -5
- package/dist/typeshed-fallback/stdlib/socketserver.pyi +8 -8
- package/dist/typeshed-fallback/stdlib/statistics.pyi +14 -15
- package/dist/typeshed-fallback/stdlib/tarfile.pyi +181 -162
- package/dist/typeshed-fallback/stdlib/types.pyi +27 -4
- package/dist/typeshed-fallback/stdlib/typing.pyi +10 -7
- package/dist/typeshed-fallback/stdlib/typing_extensions.pyi +95 -48
- package/dist/typeshed-fallback/stdlib/unittest/case.pyi +5 -1
- package/dist/typeshed-fallback/stdlib/xml/dom/NodeFilter.pyi +7 -4
- package/dist/typeshed-fallback/stdlib/xml/dom/__init__.pyi +84 -53
- package/dist/typeshed-fallback/stdlib/xml/dom/expatbuilder.pyi +66 -45
- package/dist/typeshed-fallback/stdlib/xml/dom/minidom.pyi +524 -193
- package/dist/typeshed-fallback/stdlib/xml/dom/pulldom.pyi +70 -55
- package/dist/typeshed-fallback/stdlib/xml/dom/xmlbuilder.pyi +20 -49
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementInclude.pyi +13 -10
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementPath.pyi +19 -12
- package/dist/typeshed-fallback/stdlib/xml/etree/ElementTree.pyi +83 -41
- package/dist/typeshed-fallback/stdlib/xml/sax/_exceptions.pyi +5 -5
- package/dist/typeshed-fallback/stdlib/xml/sax/expatreader.pyi +53 -24
- package/dist/typeshed-fallback/stdlib/xml/sax/handler.pyi +48 -17
- package/dist/typeshed-fallback/stdlib/xml/sax/saxutils.pyi +24 -16
- package/dist/typeshed-fallback/stdlib/xml/sax/xmlreader.pyi +59 -56
- package/dist/typeshed-fallback/stdlib/zipfile/__init__.pyi +0 -8
- package/dist/typeshed-fallback/stdlib/zipfile/_path/__init__.pyi +32 -52
- package/dist/typeshed-fallback/stubs/Deprecated/deprecated/classic.pyi +6 -1
- package/dist/typeshed-fallback/stubs/Deprecated/deprecated/sphinx.pyi +1 -0
- package/dist/typeshed-fallback/stubs/Pygments/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/Pygments/pygments/plugin.pyi +11 -3
- package/dist/typeshed-fallback/stubs/RPi.GPIO/RPi/GPIO/__init__.pyi +1 -1
- package/dist/typeshed-fallback/stubs/WTForms/wtforms/validators.pyi +13 -5
- package/dist/typeshed-fallback/stubs/WebOb/webob/__init__.pyi +15 -0
- package/dist/typeshed-fallback/stubs/WebOb/webob/_types.pyi +21 -0
- package/dist/typeshed-fallback/stubs/WebOb/webob/acceptparse.pyi +496 -285
- package/dist/typeshed-fallback/stubs/WebOb/webob/byterange.pyi +2 -0
- package/dist/typeshed-fallback/stubs/WebOb/webob/cachecontrol.pyi +75 -75
- package/dist/typeshed-fallback/stubs/WebOb/webob/client.pyi +2 -0
- package/dist/typeshed-fallback/stubs/WebOb/webob/compat.pyi +24 -0
- package/dist/typeshed-fallback/stubs/WebOb/webob/cookies.pyi +39 -34
- package/dist/typeshed-fallback/stubs/WebOb/webob/datetime_utils.pyi +16 -0
- package/dist/typeshed-fallback/stubs/WebOb/webob/dec.pyi +40 -40
- package/dist/typeshed-fallback/stubs/WebOb/webob/descriptors.pyi +23 -34
- package/dist/typeshed-fallback/stubs/WebOb/webob/etag.pyi +11 -18
- package/dist/typeshed-fallback/stubs/WebOb/webob/exc.pyi +70 -7
- package/dist/typeshed-fallback/stubs/WebOb/webob/headers.pyi +20 -2
- package/dist/typeshed-fallback/stubs/WebOb/webob/multidict.pyi +97 -31
- package/dist/typeshed-fallback/stubs/WebOb/webob/request.pyi +70 -79
- package/dist/typeshed-fallback/stubs/WebOb/webob/response.pyi +62 -62
- package/dist/typeshed-fallback/stubs/WebOb/webob/static.pyi +12 -9
- package/dist/typeshed-fallback/stubs/WebOb/webob/util.pyi +2 -5
- package/dist/typeshed-fallback/stubs/atheris/METADATA.toml +4 -0
- package/dist/typeshed-fallback/stubs/boltons/boltons/dictutils.pyi +1 -3
- package/dist/typeshed-fallback/stubs/boltons/boltons/tbutils.pyi +13 -13
- package/dist/typeshed-fallback/stubs/braintree/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/braintree/braintree/__init__.pyi +1 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/braintree_gateway.pyi +2 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/credit_card.pyi +1 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/error_codes.pyi +40 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/paypal_payment_resource.pyi +10 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/paypal_payment_resource_gateway.pyi +10 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/test/credit_card_numbers.pyi +1 -0
- package/dist/typeshed-fallback/stubs/braintree/braintree/test/nonces.pyi +1 -0
- package/dist/typeshed-fallback/stubs/cffi/METADATA.toml +2 -2
- package/dist/typeshed-fallback/stubs/cffi/_cffi_backend.pyi +8 -8
- package/dist/typeshed-fallback/stubs/cffi/cffi/recompiler.pyi +1 -0
- package/dist/typeshed-fallback/stubs/corus/METADATA.toml +4 -0
- package/dist/typeshed-fallback/stubs/dirhash/METADATA.toml +2 -0
- package/dist/typeshed-fallback/stubs/dirhash/dirhash/__init__.pyi +93 -0
- package/dist/typeshed-fallback/stubs/dirhash/dirhash/cli.pyi +5 -0
- package/dist/typeshed-fallback/stubs/fanstatic/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/fanstatic/fanstatic/registry.pyi +8 -3
- package/dist/typeshed-fallback/stubs/fpdf2/fpdf/fonts.pyi +2 -8
- package/dist/typeshed-fallback/stubs/geopandas/geopandas/geodataframe.pyi +1 -1
- package/dist/typeshed-fallback/stubs/geopandas/geopandas/io/sql.pyi +0 -3
- package/dist/typeshed-fallback/stubs/gevent/gevent/hub.pyi +1 -1
- package/dist/typeshed-fallback/stubs/gevent/gevent/libev/corecext.pyi +1 -1
- package/dist/typeshed-fallback/stubs/gevent/gevent/libev/corecffi.pyi +1 -1
- package/dist/typeshed-fallback/stubs/gevent/gevent/libuv/loop.pyi +1 -1
- package/dist/typeshed-fallback/stubs/google-cloud-ndb/METADATA.toml +0 -1
- package/dist/typeshed-fallback/stubs/greenlet/greenlet/_greenlet.pyi +5 -1
- package/dist/typeshed-fallback/stubs/hdbcli/hdbcli/dbapi.pyi +1 -1
- package/dist/typeshed-fallback/stubs/hnswlib/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/hnswlib/hnswlib.pyi +8 -6
- package/dist/typeshed-fallback/stubs/humanfriendly/METADATA.toml +3 -0
- package/dist/typeshed-fallback/stubs/ibm-db/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/icalendar/icalendar/__init__.pyi +6 -6
- package/dist/typeshed-fallback/stubs/mock/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/mock/mock/backports.pyi +6 -1
- package/dist/typeshed-fallback/stubs/mock/mock/mock.pyi +1 -1
- package/dist/typeshed-fallback/stubs/mysqlclient/MySQLdb/_mysql.pyi +32 -32
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/__init__.pyi +3 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/clique.pyi +5 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/clustering_coefficient.pyi +3 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/connectivity.pyi +5 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/distance_measures.pyi +3 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/dominating_set.pyi +3 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/kcomponents.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/matching.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/maxcut.pyi +8 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/ramsey.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/steinertree.pyi +4 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/traveling_salesman.pyi +33 -23
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/treewidth.pyi +4 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/approximation/vertex_cover.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/connectivity.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/correlation.pyi +6 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/mixing.pyi +16 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/neighbor_degree.pyi +7 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/assortativity/pairs.pyi +6 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/asteroidal.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/__init__.pyi +1 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/basic.pyi +8 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/centrality.pyi +4 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/cluster.pyi +5 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/covering.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/edgelist.pyi +13 -12
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/extendability.pyi +5 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/generators.pyi +22 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/matching.pyi +11 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/matrix.pyi +9 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/projection.pyi +9 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/redundancy.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bipartite/spectral.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/boundary.pyi +53 -58
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/bridges.pyi +5 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/betweenness.pyi +7 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/betweenness_subset.pyi +10 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/closeness.pyi +7 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness.pyi +9 -9
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/current_flow_betweenness_subset.pyi +16 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/current_flow_closeness.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/eigenvector.pyi +10 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/flow_matrix.pyi +4 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/group.pyi +16 -12
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/harmonic.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/katz.pyi +15 -10
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/laplacian.pyi +6 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/load.pyi +3 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/percolation.pyi +6 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/reaching.pyi +9 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/second_order.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/subgraph_alg.pyi +5 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/trophic.pyi +5 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/centrality/voterank_alg.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/chordal.pyi +3 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/clique.pyi +9 -14
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/cluster.pyi +10 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/coloring/equitable_coloring.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/coloring/greedy_coloring.pyi +2 -20
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/communicability_alg.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/asyn_fluid.pyi +3 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/centrality.pyi +5 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/community_utils.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/divisive.pyi +5 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/kclique.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/kernighan_lin.pyi +7 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/label_propagation.pyi +4 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/louvain.pyi +13 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/lukes.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/modularity_max.pyi +3 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/community/quality.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/components/biconnected.pyi +5 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/components/connected.pyi +5 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/components/semiconnected.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/components/strongly_connected.pyi +5 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/components/weakly_connected.pyi +3 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/connectivity.pyi +29 -23
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/cuts.pyi +21 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/disjoint_paths.pyi +17 -16
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_augmentation.pyi +5 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/edge_kcomponents.pyi +7 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/kcomponents.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/kcutsets.pyi +5 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/connectivity/stoerwagner.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/core.pyi +9 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/covering.pyi +4 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/cuts.pyi +10 -9
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/cycles.pyi +9 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/d_separation.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/dag.pyi +13 -10
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/distance_measures.pyi +8 -9
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/distance_regular.pyi +4 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/dominance.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/dominating.pyi +4 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/efficiency_measures.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/euler.pyi +8 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/boykovkolmogorov.pyi +6 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/capacityscaling.pyi +4 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/dinitz_alg.pyi +6 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/edmondskarp.pyi +6 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/gomory_hu.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/maxflow.pyi +34 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/mincost.pyi +7 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/networksimplex.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/preflowpush.pyi +5 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/shortestaugmentingpath.pyi +6 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/flow/utils.pyi +1 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/graph_hashing.pyi +12 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/graphical.pyi +9 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/hierarchy.pyi +1 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/hybrid.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/isolate.pyi +4 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/ismags.pyi +1 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/isomorph.pyi +11 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/isomorphvf2.pyi +5 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/temporalisomorphvf2.pyi +2 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/tree_isomorphism.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/vf2pp.pyi +6 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/isomorphism/vf2userfunc.pyi +2 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/link_analysis/hits_alg.pyi +9 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/link_analysis/pagerank_alg.pyi +16 -14
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/link_prediction.pyi +9 -10
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/lowest_common_ancestors.pyi +5 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/matching.pyi +7 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/minors/contraction.pyi +10 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/mis.pyi +6 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/moral.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/node_classification.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/non_randomness.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/operators/all.pyi +7 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/operators/binary.pyi +11 -11
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/operators/product.pyi +14 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/operators/unary.pyi +2 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/planarity.pyi +6 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/polynomials.pyi +3 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/reciprocity.pyi +4 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/regular.pyi +4 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/richclub.pyi +3 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/astar.pyi +22 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/dense.pyi +7 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/generic.pyi +33 -11
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/unweighted.pyi +9 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/shortest_paths/weighted.pyi +116 -30
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/similarity.pyi +69 -55
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/simple_paths.pyi +11 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/smallworld.pyi +6 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/smetric.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/sparsifiers.pyi +3 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/structuralholes.pyi +5 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/summarization.pyi +5 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/swap.pyi +8 -5
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/threshold.pyi +3 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/time_dependent.pyi +5 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tournament.pyi +8 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/traversal/beamsearch.pyi +5 -2
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/traversal/breadth_first_search.pyi +16 -7
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/traversal/depth_first_search.pyi +20 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/traversal/edgebfs.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/traversal/edgedfs.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/branchings.pyi +13 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/coding.pyi +8 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/mst.pyi +22 -6
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/operations.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/tree/recognition.pyi +6 -4
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/triads.pyi +11 -8
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/vitality.pyi +2 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/voronoi.pyi +10 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/walks.pyi +5 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/algorithms/wiener.pyi +2 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/classes/coreviews.pyi +3 -1
- package/dist/typeshed-fallback/stubs/networkx/networkx/classes/graph.pyi +4 -3
- package/dist/typeshed-fallback/stubs/networkx/networkx/classes/multidigraph.pyi +2 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/classes/multigraph.pyi +3 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/classes/reportviews.pyi +39 -9
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/__init__.pyi +2 -0
- package/dist/typeshed-fallback/stubs/networkx/networkx/generators/time_series.pyi +4 -0
- package/dist/typeshed-fallback/stubs/passlib/passlib/hosts.pyi +3 -1
- package/dist/typeshed-fallback/stubs/peewee/peewee.pyi +19 -19
- package/dist/typeshed-fallback/stubs/protobuf/google/protobuf/descriptor.pyi +6 -0
- package/dist/typeshed-fallback/stubs/psycopg2/psycopg2/_psycopg.pyi +1 -1
- package/dist/typeshed-fallback/stubs/pycurl/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/pycurl/pycurl.pyi +18 -0
- package/dist/typeshed-fallback/stubs/pygit2/METADATA.toml +2 -0
- package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/build_main.pyi +19 -7
- package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/building/splash.pyi +18 -16
- package/dist/typeshed-fallback/stubs/pyinstaller/PyInstaller/utils/hooks/__init__.pyi +1 -1
- package/dist/typeshed-fallback/stubs/pynput/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/pynput/pynput/_util.pyi +4 -4
- package/dist/typeshed-fallback/stubs/pynput/pynput/keyboard/__init__.pyi +4 -2
- package/dist/typeshed-fallback/stubs/pynput/pynput/keyboard/_base.pyi +3 -0
- package/dist/typeshed-fallback/stubs/pynput/pynput/mouse/__init__.pyi +6 -3
- package/dist/typeshed-fallback/stubs/pyserial/serial/tools/miniterm.pyi +2 -2
- package/dist/typeshed-fallback/stubs/pytz/pytz/tzinfo.pyi +3 -3
- package/dist/typeshed-fallback/stubs/pywin32/METADATA.toml +1 -1
- package/dist/typeshed-fallback/stubs/pywin32/pythoncom.pyi +19 -2
- package/dist/typeshed-fallback/stubs/pywin32/win32/lib/win32con.pyi +4895 -4764
- package/dist/typeshed-fallback/stubs/pywin32/win32/lib/win32timezone.pyi +81 -42
- package/dist/typeshed-fallback/stubs/pywin32/win32/lib/winerror.pyi +7258 -2574
- package/dist/typeshed-fallback/stubs/pywin32/win32/servicemanager.pyi +1 -1
- package/dist/typeshed-fallback/stubs/pywin32/win32/win32trace.pyi +1 -1
- package/dist/typeshed-fallback/stubs/pywin32/win32/win32ts.pyi +1 -0
- package/dist/typeshed-fallback/stubs/pywin32/win32com/client/__init__.pyi +3 -1
- package/dist/typeshed-fallback/stubs/regex/regex/regex.pyi +5 -5
- package/dist/typeshed-fallback/stubs/requests/requests/__init__.pyi +12 -13
- package/dist/typeshed-fallback/stubs/requests-oauthlib/requests_oauthlib/oauth1_auth.pyi +3 -0
- package/dist/typeshed-fallback/stubs/setuptools/METADATA.toml +4 -3
- package/dist/typeshed-fallback/stubs/setuptools/distutils/ccompiler.pyi +11 -0
- package/dist/typeshed-fallback/stubs/setuptools/distutils/compilers/C/base.pyi +1 -0
- package/dist/typeshed-fallback/stubs/setuptools/distutils/compilers/C/errors.pyi +1 -0
- package/dist/typeshed-fallback/stubs/setuptools/distutils/compilers/C/msvc.pyi +1 -0
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/_msvccompiler.pyi +2 -21
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/archive_util.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/ccompiler.pyi +13 -178
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/bdist_rpm.pyi +6 -6
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build.pyi +2 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_clib.pyi +2 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_ext.pyi +2 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/build_py.pyi +3 -3
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install.pyi +5 -5
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_data.pyi +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_lib.pyi +4 -4
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/install_scripts.pyi +2 -2
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/command/sdist.pyi +6 -6
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/compat/__init__.pyi +6 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/compilers/C/base.pyi +196 -0
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/compilers/C/errors.pyi +6 -0
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/compilers/C/msvc.pyi +24 -0
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/dist.pyi +23 -20
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/errors.pyi +12 -6
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/filelist.pyi +12 -11
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/spawn.pyi +6 -1
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/_distutils/util.pyi +6 -6
- package/dist/typeshed-fallback/stubs/setuptools/setuptools/command/bdist_wheel.pyi +0 -2
- package/dist/typeshed-fallback/stubs/simplejson/simplejson/encoder.pyi +1 -1
- package/dist/typeshed-fallback/stubs/six/six/moves/builtins.pyi +0 -1
- package/dist/typeshed-fallback/stubs/tqdm/METADATA.toml +4 -1
- package/dist/typeshed-fallback/stubs/tqdm/tqdm/asyncio.pyi +4 -3
- package/dist/typeshed-fallback/stubs/tqdm/tqdm/std.pyi +10 -3
- package/dist/typeshed-fallback/stubs/tree-sitter-languages/METADATA.toml +6 -0
- package/dist/typeshed-fallback/stubs/vobject/vobject/vcard.pyi +15 -8
- package/dist/typeshed-fallback/stubs/watchpoints/METADATA.toml +2 -0
- package/dist/typeshed-fallback/stubs/watchpoints/watchpoints/__init__.pyi +10 -0
- package/dist/typeshed-fallback/stubs/watchpoints/watchpoints/ast_monkey.pyi +3 -0
- package/dist/typeshed-fallback/stubs/watchpoints/watchpoints/util.pyi +6 -0
- package/dist/typeshed-fallback/stubs/watchpoints/watchpoints/watch.pyi +68 -0
- package/dist/typeshed-fallback/stubs/watchpoints/watchpoints/watch_element.pyi +56 -0
- package/dist/typeshed-fallback/stubs/watchpoints/watchpoints/watch_print.pyi +24 -0
- package/dist/typeshed-fallback/stubs/zstd/METADATA.toml +1 -1
- package/package.json +1 -1
- package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/__init__.pyi +0 -543
- package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/_vendored_packaging/__init__.pyi +0 -8
- package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/_vendored_packaging/markers.pyi +0 -13
- package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/_vendored_packaging/requirements.pyi +0 -14
- package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/_vendored_packaging/specifiers.pyi +0 -66
- package/dist/typeshed-fallback/stubs/setuptools/pkg_resources/_vendored_packaging/version.pyi +0 -49
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
from _typeshed import Incomplete,
|
|
3
|
-
from collections.abc import Sequence
|
|
4
|
-
from typing import Final, Literal
|
|
5
|
-
from typing_extensions import TypeAlias
|
|
6
|
-
from xml.dom.minidom import Document, DOMImplementation, Element, Text
|
|
2
|
+
from _typeshed import Incomplete, Unused
|
|
3
|
+
from collections.abc import MutableSequence, Sequence
|
|
4
|
+
from typing import Final, Literal, NoReturn
|
|
5
|
+
from typing_extensions import Self, TypeAlias
|
|
6
|
+
from xml.dom.minidom import Comment, Document, DOMImplementation, Element, ProcessingInstruction, Text
|
|
7
|
+
from xml.sax import _SupportsReadClose
|
|
7
8
|
from xml.sax.handler import ContentHandler
|
|
8
|
-
from xml.sax.xmlreader import XMLReader
|
|
9
|
+
from xml.sax.xmlreader import AttributesImpl, AttributesNSImpl, Locator, XMLReader
|
|
9
10
|
|
|
10
11
|
START_ELEMENT: Final = "START_ELEMENT"
|
|
11
12
|
END_ELEMENT: Final = "END_ELEMENT"
|
|
@@ -16,79 +17,93 @@ PROCESSING_INSTRUCTION: Final = "PROCESSING_INSTRUCTION"
|
|
|
16
17
|
IGNORABLE_WHITESPACE: Final = "IGNORABLE_WHITESPACE"
|
|
17
18
|
CHARACTERS: Final = "CHARACTERS"
|
|
18
19
|
|
|
20
|
+
_NSName: TypeAlias = tuple[str | None, str]
|
|
19
21
|
_DocumentFactory: TypeAlias = DOMImplementation | None
|
|
20
|
-
_Node: TypeAlias = Document | Element | Text
|
|
21
22
|
|
|
22
|
-
_Event: TypeAlias =
|
|
23
|
-
Literal[
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
33
|
-
_Node,
|
|
34
|
-
]
|
|
23
|
+
_Event: TypeAlias = (
|
|
24
|
+
tuple[Literal["START_ELEMENT"], Element]
|
|
25
|
+
| tuple[Literal["END_ELEMENT"], Element]
|
|
26
|
+
| tuple[Literal["COMMENT"], Comment]
|
|
27
|
+
| tuple[Literal["START_DOCUMENT"], Document]
|
|
28
|
+
| tuple[Literal["END_DOCUMENT"], Document]
|
|
29
|
+
| tuple[Literal["PROCESSING_INSTRUCTION"], ProcessingInstruction]
|
|
30
|
+
| tuple[Literal["IGNORABLE_WHITESPACE"], Text]
|
|
31
|
+
| tuple[Literal["CHARACTERS"], Text]
|
|
32
|
+
)
|
|
35
33
|
|
|
36
34
|
class PullDOM(ContentHandler):
|
|
37
35
|
document: Document | None
|
|
38
36
|
documentFactory: _DocumentFactory
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
|
|
38
|
+
# firstEvent is a list of length 2
|
|
39
|
+
# firstEvent[0] is always None
|
|
40
|
+
# firstEvent[1] is None prior to any events, after which it's a
|
|
41
|
+
# list of length 2, where the first item is of type _Event
|
|
42
|
+
# and the second item is None.
|
|
43
|
+
firstEvent: list[Incomplete]
|
|
44
|
+
|
|
45
|
+
# lastEvent is also a list of length 2. The second item is always None,
|
|
46
|
+
# and the first item is of type _Event
|
|
47
|
+
# This is a slight lie: The second item is sometimes temporarily what was just
|
|
48
|
+
# described for the type of lastEvent, after which lastEvent is always updated
|
|
49
|
+
# with `self.lastEvent = self.lastEvent[1]`.
|
|
50
|
+
lastEvent: list[Incomplete]
|
|
51
|
+
|
|
52
|
+
elementStack: MutableSequence[Element | Document]
|
|
53
|
+
pending_events: (
|
|
54
|
+
list[Sequence[tuple[Literal["COMMENT"], str] | tuple[Literal["PROCESSING_INSTRUCTION"], str, str] | None]] | None
|
|
55
|
+
)
|
|
43
56
|
def __init__(self, documentFactory: _DocumentFactory = None) -> None: ...
|
|
44
|
-
def pop(self) -> Element: ...
|
|
45
|
-
def setDocumentLocator(self, locator) -> None: ...
|
|
46
|
-
def startPrefixMapping(self, prefix, uri) -> None: ...
|
|
47
|
-
def endPrefixMapping(self, prefix) -> None: ...
|
|
48
|
-
def startElementNS(self, name, tagName, attrs) -> None: ...
|
|
49
|
-
def endElementNS(self, name, tagName) -> None: ...
|
|
50
|
-
def startElement(self, name, attrs) -> None: ...
|
|
51
|
-
def endElement(self, name) -> None: ...
|
|
52
|
-
def comment(self, s) -> None: ...
|
|
53
|
-
def processingInstruction(self, target, data) -> None: ...
|
|
54
|
-
def ignorableWhitespace(self, chars) -> None: ...
|
|
55
|
-
def characters(self, chars) -> None: ...
|
|
57
|
+
def pop(self) -> Element | Document: ...
|
|
58
|
+
def setDocumentLocator(self, locator: Locator) -> None: ...
|
|
59
|
+
def startPrefixMapping(self, prefix: str | None, uri: str) -> None: ...
|
|
60
|
+
def endPrefixMapping(self, prefix: str | None) -> None: ...
|
|
61
|
+
def startElementNS(self, name: _NSName, tagName: str | None, attrs: AttributesNSImpl) -> None: ...
|
|
62
|
+
def endElementNS(self, name: _NSName, tagName: str | None) -> None: ...
|
|
63
|
+
def startElement(self, name: str, attrs: AttributesImpl) -> None: ...
|
|
64
|
+
def endElement(self, name: str) -> None: ...
|
|
65
|
+
def comment(self, s: str) -> None: ...
|
|
66
|
+
def processingInstruction(self, target: str, data: str) -> None: ...
|
|
67
|
+
def ignorableWhitespace(self, chars: str) -> None: ...
|
|
68
|
+
def characters(self, chars: str) -> None: ...
|
|
56
69
|
def startDocument(self) -> None: ...
|
|
57
|
-
def buildDocument(self, uri, tagname): ...
|
|
70
|
+
def buildDocument(self, uri: str | None, tagname: str | None) -> Element: ...
|
|
58
71
|
def endDocument(self) -> None: ...
|
|
59
72
|
def clear(self) -> None: ...
|
|
60
73
|
|
|
61
74
|
class ErrorHandler:
|
|
62
|
-
def warning(self, exception) -> None: ...
|
|
63
|
-
def error(self, exception) ->
|
|
64
|
-
def fatalError(self, exception) ->
|
|
75
|
+
def warning(self, exception: BaseException) -> None: ...
|
|
76
|
+
def error(self, exception: BaseException) -> NoReturn: ...
|
|
77
|
+
def fatalError(self, exception: BaseException) -> NoReturn: ...
|
|
65
78
|
|
|
66
79
|
class DOMEventStream:
|
|
67
|
-
stream:
|
|
68
|
-
parser: XMLReader
|
|
80
|
+
stream: _SupportsReadClose[bytes] | _SupportsReadClose[str]
|
|
81
|
+
parser: XMLReader # Set to none after .clear() is called
|
|
69
82
|
bufsize: int
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
pulldom: PullDOM
|
|
84
|
+
def __init__(self, stream: _SupportsReadClose[bytes] | _SupportsReadClose[str], parser: XMLReader, bufsize: int) -> None: ...
|
|
72
85
|
if sys.version_info < (3, 11):
|
|
73
|
-
def __getitem__(self, pos): ...
|
|
86
|
+
def __getitem__(self, pos: Unused) -> _Event: ...
|
|
74
87
|
|
|
75
|
-
def __next__(self): ...
|
|
76
|
-
def __iter__(self): ...
|
|
77
|
-
def getEvent(self) -> _Event: ...
|
|
78
|
-
def expandNode(self, node:
|
|
88
|
+
def __next__(self) -> _Event: ...
|
|
89
|
+
def __iter__(self) -> Self: ...
|
|
90
|
+
def getEvent(self) -> _Event | None: ...
|
|
91
|
+
def expandNode(self, node: Document) -> None: ...
|
|
79
92
|
def reset(self) -> None: ...
|
|
80
93
|
def clear(self) -> None: ...
|
|
81
94
|
|
|
82
95
|
class SAX2DOM(PullDOM):
|
|
83
|
-
def startElementNS(self, name, tagName, attrs) -> None: ...
|
|
84
|
-
def startElement(self, name, attrs) -> None: ...
|
|
85
|
-
def processingInstruction(self, target, data) -> None: ...
|
|
86
|
-
def ignorableWhitespace(self, chars) -> None: ...
|
|
87
|
-
def characters(self, chars) -> None: ...
|
|
96
|
+
def startElementNS(self, name: _NSName, tagName: str | None, attrs: AttributesNSImpl) -> None: ...
|
|
97
|
+
def startElement(self, name: str, attrs: AttributesImpl) -> None: ...
|
|
98
|
+
def processingInstruction(self, target: str, data: str) -> None: ...
|
|
99
|
+
def ignorableWhitespace(self, chars: str) -> None: ...
|
|
100
|
+
def characters(self, chars: str) -> None: ...
|
|
88
101
|
|
|
89
102
|
default_bufsize: int
|
|
90
103
|
|
|
91
104
|
def parse(
|
|
92
|
-
stream_or_string: str |
|
|
105
|
+
stream_or_string: str | _SupportsReadClose[bytes] | _SupportsReadClose[str],
|
|
106
|
+
parser: XMLReader | None = None,
|
|
107
|
+
bufsize: int | None = None,
|
|
93
108
|
) -> DOMEventStream: ...
|
|
94
109
|
def parseString(string: str, parser: XMLReader | None = None) -> DOMEventStream: ...
|
|
@@ -1,32 +1,9 @@
|
|
|
1
|
-
from _typeshed import
|
|
1
|
+
from _typeshed import SupportsRead
|
|
2
2
|
from typing import Any, Literal, NoReturn
|
|
3
|
-
from
|
|
4
|
-
from urllib.request import OpenerDirector
|
|
5
|
-
from xml.dom.expatbuilder import ExpatBuilder, ExpatBuilderNS
|
|
6
|
-
from xml.dom.minidom import Node
|
|
3
|
+
from xml.dom.minidom import Document, Node, _DOMErrorHandler
|
|
7
4
|
|
|
8
5
|
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
|
|
9
6
|
|
|
10
|
-
# UNKNOWN TYPES:
|
|
11
|
-
# - `Options.errorHandler`.
|
|
12
|
-
# The same as `_DOMBuilderErrorHandlerType`?
|
|
13
|
-
# Maybe `xml.sax.handler.ErrorHandler`?
|
|
14
|
-
# - Return type of DOMBuilder.getFeature().
|
|
15
|
-
# We could get rid of the `Incomplete` if we knew more
|
|
16
|
-
# about `Options.errorHandler`.
|
|
17
|
-
|
|
18
|
-
# ALIASES REPRESENTING MORE UNKNOWN TYPES:
|
|
19
|
-
|
|
20
|
-
# probably the same as `Options.errorHandler`?
|
|
21
|
-
# Maybe `xml.sax.handler.ErrorHandler`?
|
|
22
|
-
_DOMBuilderErrorHandlerType: TypeAlias = Incomplete | None
|
|
23
|
-
# probably some kind of IO...
|
|
24
|
-
_DOMInputSourceCharacterStreamType: TypeAlias = Incomplete | None
|
|
25
|
-
# probably a string??
|
|
26
|
-
_DOMInputSourceStringDataType: TypeAlias = Incomplete | None
|
|
27
|
-
# probably a string??
|
|
28
|
-
_DOMInputSourceEncodingType: TypeAlias = Incomplete | None
|
|
29
|
-
|
|
30
7
|
class Options:
|
|
31
8
|
namespaces: int
|
|
32
9
|
namespace_declarations: bool
|
|
@@ -45,37 +22,35 @@ class Options:
|
|
|
45
22
|
charset_overrides_xml_encoding: bool
|
|
46
23
|
infoset: bool
|
|
47
24
|
supported_mediatypes_only: bool
|
|
48
|
-
errorHandler:
|
|
49
|
-
filter: DOMBuilderFilter | None
|
|
25
|
+
errorHandler: _DOMErrorHandler | None
|
|
26
|
+
filter: DOMBuilderFilter | None
|
|
50
27
|
|
|
51
28
|
class DOMBuilder:
|
|
52
|
-
entityResolver: DOMEntityResolver | None
|
|
53
|
-
errorHandler:
|
|
54
|
-
filter: DOMBuilderFilter | None
|
|
29
|
+
entityResolver: DOMEntityResolver | None
|
|
30
|
+
errorHandler: _DOMErrorHandler | None
|
|
31
|
+
filter: DOMBuilderFilter | None
|
|
55
32
|
ACTION_REPLACE: Literal[1]
|
|
56
33
|
ACTION_APPEND_AS_CHILDREN: Literal[2]
|
|
57
34
|
ACTION_INSERT_AFTER: Literal[3]
|
|
58
35
|
ACTION_INSERT_BEFORE: Literal[4]
|
|
36
|
+
def __init__(self) -> None: ...
|
|
59
37
|
def setFeature(self, name: str, state: int) -> None: ...
|
|
60
38
|
def supportsFeature(self, name: str) -> bool: ...
|
|
61
|
-
def canSetFeature(self, name: str, state:
|
|
39
|
+
def canSetFeature(self, name: str, state: Literal[1, 0]) -> bool: ...
|
|
62
40
|
# getFeature could return any attribute from an instance of `Options`
|
|
63
41
|
def getFeature(self, name: str) -> Any: ...
|
|
64
|
-
def parseURI(self, uri: str) ->
|
|
65
|
-
def parse(self, input: DOMInputSource) ->
|
|
66
|
-
|
|
67
|
-
# as the function does nothing with them, and always raises an exception.
|
|
68
|
-
# But `input` is *probably* `DOMInputSource`?
|
|
69
|
-
def parseWithContext(self, input: Unused, cnode: Unused, action: Literal[1, 2, 3, 4]) -> NoReturn: ...
|
|
42
|
+
def parseURI(self, uri: str) -> Document: ...
|
|
43
|
+
def parse(self, input: DOMInputSource) -> Document: ...
|
|
44
|
+
def parseWithContext(self, input: DOMInputSource, cnode: Node, action: Literal[1, 2, 3, 4]) -> NoReturn: ...
|
|
70
45
|
|
|
71
46
|
class DOMEntityResolver:
|
|
72
47
|
def resolveEntity(self, publicId: str | None, systemId: str) -> DOMInputSource: ...
|
|
73
48
|
|
|
74
49
|
class DOMInputSource:
|
|
75
|
-
byteStream:
|
|
76
|
-
characterStream:
|
|
77
|
-
stringData:
|
|
78
|
-
encoding:
|
|
50
|
+
byteStream: SupportsRead[bytes] | None
|
|
51
|
+
characterStream: SupportsRead[str] | None
|
|
52
|
+
stringData: str | None
|
|
53
|
+
encoding: str | None
|
|
79
54
|
publicId: str | None
|
|
80
55
|
systemId: str | None
|
|
81
56
|
baseURI: str | None
|
|
@@ -86,18 +61,14 @@ class DOMBuilderFilter:
|
|
|
86
61
|
FILTER_SKIP: Literal[3]
|
|
87
62
|
FILTER_INTERRUPT: Literal[4]
|
|
88
63
|
whatToShow: int
|
|
89
|
-
def acceptNode(self, element:
|
|
90
|
-
def startContainer(self, element:
|
|
64
|
+
def acceptNode(self, element: Node) -> Literal[1, 2, 3, 4]: ...
|
|
65
|
+
def startContainer(self, element: Node) -> Literal[1, 2, 3, 4]: ...
|
|
91
66
|
|
|
92
67
|
class DocumentLS:
|
|
93
68
|
async_: bool
|
|
94
69
|
def abort(self) -> NoReturn: ...
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
# `source` is *probably* `DOMInputSource`?
|
|
98
|
-
# `uri` is *probably* a str? (see DOMBuilder.parseURI())
|
|
99
|
-
def load(self, uri: Unused) -> NoReturn: ...
|
|
100
|
-
def loadXML(self, source: Unused) -> NoReturn: ...
|
|
70
|
+
def load(self, uri: str) -> NoReturn: ...
|
|
71
|
+
def loadXML(self, source: str) -> NoReturn: ...
|
|
101
72
|
def saveXML(self, snode: Node | None) -> str: ...
|
|
102
73
|
|
|
103
74
|
class DOMImplementationLS:
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
from _typeshed import FileDescriptorOrPath
|
|
3
|
-
from
|
|
4
|
-
from typing import Final
|
|
3
|
+
from typing import Final, Literal, Protocol, overload
|
|
5
4
|
from xml.etree.ElementTree import Element
|
|
6
5
|
|
|
6
|
+
class _Loader(Protocol):
|
|
7
|
+
@overload
|
|
8
|
+
def __call__(self, href: FileDescriptorOrPath, parse: Literal["xml"], encoding: str | None = None) -> Element: ...
|
|
9
|
+
@overload
|
|
10
|
+
def __call__(self, href: FileDescriptorOrPath, parse: Literal["text"], encoding: str | None = None) -> str: ...
|
|
11
|
+
|
|
7
12
|
XINCLUDE: Final[str]
|
|
8
13
|
XINCLUDE_INCLUDE: Final[str]
|
|
9
14
|
XINCLUDE_FALLBACK: Final[str]
|
|
@@ -13,17 +18,15 @@ if sys.version_info >= (3, 9):
|
|
|
13
18
|
|
|
14
19
|
class FatalIncludeError(SyntaxError): ...
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
@overload
|
|
22
|
+
def default_loader(href: FileDescriptorOrPath, parse: Literal["xml"], encoding: str | None = None) -> Element: ...
|
|
23
|
+
@overload
|
|
24
|
+
def default_loader(href: FileDescriptorOrPath, parse: Literal["text"], encoding: str | None = None) -> str: ...
|
|
17
25
|
|
|
18
|
-
# TODO: loader is of type default_loader ie it takes a callable that has the
|
|
19
|
-
# same signature as default_loader. But default_loader has a keyword argument
|
|
20
|
-
# Which can't be represented using Callable...
|
|
21
26
|
if sys.version_info >= (3, 9):
|
|
22
|
-
def include(
|
|
23
|
-
elem: Element, loader: Callable[..., str | Element] | None = None, base_url: str | None = None, max_depth: int | None = 6
|
|
24
|
-
) -> None: ...
|
|
27
|
+
def include(elem: Element, loader: _Loader | None = None, base_url: str | None = None, max_depth: int | None = 6) -> None: ...
|
|
25
28
|
|
|
26
29
|
class LimitedRecursiveIncludeError(FatalIncludeError): ...
|
|
27
30
|
|
|
28
31
|
else:
|
|
29
|
-
def include(elem: Element, loader:
|
|
32
|
+
def include(elem: Element, loader: _Loader | None = None) -> None: ...
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from collections.abc import Callable, Generator
|
|
1
|
+
from collections.abc import Callable, Generator, Iterable
|
|
2
2
|
from re import Pattern
|
|
3
|
-
from typing import TypeVar
|
|
3
|
+
from typing import Any, Literal, TypeVar, overload
|
|
4
4
|
from typing_extensions import TypeAlias
|
|
5
5
|
from xml.etree.ElementTree import Element
|
|
6
6
|
|
|
@@ -8,27 +8,34 @@ xpath_tokenizer_re: Pattern[str]
|
|
|
8
8
|
|
|
9
9
|
_Token: TypeAlias = tuple[str, str]
|
|
10
10
|
_Next: TypeAlias = Callable[[], _Token]
|
|
11
|
-
_Callback: TypeAlias = Callable[[_SelectorContext,
|
|
11
|
+
_Callback: TypeAlias = Callable[[_SelectorContext, Iterable[Element]], Generator[Element, None, None]]
|
|
12
|
+
_T = TypeVar("_T")
|
|
12
13
|
|
|
13
14
|
def xpath_tokenizer(pattern: str, namespaces: dict[str, str] | None = None) -> Generator[_Token, None, None]: ...
|
|
14
15
|
def get_parent_map(context: _SelectorContext) -> dict[Element, Element]: ...
|
|
15
16
|
def prepare_child(next: _Next, token: _Token) -> _Callback: ...
|
|
16
17
|
def prepare_star(next: _Next, token: _Token) -> _Callback: ...
|
|
17
18
|
def prepare_self(next: _Next, token: _Token) -> _Callback: ...
|
|
18
|
-
def prepare_descendant(next: _Next, token: _Token) -> _Callback: ...
|
|
19
|
+
def prepare_descendant(next: _Next, token: _Token) -> _Callback | None: ...
|
|
19
20
|
def prepare_parent(next: _Next, token: _Token) -> _Callback: ...
|
|
20
|
-
def prepare_predicate(next: _Next, token: _Token) -> _Callback: ...
|
|
21
|
+
def prepare_predicate(next: _Next, token: _Token) -> _Callback | None: ...
|
|
21
22
|
|
|
22
|
-
ops: dict[str, Callable[[_Next, _Token], _Callback]]
|
|
23
|
+
ops: dict[str, Callable[[_Next, _Token], _Callback | None]]
|
|
23
24
|
|
|
24
25
|
class _SelectorContext:
|
|
25
26
|
parent_map: dict[Element, Element] | None
|
|
26
27
|
root: Element
|
|
27
28
|
def __init__(self, root: Element) -> None: ...
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def
|
|
30
|
+
@overload
|
|
31
|
+
def iterfind( # type: ignore[overload-overlap]
|
|
32
|
+
elem: Element[Any], path: Literal[""], namespaces: dict[str, str] | None = None
|
|
33
|
+
) -> None: ...
|
|
34
|
+
@overload
|
|
35
|
+
def iterfind(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ...
|
|
36
|
+
def find(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> Element | None: ...
|
|
37
|
+
def findall(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ...
|
|
38
|
+
@overload
|
|
39
|
+
def findtext(elem: Element[Any], path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ...
|
|
40
|
+
@overload
|
|
41
|
+
def findtext(elem: Element[Any], path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ...
|
|
@@ -2,8 +2,9 @@ import sys
|
|
|
2
2
|
from _collections_abc import dict_keys
|
|
3
3
|
from _typeshed import FileDescriptorOrPath, ReadableBuffer, SupportsRead, SupportsWrite
|
|
4
4
|
from collections.abc import Callable, Generator, ItemsView, Iterable, Iterator, Mapping, Sequence
|
|
5
|
-
from typing import Any, Final, Literal, SupportsIndex, TypeVar, overload
|
|
5
|
+
from typing import Any, Final, Generic, Literal, Protocol, SupportsIndex, TypeVar, overload, type_check_only
|
|
6
6
|
from typing_extensions import TypeAlias, TypeGuard, deprecated
|
|
7
|
+
from xml.parsers.expat import XMLParserType
|
|
7
8
|
|
|
8
9
|
__all__ = [
|
|
9
10
|
"C14NWriterTarget",
|
|
@@ -78,13 +79,22 @@ def canonicalize(
|
|
|
78
79
|
exclude_tags: Iterable[str] | None = None,
|
|
79
80
|
) -> None: ...
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
# The tag for Element can be set to the Comment or ProcessingInstruction
|
|
83
|
+
# functions defined in this module. _ElementCallable could be a recursive
|
|
84
|
+
# type, but defining it that way uncovered a bug in pytype.
|
|
85
|
+
_ElementCallable: TypeAlias = Callable[..., Element[Any]]
|
|
86
|
+
_CallableElement: TypeAlias = Element[_ElementCallable]
|
|
87
|
+
|
|
88
|
+
_Tag = TypeVar("_Tag", default=str, bound=str | _ElementCallable)
|
|
89
|
+
_OtherTag = TypeVar("_OtherTag", default=str, bound=str | _ElementCallable)
|
|
90
|
+
|
|
91
|
+
class Element(Generic[_Tag]):
|
|
92
|
+
tag: _Tag
|
|
83
93
|
attrib: dict[str, str]
|
|
84
94
|
text: str | None
|
|
85
95
|
tail: str | None
|
|
86
|
-
def __init__(self, tag:
|
|
87
|
-
def append(self, subelement: Element, /) -> None: ...
|
|
96
|
+
def __init__(self, tag: _Tag, attrib: dict[str, str] = {}, **extra: str) -> None: ...
|
|
97
|
+
def append(self, subelement: Element[Any], /) -> None: ...
|
|
88
98
|
def clear(self) -> None: ...
|
|
89
99
|
def extend(self, elements: Iterable[Element], /) -> None: ...
|
|
90
100
|
def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ...
|
|
@@ -100,14 +110,17 @@ class Element:
|
|
|
100
110
|
def insert(self, index: int, subelement: Element, /) -> None: ...
|
|
101
111
|
def items(self) -> ItemsView[str, str]: ...
|
|
102
112
|
def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ...
|
|
113
|
+
@overload
|
|
114
|
+
def iterfind(self, path: Literal[""], namespaces: dict[str, str] | None = None) -> None: ... # type: ignore[overload-overlap]
|
|
115
|
+
@overload
|
|
103
116
|
def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ...
|
|
104
117
|
def itertext(self) -> Generator[str, None, None]: ...
|
|
105
118
|
def keys(self) -> dict_keys[str, str]: ...
|
|
106
119
|
# makeelement returns the type of self in Python impl, but not in C impl
|
|
107
|
-
def makeelement(self, tag:
|
|
120
|
+
def makeelement(self, tag: _OtherTag, attrib: dict[str, str], /) -> Element[_OtherTag]: ...
|
|
108
121
|
def remove(self, subelement: Element, /) -> None: ...
|
|
109
122
|
def set(self, key: str, value: str, /) -> None: ...
|
|
110
|
-
def __copy__(self) -> Element: ... # returns the type of self in Python impl, but not in C impl
|
|
123
|
+
def __copy__(self) -> Element[_Tag]: ... # returns the type of self in Python impl, but not in C impl
|
|
111
124
|
def __deepcopy__(self, memo: Any, /) -> Element: ... # Only exists in C impl
|
|
112
125
|
def __delitem__(self, key: SupportsIndex | slice, /) -> None:
|
|
113
126
|
"""Delete self[key]."""
|
|
@@ -144,8 +157,8 @@ class Element:
|
|
|
144
157
|
def getiterator(self, tag: str | None = None) -> list[Element]: ...
|
|
145
158
|
|
|
146
159
|
def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra: str) -> Element: ...
|
|
147
|
-
def Comment(text: str | None = None) ->
|
|
148
|
-
def ProcessingInstruction(target: str, text: str | None = None) ->
|
|
160
|
+
def Comment(text: str | None = None) -> _CallableElement: ...
|
|
161
|
+
def ProcessingInstruction(target: str, text: str | None = None) -> _CallableElement: ...
|
|
149
162
|
|
|
150
163
|
PI = ProcessingInstruction
|
|
151
164
|
|
|
@@ -159,9 +172,11 @@ class QName:
|
|
|
159
172
|
def __eq__(self, other: object) -> bool: ...
|
|
160
173
|
def __hash__(self) -> int: ...
|
|
161
174
|
|
|
162
|
-
|
|
175
|
+
_Root = TypeVar("_Root", Element, Element | None, default=Element | None)
|
|
176
|
+
|
|
177
|
+
class ElementTree(Generic[_Root]):
|
|
163
178
|
def __init__(self, element: Element | None = None, file: _FileRead | None = None) -> None: ...
|
|
164
|
-
def getroot(self) ->
|
|
179
|
+
def getroot(self) -> _Root: ...
|
|
165
180
|
def parse(self, source: _FileRead, parser: XMLParser | None = None) -> Element: ...
|
|
166
181
|
def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ...
|
|
167
182
|
if sys.version_info < (3, 9):
|
|
@@ -173,6 +188,9 @@ class ElementTree:
|
|
|
173
188
|
@overload
|
|
174
189
|
def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ...
|
|
175
190
|
def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ...
|
|
191
|
+
@overload
|
|
192
|
+
def iterfind(self, path: Literal[""], namespaces: dict[str, str] | None = None) -> None: ... # type: ignore[overload-overlap]
|
|
193
|
+
@overload
|
|
176
194
|
def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ...
|
|
177
195
|
def write(
|
|
178
196
|
self,
|
|
@@ -180,18 +198,20 @@ class ElementTree:
|
|
|
180
198
|
encoding: str | None = None,
|
|
181
199
|
xml_declaration: bool | None = None,
|
|
182
200
|
default_namespace: str | None = None,
|
|
183
|
-
method:
|
|
201
|
+
method: Literal["xml", "html", "text", "c14n"] | None = None,
|
|
184
202
|
*,
|
|
185
203
|
short_empty_elements: bool = True,
|
|
186
204
|
) -> None: ...
|
|
187
205
|
def write_c14n(self, file: _FileWriteC14N) -> None: ...
|
|
188
206
|
|
|
207
|
+
HTML_EMPTY: set[str]
|
|
208
|
+
|
|
189
209
|
def register_namespace(prefix: str, uri: str) -> None: ...
|
|
190
210
|
@overload
|
|
191
211
|
def tostring(
|
|
192
212
|
element: Element,
|
|
193
213
|
encoding: None = None,
|
|
194
|
-
method:
|
|
214
|
+
method: Literal["xml", "html", "text", "c14n"] | None = None,
|
|
195
215
|
*,
|
|
196
216
|
xml_declaration: bool | None = None,
|
|
197
217
|
default_namespace: str | None = None,
|
|
@@ -201,7 +221,7 @@ def tostring(
|
|
|
201
221
|
def tostring(
|
|
202
222
|
element: Element,
|
|
203
223
|
encoding: Literal["unicode"],
|
|
204
|
-
method:
|
|
224
|
+
method: Literal["xml", "html", "text", "c14n"] | None = None,
|
|
205
225
|
*,
|
|
206
226
|
xml_declaration: bool | None = None,
|
|
207
227
|
default_namespace: str | None = None,
|
|
@@ -211,7 +231,7 @@ def tostring(
|
|
|
211
231
|
def tostring(
|
|
212
232
|
element: Element,
|
|
213
233
|
encoding: str,
|
|
214
|
-
method:
|
|
234
|
+
method: Literal["xml", "html", "text", "c14n"] | None = None,
|
|
215
235
|
*,
|
|
216
236
|
xml_declaration: bool | None = None,
|
|
217
237
|
default_namespace: str | None = None,
|
|
@@ -221,7 +241,7 @@ def tostring(
|
|
|
221
241
|
def tostringlist(
|
|
222
242
|
element: Element,
|
|
223
243
|
encoding: None = None,
|
|
224
|
-
method:
|
|
244
|
+
method: Literal["xml", "html", "text", "c14n"] | None = None,
|
|
225
245
|
*,
|
|
226
246
|
xml_declaration: bool | None = None,
|
|
227
247
|
default_namespace: str | None = None,
|
|
@@ -231,7 +251,7 @@ def tostringlist(
|
|
|
231
251
|
def tostringlist(
|
|
232
252
|
element: Element,
|
|
233
253
|
encoding: Literal["unicode"],
|
|
234
|
-
method:
|
|
254
|
+
method: Literal["xml", "html", "text", "c14n"] | None = None,
|
|
235
255
|
*,
|
|
236
256
|
xml_declaration: bool | None = None,
|
|
237
257
|
default_namespace: str | None = None,
|
|
@@ -241,21 +261,23 @@ def tostringlist(
|
|
|
241
261
|
def tostringlist(
|
|
242
262
|
element: Element,
|
|
243
263
|
encoding: str,
|
|
244
|
-
method:
|
|
264
|
+
method: Literal["xml", "html", "text", "c14n"] | None = None,
|
|
245
265
|
*,
|
|
246
266
|
xml_declaration: bool | None = None,
|
|
247
267
|
default_namespace: str | None = None,
|
|
248
268
|
short_empty_elements: bool = True,
|
|
249
269
|
) -> list[Any]: ...
|
|
250
|
-
def dump(elem: Element) -> None: ...
|
|
270
|
+
def dump(elem: Element | ElementTree[Any]) -> None: ...
|
|
251
271
|
|
|
252
272
|
if sys.version_info >= (3, 9):
|
|
253
|
-
def indent(tree: Element | ElementTree, space: str = " ", level: int = 0) -> None: ...
|
|
273
|
+
def indent(tree: Element | ElementTree[Any], space: str = " ", level: int = 0) -> None: ...
|
|
254
274
|
|
|
255
|
-
def parse(source: _FileRead, parser: XMLParser | None = None) -> ElementTree: ...
|
|
275
|
+
def parse(source: _FileRead, parser: XMLParser[Any] | None = None) -> ElementTree[Element]: ...
|
|
256
276
|
|
|
257
|
-
class
|
|
258
|
-
|
|
277
|
+
# This class is defined inside the body of iterparse
|
|
278
|
+
@type_check_only
|
|
279
|
+
class _IterParseIterator(Iterator[tuple[str, Element]], Protocol):
|
|
280
|
+
def __next__(self) -> tuple[str, Element]: ...
|
|
259
281
|
if sys.version_info >= (3, 13):
|
|
260
282
|
def close(self) -> None: ...
|
|
261
283
|
if sys.version_info >= (3, 11):
|
|
@@ -263,13 +285,13 @@ class _IterParseIterator(Iterator[tuple[str, Any]]):
|
|
|
263
285
|
|
|
264
286
|
def iterparse(source: _FileRead, events: Sequence[str] | None = None, parser: XMLParser | None = None) -> _IterParseIterator: ...
|
|
265
287
|
|
|
266
|
-
|
|
267
|
-
|
|
288
|
+
_EventQueue: TypeAlias = tuple[str] | tuple[str, tuple[str, str]] | tuple[str, None]
|
|
289
|
+
|
|
290
|
+
class XMLPullParser(Generic[_E]):
|
|
291
|
+
def __init__(self, events: Sequence[str] | None = None, *, _parser: XMLParser[_E] | None = None) -> None: ...
|
|
268
292
|
def feed(self, data: str | ReadableBuffer) -> None: ...
|
|
269
293
|
def close(self) -> None: ...
|
|
270
|
-
|
|
271
|
-
# Use `Any` to avoid false-positive errors.
|
|
272
|
-
def read_events(self) -> Iterator[tuple[str, Any]]: ...
|
|
294
|
+
def read_events(self) -> Iterator[_EventQueue | tuple[str, _E]]: ...
|
|
273
295
|
def flush(self) -> None: ...
|
|
274
296
|
|
|
275
297
|
def XML(text: str | ReadableBuffer, parser: XMLParser | None = None) -> Element: ...
|
|
@@ -295,12 +317,12 @@ class TreeBuilder:
|
|
|
295
317
|
# comment_factory can take None because passing None to Comment is not an error
|
|
296
318
|
def __init__(
|
|
297
319
|
self,
|
|
298
|
-
element_factory: _ElementFactory | None =
|
|
320
|
+
element_factory: _ElementFactory | None = None,
|
|
299
321
|
*,
|
|
300
|
-
comment_factory: Callable[[str | None], Element] | None =
|
|
301
|
-
pi_factory: Callable[[str, str | None], Element] | None =
|
|
302
|
-
insert_comments: bool =
|
|
303
|
-
insert_pis: bool =
|
|
322
|
+
comment_factory: Callable[[str | None], Element[Any]] | None = None,
|
|
323
|
+
pi_factory: Callable[[str, str | None], Element[Any]] | None = None,
|
|
324
|
+
insert_comments: bool = False,
|
|
325
|
+
insert_pis: bool = False,
|
|
304
326
|
) -> None: ...
|
|
305
327
|
insert_comments: bool
|
|
306
328
|
insert_pis: bool
|
|
@@ -312,8 +334,8 @@ class TreeBuilder:
|
|
|
312
334
|
def start(self, tag: Any, attrs: dict[Any, Any], /) -> Element: ...
|
|
313
335
|
def end(self, tag: str, /) -> Element: ...
|
|
314
336
|
# These two methods have pos-only parameters in the C implementation
|
|
315
|
-
def comment(self, text: str | None, /) -> Element: ...
|
|
316
|
-
def pi(self, target: str, text: str | None = None, /) -> Element: ...
|
|
337
|
+
def comment(self, text: str | None, /) -> Element[Any]: ...
|
|
338
|
+
def pi(self, target: str, text: str | None = None, /) -> Element[Any]: ...
|
|
317
339
|
|
|
318
340
|
class C14NWriterTarget:
|
|
319
341
|
def __init__(
|
|
@@ -335,13 +357,33 @@ class C14NWriterTarget:
|
|
|
335
357
|
def comment(self, text: str) -> None: ...
|
|
336
358
|
def pi(self, target: str, data: str) -> None: ...
|
|
337
359
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
360
|
+
# The target type is tricky, because the implementation doesn't
|
|
361
|
+
# require any particular attribute to be present. This documents the attributes
|
|
362
|
+
# that can be present, but uncommenting any of them would require them.
|
|
363
|
+
class _Target(Protocol):
|
|
364
|
+
# start: Callable[str, dict[str, str], Any] | None
|
|
365
|
+
# end: Callable[[str], Any] | None
|
|
366
|
+
# start_ns: Callable[[str, str], Any] | None
|
|
367
|
+
# end_ns: Callable[[str], Any] | None
|
|
368
|
+
# data: Callable[[str], Any] | None
|
|
369
|
+
# comment: Callable[[str], Any]
|
|
370
|
+
# pi: Callable[[str, str], Any] | None
|
|
371
|
+
# close: Callable[[], Any] | None
|
|
372
|
+
...
|
|
373
|
+
|
|
374
|
+
_E = TypeVar("_E", default=Element)
|
|
375
|
+
|
|
376
|
+
# This is generic because the return type of close() depends on the target.
|
|
377
|
+
# The default target is TreeBuilder, which returns Element.
|
|
378
|
+
# C14NWriterTarget does not implement a close method, so using it results
|
|
379
|
+
# in a type of XMLParser[None].
|
|
380
|
+
class XMLParser(Generic[_E]):
|
|
381
|
+
parser: XMLParserType
|
|
382
|
+
target: _Target
|
|
341
383
|
# TODO-what is entity used for???
|
|
342
|
-
entity:
|
|
384
|
+
entity: dict[str, str]
|
|
343
385
|
version: str
|
|
344
|
-
def __init__(self, *, target:
|
|
345
|
-
def close(self) ->
|
|
386
|
+
def __init__(self, *, target: _Target | None = None, encoding: str | None = None) -> None: ...
|
|
387
|
+
def close(self) -> _E: ...
|
|
346
388
|
def feed(self, data: str | ReadableBuffer, /) -> None: ...
|
|
347
389
|
def flush(self) -> None: ...
|
|
@@ -4,15 +4,15 @@ from xml.sax.xmlreader import Locator
|
|
|
4
4
|
class SAXException(Exception):
|
|
5
5
|
def __init__(self, msg: str, exception: Exception | None = None) -> None: ...
|
|
6
6
|
def getMessage(self) -> str: ...
|
|
7
|
-
def getException(self) -> Exception: ...
|
|
7
|
+
def getException(self) -> Exception | None: ...
|
|
8
8
|
def __getitem__(self, ix: object) -> NoReturn: ...
|
|
9
9
|
|
|
10
10
|
class SAXParseException(SAXException):
|
|
11
11
|
def __init__(self, msg: str, exception: Exception | None, locator: Locator) -> None: ...
|
|
12
|
-
def getColumnNumber(self) -> int: ...
|
|
13
|
-
def getLineNumber(self) -> int: ...
|
|
14
|
-
def getPublicId(self): ...
|
|
15
|
-
def getSystemId(self): ...
|
|
12
|
+
def getColumnNumber(self) -> int | None: ...
|
|
13
|
+
def getLineNumber(self) -> int | None: ...
|
|
14
|
+
def getPublicId(self) -> str | None: ...
|
|
15
|
+
def getSystemId(self) -> str | None: ...
|
|
16
16
|
|
|
17
17
|
class SAXNotRecognizedException(SAXException): ...
|
|
18
18
|
class SAXNotSupportedException(SAXException): ...
|