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
Sebastian Rittau
23604858a6
Remove Python 3.7 branches ( #11238 )
2024-01-05 11:39:39 +01: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
Jun Komoda
4009efa349
_CField as a generic descriptor protocol (#10595 )
2023-09-01 16:23:33 +02:00
Nikita Sobolev
0aa5dd57e5
Update ctypes stubs for Python 3.12 ( #10290 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2023-06-09 19:55:03 +01:00
Jun Komoda
a6ecf564b5
move and rename from ctypes._FuncPointer to _ctypes.CFuncPtr ( #10140 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2023-05-06 10:17:34 -07:00
Jun Komoda
05c0a1d8b2
move byref-related definitions from ctypes/__init__.pyi to _ctypes.pyi ( #10137 )
2023-05-03 16:50:47 +01:00
Jun Komoda
01b09d4371
Move some pointer-related definitions from ctypes/__init__.pyi to _ctypes.pyi ( #10133 )
2023-05-03 10:04:13 +01:00
Jun Komoda
ce531f897f
move some non-pointer-related definitions from ctypes/__init__.pyi to _ctypes.pyi ( #10130 )
...
- `ArgumentError`
- `addressof`
- `alignment`
- `get_errno`
- `resize`
- `set_errno`
- `sizeof`
2023-05-02 16:54:42 +01:00
Jun Komoda
bbeec7cbbf
Move some Windows-specific things from ctypes/__init__.pyi to _ctypes.pyi ( #10128 )
...
- `FormatError`
- `get_last_error`
- `set_last_error`
2023-05-02 11:21:55 +01:00
Jun Komoda
295a5c3e7a
Move Structure and Union from ctypes/__init__.pyi to _ctypes.pyi ( #10125 )
2023-05-01 13:01:41 +01:00
Jun Komoda
ae0c9f9dad
Move _SimpleCData and Array from ctypes/__init__.pyi to _ctypes.pyi ( #10118 )
2023-04-30 21:22:46 +01:00
Alex Waygood
257e287fec
Stdlib: correct many parameter names ( #9815 )
2023-03-04 09:53:12 +00:00
Alex Waygood
9ed39d8796
Use typing_extensions.Self in the stdlib ( #9694 )
2023-02-09 09:12:13 +00:00
Alex Waygood
0ef9c3f8e8
Enable flake8-pyi's Y037 ( #9686 )
2023-02-06 19:01:02 -08:00
Eclips4
3b4dbe36d4
ctypes._CData: Fix field name ( #9633 )
2023-01-31 09:16:39 +01:00
Alex Waygood
33a62ae42d
Add more defaults to the stdlib ( #9606 )
...
Continuing work towards #8988 .
The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:
- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
2023-01-29 01:51:23 +00:00
Alex Waygood
d98d1674e7
Fix a few issues with parameter defaults ( #9572 )
2023-01-20 09:47:59 -08:00
Jelle Zijlstra
ddfaca3200
stdlib: add argument default values ( #9501 )
2023-01-18 09:37:34 +01:00
Avasam
23ac9bff19
Check for unused pyright: ignore and differentiate from mypy ignores ( #9397 )
2022-12-28 10:44:29 +00:00
Jelle Zijlstra
3d8d744eb4
ctypes: improve bytes handling ( #9029 )
2022-10-31 15:26:09 +01:00
Candy
a702daa631
Fixed ctypes pointer typing errors ( #8880 )
2022-10-13 20:18:00 -07:00
Alex Waygood
3e5808a990
Bump flake8-pyi and pytype test dependencies ( #8656 )
2022-08-31 12:20:11 +01:00
junkmd
1c6eb33c23
add and migrate constants from ctypes/__init__.pyi to _ctypes.pyi ( #8643 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2022-08-29 15:33:47 +01:00
Alex Waygood
87fc724cef
ctypes: pointer is a function, not a class (#8446 )
2022-07-31 15:29:13 +02:00
Sebastian Rittau
faae950ade
Use error codes for type ignores ( #8280 )
...
Disable reportSelfClsParameterName for pytype as this is out of typeshed's
control
Closes : #7497
2022-07-12 20:15:49 +02:00
Alex Waygood
6b0c8df9ec
Upgrade pyright, improve pyright config files ( #8072 )
2022-06-16 18:50:50 +01:00
Alex Waygood
01d5e28ff7
Fix miscellaneous invalid TypeVar usages ( #8074 )
2022-06-14 08:48:41 -07:00
Alex Waygood
97a74bc1aa
Import from collections.abc wherever possible ( #7635 )
2022-04-18 12:50:37 +02:00
Alex Waygood
740193a8fc
Use TypeAlias where possible for type aliases ( #7630 )
2022-04-15 18:01:00 -07:00
Alex Waygood
1acc8f3bd6
Use PEP 604 syntax wherever possible, part II ( #7514 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2022-03-19 14:27:35 +00:00
Alex Waygood
3ab250eec8
Use PEP 604 syntax wherever possible ( #7493 )
2022-03-16 16:01:33 +01:00
Alex Waygood
f4ae363b56
stdlib: correct many pos-or-kw arg names in dunder methods ( #7451 )
2022-03-07 16:40:03 +01:00
Jelle Zijlstra
cf3ea5b6e6
ctypes.memmove and memset return ints ( #7407 )
...
They actually return pointers, but ctypes turns them into ints.
Fixes #7406
2022-02-28 18:00:16 -08:00
Alex Waygood
24cfd431a8
Fix positional-only differences in ctypes ( #7223 )
2022-02-15 06:22:14 -08:00
Shantanu
b88a6f19cd
Upgrade black version ( #7089 )
2022-01-30 16:27:06 -08:00
Alex Waygood
96c9abb058
Always use _typeshed.Self, where applicable ( #6880 )
...
* Always use `_typeshed.Self`, where applicable
* Revert changes to `google-cloud-ndb` (ambiguous)
* Remove empty line added by script
* Revert changes to `stubs/python-dateutil/dateutil/relativedelta.pyi`
* Manually add a few more that the script missed
* Improve `filelock` annotation
Source code here: 79ec7b2826/src/filelock/_api.py (L207)
* Improve `opentracing/scope` annotation
Source code here: 3e1d357a34/opentracing/scope.py (L71)
* Improve `redis/client` stub
Source code here: 15f315a496/redis/client.py (L1217)
* Improve `redis/lock` annotation
Source code here: 15f315a496/redis/lock.py (L155)
* Improve `requests/models` annotation
Source code here: d718e75383/requests/models.py (L653)
2022-01-09 19:16:19 -08:00
Alex Waygood
a40d79a4e6
Use lowercase type everywhere ( #6853 )
2022-01-08 16:09:29 +01:00
Alex Waygood
505ea72641
Never explicitly inherit from object in Python 3-only stubs ( #6777 )
2022-01-02 07:24:48 +01:00
Alex Waygood
8d5d2520ac
Use PEP 585 syntax wherever possible ( #6717 )
2021-12-28 11:31:43 +01:00
Numerlor
1ae4adac4b
Fix ctypes.FormatError code parameter to be optional ( #6635 )
2021-12-20 15:30:24 -08:00
Nikita Sobolev
d0ce310f55
Make ctypes.Array abstract ( #6361 )
...
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2021-11-28 22:42:23 +02:00
Akuli
a5bc1e037f
Add mypy error codes to '# type: ignore' comments ( #6379 )
2021-11-26 07:07:56 +01:00
Nikita Sobolev
a2f0dbfb2b
Do not use ClassVars with generic variables ( #6348 )
2021-11-21 07:20:05 -08:00
Akuli
994b69ef8f
Use lowercase tuple where possible ( #6170 )
2021-10-14 17:18:19 -07:00
Vincent Pelletier
4c0dccac0f
Fold remaining custom stdlib *Buffer types into _typeshed. ( #6082 )
...
Add ctypes base type to WriteableBuffer.
Add a ReadOnlyBuffer type from fcntl.
Base ReadableBuffer on WriteableBuffer and ReadOnlyBuffer.
Use these types in fcntl and ctypes stubs.
2021-09-28 09:15:26 +02:00
Oleg Höfling
64f481189f
drop ellipsis assignments from module vars, classvars and instance attrs ( #5914 )
...
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com >
2021-08-11 19:26:58 +02:00
Akuli
ce11072dbe
Big diff: use lower-case list and dict ( #5888 )
2021-08-08 09:26:35 -07:00
Akuli
1395318faa
use new union syntax in ctypes/__init__.pyi ( #5883 )
2021-08-08 15:45:28 +02:00
Akuli
ee487304d7
Big diff: Use new "|" union syntax ( #5872 )
2021-08-08 11:05:21 +02:00