Commit Graph

20 Commits

Author SHA1 Message Date
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Aaron Kau
bf2049ef18 Change TemporaryFileWrapper.__exit__ return type to None (#7470)
For context we found this from quora/pyanalyze#496, which makes pyanalyze stricter about context managers that may swallow exceptions. tempfile._TemporaryFileWrapper.__exit__ returns whatever its underlying file returns (https://github.com/python/cpython/blob/3.6/Lib/tempfile.py#L502), and file objects don't tend to return anything from __exit__.
2022-03-09 19:34:24 -08: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
6a743348ca Add __all__ for most modules beginning with 't' (#7373) 2022-02-23 18:25:28 -08:00
Alex Waygood
b0f2bd68b0 Improve tempfile.SpooledTemporaryFile (#7196) 2022-02-13 17:41:54 -08:00
Shantanu
b88a6f19cd Upgrade black version (#7089) 2022-01-30 16:27:06 -08:00
Alex Waygood
a40d79a4e6 Use lowercase type everywhere (#6853) 2022-01-08 16:09:29 +01:00
Alex Waygood
8d5d2520ac Use PEP 585 syntax wherever possible (#6717) 2021-12-28 11:31:43 +01:00
Shantanu
c0675a797f tempfile: add ignore_cleanup_errors to TemporaryDirectory (#6226) 2021-11-02 20:25:58 -07:00
Akuli
994b69ef8f Use lowercase tuple where possible (#6170) 2021-10-14 17:18:19 -07:00
Akuli
ce11072dbe Big diff: use lower-case list and dict (#5888) 2021-08-08 09:26:35 -07:00
Akuli
ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Anton Grübel
39ede0242c add missing type hints for __class_getitem__ (#5869) 2021-08-07 16:12:53 +02:00
Anton Grübel
8a107464a8 Use _typeshed.Self with __enter__ (#5719) 2021-07-01 23:15:13 +02:00
Akuli
55a2a180c6 tempfile._TemporaryFileWrapper enhancements (#5519) 2021-05-25 15:30:08 +02:00
Jade
56ebf92463 Make _TemporaryFileWrapper generic on AnyStr, use it (#5456)
* Make _TemporaryFileWrapper generic on AnyStr, use it

Previously it was not used on NamedTemoraryFile and thus the file
field was missing from the types for the return value of
NamedTemoraryFile.
2021-05-17 19:04:40 +03:00
Eric Traut
f8e70d66e8 Improved overloads for mkstemp and mktemp functions in tempfile.pyi (#5133) 2021-03-23 17:07:46 -07:00
Edgar Handal
45c916e8d2 Type fixes for tempfile.TemporaryDirectory (#5121)
If no arguments are passed to the TemporaryDirectory constructor, then
the class defaults to using str. Overload the __init__ function to
cover this case.
2021-03-22 18:30:22 -07:00
Eric Traut
e4005505b9 Fixed incompatible use of constrained TypeVar in tempfile. (#5043)
The TypeVar `_T` was being used as a type argument for `PathLike`, but `PathLike` requires that its type argument be constrained to `str` or `bytes`, and `_T` didn't provide any such constraint. The easy workaround is to use the TypeVar `AnyStr` instead.

Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-02-20 13:11:36 -08:00
Ivan Levkivskyi
16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00