Commit Graph
63 Commits
Author SHA1 Message Date
Stephen Morton 7b68c81f50 move various cases of 'stub does not have *args argument' to "don't fix" (#12956) 2024-11-05 07:57:45 +01:00
Stephen Morton f314631fcb remove unused io-related allowlist entries (#12955)
fallout from https://github.com/python/typeshed/pull/12947

fixes https://github.com/python/typeshed/issues/12954
2024-11-04 17:22:08 -08:00
Stephen Morton 84dfa4a8fc Fix FileLoader.get_resource_reader signature (#12946)
Move stubtest allowlist entries to "can't be fixed" section
2024-11-04 16:16:14 +01:00
Stephen Morton 1a4631f0d2 Remove fake base class ipaddress._BaseInterface (#12949)
Also make hostmask a property to improve stubtest
2024-11-04 15:59:21 +01:00
Stephen Morton 9c8bc640a3 a couple stubtest fixes in multiprocessing (#12948) 2024-11-04 06:42:11 -08:00
Stephen Morton e37ac25928 clean up io methods (#12947)
fixes for stubtest and default values
2024-11-04 06:39:25 -08:00
Stephen Morton 6029bf1819 inheritance for zipimporter (#12920) 2024-10-29 19:47:56 +01:00
Stephen Morton 0301510114 Naming and inheritance for importlib (#12775)
This MR breaks out _frozen_importlib_external (which is the same
thing as importlib._bootstrap_external) and _frozen_importlib
(which is the same thing as importlib._bootstrap).
2024-10-29 11:09:00 +01:00
Stephen Morton 494e832a74 fix up blake2b/blake2s classes (#12878) 2024-10-23 07:14:37 -07:00
Stephen Morton c64f9d065b unnecessary inheritance from ad-hoc protocol (#12882) 2024-10-23 07:11:51 -07:00
Stephen Morton d5fff13c9b add contextlib._GeneratorContextManagerBase (#12885)
Actually putting methods on it may be currently infeasible, but
I don't see why it shouldn't exist at all.
2024-10-23 07:11:06 -07:00
Stephen Morton 4c38695dfd fix inheritance for _interpreters.NotShareableError (#12880)
related to https://github.com/python/typeshed/issues/3968
2024-10-23 06:58:46 -07:00
Stephen Morton d7aa851552 correct inheritance of io.BufferedRandom (#12883) 2024-10-23 06:52:22 -07:00
Stephen Morton 0d95bad46a correct inheritance for io.StringIO (#12884) 2024-10-23 06:48:30 -07:00
Stephen Morton 7417c373ab Remove false inheritance from io.IncrementalNewlineDecoder (#12871) 2024-10-22 11:07:44 +02:00
Stephen Morton e74d9cf9c7 remove unneeded use of AbstractContextManager from multiprocessing.synchronize (#12872) 2024-10-22 10:20:15 +02:00
Stephen Morton e8c2e5bb20 remove redundant inheritance from Iterator for typing.IO (#12870) 2024-10-22 01:29:03 +01:00
Stephen Morton b62579b0d2 swap inheritance order for typing.Sequence (#12869)
This matches the order at runtime.
2024-10-21 22:37:02 +01:00
Stephen Morton 925b3a3713 Remove redundant inheritances from Iterator in builtins (#12851) 2024-10-21 14:40:07 +02:00
Stephen Morton 281dd351a2 Remove redundant inheritances from Iterator in itertools (#12816) 2024-10-18 12:24:01 +02:00
Stephen Morton 56078f574f csv.Dialect doesn't actually subclass _csv.Dialect (#12808)
It does a weird wrapping thing instead:
https://github.com/python/cpython/blob/2a5cdb251674ce8d9a824c102f7cd846d944cfa4/Lib/csv.py#L114
2024-10-16 22:12:47 -07:00
Stephen Morton 2412c7cea6 Remove unneeded Iterable base class from asyncio.Future (#12827) 2024-10-16 22:11:05 -07:00
Stephen Morton aedf65abe9 remove unneeded AsyncIterator base class from asyncio.StreamReader (#12815) 2024-10-15 11:25:40 -07:00
Stephen Morton 816b47c231 remove unneeded Interator base class from sqlite3.Cursor (#12813) 2024-10-15 11:25:21 -07:00
Stephen Morton 1fb6ebf62b Remove redundant inheritances from Iterator (#12814) 2024-10-15 19:17:34 +01:00
Stephen Morton f08d769f7c remove unneeded Iterable base class from CookieJar (#12812) 2024-10-15 19:47:56 +02:00
Stephen Morton a871efd90c remove unecessary Iterable base classes (#12810) 2024-10-15 00:53:35 +01:00
Stephen Morton e7e9c13c1c clean inheritance for OrderedDict related classes (#12809)
Reversible is protocol-like, plus it subclasses dict which is itself
Reversible on all supported python versions now.
2024-10-14 16:05:04 -07:00
Stephen Morton 7b794ef343 remove unneeded fake base classes from mmap.mmap (#12807) 2024-10-14 23:38:35 +01:00
Stephen Morton 16bab543a3 make os._wrap_close not inherit from TextIOWrapper (#12774) 2024-10-14 11:39:30 +02:00
Stephen Morton 03fe755ec1 move _operator classes to operator (#12745) 2024-10-11 14:16:47 +02:00
Stephen Morton f83b6fadbe add _asyncio (#12766)
improves naming and inheritance for asyncio.Future and asyncio.Task

related to https://github.com/python/typeshed/issues/3968
2024-10-09 20:55:28 -07:00
Stephen Morton 42ebc89d8c remove redundant methods from _io classes (#12761) 2024-10-09 20:32:54 -07:00
Stephen Morton 4b6869d572 remove SupportsInt from bases of ipaddress._BaseAddress (#12765)
added in 2017: https://github.com/python/typeshed/pull/1361

This use case no longer requires the protocol to be an actual base
class.
2024-10-09 20:32:06 -07:00
Stephen Morton 2b1c7d55b9 re-sort io classes into _io (#12755)
This version keeps it simple and clean: No changes to class bodies.
The only changes here are moving between files and updating the
naming and inheritance.

Related to #3968 and split from #12740.
2024-10-08 21:32:10 -07:00
Stephen Morton 3e29e05e4a Experiment: remove IntFlag from enum.auto (#12760)
comments in https://github.com/python/typeshed/issues/10384 suggest
that type checkers should special case enum.auto rather than
relying on the IntFlag hack. It's been a while since then, do we
still need it?
2024-10-08 21:24:31 -07:00
Stephen Morton dbd0d35217 add contextlib._BaseExitStack (#12750)
Improves the MRO of ExitStack and AsyncExitStack

related to https://github.com/python/typeshed/issues/3968
2024-10-06 19:08:27 -07:00
Stephen Morton f318894924 update _CursesWindow to the runtime name "window" (#12744)
Prior to 3.8 the underlying C class was not given a name in
python, so typeshed added _CursesWindow to use it as a type.
Now that it has a name in python, typeshed should use that name.

We can keep _CursesWindow as an alias, for anyone using that
already.
2024-10-06 19:04:55 -07:00
Stephen Morton dbc71c9951 re-sort decimal classes (#12743)
They call themselves "decimal.*" at runtime, so move them into
decimal.pyi so typshed's name matches.

related to #3968
2024-10-06 13:19:22 -07:00
Stephen Morton 1a0b507ae7 add unittest.mock.Base to MagicMixin and MagicProxy (#12747)
This matches the runtime.
2024-10-06 13:17:42 -07:00
Stephen Morton f30d367c7a move socket.error classes from _socket to socket (#12746)
They're implemented in C, but consider themselves to live in
socket.
2024-10-05 18:19:34 -07:00
Stephen Morton 77510ae6a4 resort _ast and ast modules (#11162)
The classes imported from the _ast module are defined in C,
but set their __module__ to ast. This arrangement ensures that
the type stubs have the same.

related to https://github.com/python/typeshed/issues/3968
and the discussion in https://github.com/python/typeshed/issues/11141
2024-10-04 17:33:45 -07:00
Stephen Morton 39650b43b5 add _sqlite3 module (#11174)
This aligns with the implementation while giving greater fidelity
to runtime naming and inheritance

Related to https://github.com/python/typeshed/issues/3968 and https://github.com/python/typeshed/issues/11141
2024-10-04 17:28:26 -07:00
Stephen Morton 719ddd1774 move re.error into re.pyi (#11188) 2024-10-02 11:26:44 +02:00
Stephen MortonandJelle Zijlstra 4f37d8fff8 add _ssl module (#11155)
Really all I needed for fixing the inheritance was _ssl._SSLContext.
But then I needed all the other stuff in _ssl, and if I was doing that
I wanted to do a thorough job of it.

Motivation was originally related to https://github.com/python/typeshed/issues/3968 ,
but we're well beyond that now, really.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-01 20:10:51 -07:00
Stephen MortonandJelle Zijlstra c43894568f resort weakref classes (#11165)
This improves fidelity of naming and inheritance on 3.11+

related to https://github.com/python/typeshed/issues/3968 and https://github.com/python/typeshed/issues/11141

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-01 19:50:10 -07:00
6bc1884577 follow implementation more closely in zoneinfo (#11189)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-01 19:49:01 -07:00
Stephen MortonandJelle Zijlstra ddb57608fd move pyexpat.ExpatError to xml.parsers.expat.ExpatError (#11168)
This matches the name reported by the cass at runtime.

related to https://github.com/python/typeshed/issues/11141

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-10-01 18:45:11 -07:00
764532356a add _lsprof module (#11159)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-16 08:38:49 -08:00
Stephen Morton 9877ed8092 Various ctypes improvements (#11186)
Mostly more attention paid to which classes are actually the same class
2024-01-30 22:18:00 -08:00
Stephen Morton ad51dde631 add unittest.case._AssertRaisesBaseContext class (#11158) 2023-12-18 23:07:47 +01:00
Stephen Morton f8e738621f add intermediate classes in selectors module (#11164) 2023-12-18 20:22:05 +01:00
Stephen Morton a53bfebb3f add zipfile._path (#11150) 2023-12-18 14:45:20 +01:00
Stephen Morton fd3228a2e2 threading.ThreadError and threading.local are aliases from _thread (#11167) 2023-12-18 14:13:08 +01:00
Stephen Morton 33df486ba2 Allow the use of local-only stubtest allowlists (#11173)
This makes it nicer to work on a local system with known
divergences from the CI environment
2023-12-16 18:43:33 -08:00
Stephen Morton b6740d0bf4 use _compression.BaseStream for lzma.LZMAFile (#11166)
related to https://github.com/python/typeshed/issues/3968
2023-12-15 00:02:05 +00:00
Stephen Morton 92928b5f60 add pyclbr._Object (#11151) 2023-12-12 21:24:27 +01:00
Stephen Morton 1600850258 fix inheritance for urllib.response.addbase (#11152) 2023-12-12 13:03:37 +01:00
Stephen Morton fd558f8acf importlib.abc.Loader moved to importlib._abc.Loader in 3.10 (#11142) 2023-12-11 14:48:58 +01:00
Stephen Morton 695d67cd7b Add deprecation classes in importlib.metadata (#11118) 2023-12-10 21:06:22 +01:00
Stephen Morton d373050dbb Fix importlib.abc.Finder base class, method availability (#11134) 2023-12-10 12:01:44 +01:00
Stephen Morton 45b1db9f8e use _LoopBoundMixin in asyncio when appropriate (#11127)
related to https://github.com/python/typeshed/issues/3968
2023-12-09 20:36:34 -08:00
Stephen Morton 6b9f82d2e1 make pointer types in ctypes.wintypes subclasses instead of aliases (#11126)
related to https://github.com/python/typeshed/issues/3968
2023-12-09 20:34:22 -08:00