Amin Alaee
c6161f7108
Limit os.sendfile arguments based on platform ( #10790 )
2023-09-28 13:36:25 +02:00
Amin Alaee
99ce091f17
Make os.setresuid and os.setresgid positional-only ( #10791 )
2023-09-28 10:10:21 +01:00
Nikita Sobolev
9f4edca70e
Update os and posix to python 3.12 on darwin ( #10779 )
2023-09-26 09:46:29 +02:00
Amin Alaee
9e79a100b3
Add os.splice and flags on Linux for Python 3.10+ ( #10771 )
2023-09-25 17:20:37 +02:00
Amin Alaee
e69545844b
Add os.eventfd, os.eventfd_read and os.eventfd_write to Linux for Python 3.10+ ( #10768 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2023-09-25 14:10:56 +01:00
Amin Alaee
0a92429627
Add os.unshare clone flags for Linux, Python 3.12+ ( #10757 )
2023-09-24 16:23:30 +01:00
Amin Alaee
96eaa767dd
Update os on Windows, Python3.12+ ( #10749 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com >
2023-09-22 16:12:50 +01:00
Amin Alaee
6dfa285230
Add os.EX_OK on Windows, Python 3.11+ ( #10748 )
2023-09-22 12:51:22 +01:00
Nikita Sobolev
f28cb8b856
Update os.DirEntry to 3.12 ( #10643 )
2023-08-31 14:29:21 +01:00
Alex Waygood
4ae6d38f96
Use latest Python for stubtest in CI ( #10641 )
2023-08-30 18:50:11 +02:00
gotyaoi
1afae4e7f0
Changes waitid to return waitid_result | None ( #10589 )
...
Fixes #10564
2023-08-16 08:27:20 +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
53747b264e
Stdlib: add 'obvious' default values ( #9688 )
2023-02-07 13:00:40 +01:00
Akuli
37a180ef7b
Use octal for mode defaults ( #9670 )
2023-02-03 19:12:53 +00:00
Jelle Zijlstra
5b24c7bb41
stdlib: Run stubdefaulter on Linux for 3.9 ( #9663 )
2023-02-03 00:39:22 +00:00
Jelle Zijlstra
0fc3a567fc
stdlib: add defaults for modules accessible on MacOS ( #9659 )
...
Ran stubdefaulter with standard options on a Mac.
2023-02-01 22:46:55 +00: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
Jelle Zijlstra
ddfaca3200
stdlib: add argument default values ( #9501 )
2023-01-18 09:37:34 +01:00
Avasam
c70d303985
Audit stdlib object annotations ( #9519 )
2023-01-17 15:40:00 +00:00
Avasam
aad1a14890
Use the FileDescriptorOrPath alias consistently in the stdlib ( #9513 )
2023-01-12 18:14:48 +00:00
Jelle Zijlstra
68924e00e5
os: improve bytes handling ( #9072 )
2022-11-06 21:32:46 -08:00
Alex Waygood
20bc8fa4e3
Fix stubtest errors on macOS / Python 3.11 ( #8743 )
2022-09-15 15:27:42 -07:00
Arnav Singh
712b265a16
Fix os.{,p}{read,write}v to take Sequence of ReadableBuffer / WriteableBuffer ( #8617 )
...
Fixes #8615
Fixes #8616
2022-08-25 21:50:01 -07:00
Alex Waygood
e2ce7c6344
stdlib: audit more callback annotations ( #8209 )
2022-07-19 07:07:25 -07:00
Jelle Zijlstra
0306754f5f
os: pos-only params for various functions ( #8284 )
2022-07-12 12:30:19 -07:00
Jelle Zijlstra
2a1b33df9f
os: Params for posix_fallocate and posix_fadvise are pos-only ( #8283 )
...
90a6e56e56/Modules/posixmodule.c (L10845)
2022-07-12 12:19:41 -07:00
Alex Waygood
edc0ecd857
Remove Python 3.6 branches from typeshed ( #8269 )
2022-07-11 10:55:17 +02:00
Alex Waygood
8b3b6bf7cd
stdlib: Audit Callable[<parameters>, None] annotations ( #8187 )
2022-06-27 08:08:28 +02:00
Alex Waygood
ceccc655db
Introduce _typeshed.GenericPath and _typeshed.AnyStr_co ( #7970 )
2022-05-27 19:02:00 +01:00
Jelle Zijlstra
963b8aa2f7
add os.login_tty for 3.11 ( #7800 )
...
python/cpython#29658
2022-05-06 22:54:58 -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
414f324083
Add missing __match_args__ attributes to several unix-only structseq classes ( #7587 )
2022-04-04 21:33:49 +01:00
Alex Waygood
da3e69d093
stdlib: Improve a bunch of __(a)exit__ methods ( #7571 )
2022-04-01 08:05:25 +02:00
Alex Waygood
61b22db692
Add many missing __match_args__ attributes ( #7556 )
...
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com >
2022-03-26 19:36:28 +00:00
Alex Waygood
b63c963077
Use conditional overloads to simplify several stdlib functions ( #7540 )
2022-03-25 08:47:03 +01:00
Jelle Zijlstra
b7d129f727
PEP 604: Remove some more uses of Union/Optional ( #7515 )
...
The following patterns still break mypy:
1. `type[]` at top level fails
2. `tuple[T1, T2]` at top level fails (but `tuple[T1, ...]` is fine)
3. `T1 | Callable[..., T2 | T3]` fails, but only <=3.9
This PR cleans up usage of `Union` and `Optional` outside these patterns.
2022-03-19 08:23:00 -07: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
Alex Waygood
947724a5cb
stdlib: Add several missing @abstractmethod decorators ( #7443 )
2022-03-06 16:41:13 -08:00
Martin Fischer
182ddd9daf
stdlib: Add os.get_handle_inheritable & setter
2022-03-06 15:57:52 -08:00
Martin Fischer
352f5c3237
stdlib: Add os.copy_file_range(src, dst, count)
2022-03-06 15:57:52 -08:00
Martin Fischer
81a85f18b6
stdlib: Add os.pidfd_open(pid)
2022-03-06 15:57:52 -08:00
Shantanu
9796b9ed69
Improve open overloads when mode is a literal union ( #7428 )
...
As pointed out by @gvanrossum in https://github.com/python/typing/issues/1096
Improves type inference in cases when we know that mode is
OpenBinaryMode, but don't know anything more specific:
```
def my_open(name: str, write: bool):
mode: Literal['rb', 'wb'] = 'wb' if write else 'rb'
with open(name, mode) as f:
reveal_type(f) # previously typing.IO[Any], now typing.BinaryIO
```
You may be tempted into thinking this is some limitation of type
checkers. mypy does in fact have logic for detecting if we match
multiple overloads and union-ing up the return types of matched
overloads. The problem is the last overload interferes with this logic.
That is, if you remove the fallback overload (prior to this PR), you'd get
"Union[io.BufferedReader, io.BufferedWriter]" in the above example.
Co-authored-by: hauntsaninja <>
2022-03-06 15:45:34 -08:00
Alex Waygood
bc72b25a2a
Make more miscellaneous fields read-only, annotate _json.make_encoder ( #7439 )
2022-03-06 15:41:49 -08:00
Alex Waygood
d6ce3abd68
Add __all__ to most modules beginning with 'n', 'o' and 'p' ( #7345 )
2022-02-21 17:57:03 -08:00
Alex Waygood
26e8959279
Use _typeshed.Self in docutils.VersionInfo and os.sched_param ( #7117 )
2022-02-02 23:30:39 +01:00
Shantanu
b88a6f19cd
Upgrade black version ( #7089 )
2022-01-30 16:27:06 -08:00
Alex Waygood
dbcb38a605
Add more missing methods to os._Environ ( #6926 )
2022-01-16 06:45:11 -08:00