Commit Graph

10 Commits

Author SHA1 Message Date
Alex Waygood
b093c90a94 Use TypeAlias for type aliases where possible, part II (#7667) 2022-04-20 20:02:47 +01:00
Alex Waygood
97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Jukka Lehtosalo
8a5d91ca37 Relax signature of logging.config.loadConfig (#6577)
I did a a cursory investigation using GitHub search and also looked at
a big internal codebase, and a significant fraction of callsites used
a dict type instead of a TypedDict or a dict literal.

It seems that it's a common use case to store the config within an
attribute. For example, something like this:

```
CONFIG = {
   ...
}

...
logging.config.dictConfig(CONFIG)
```

Another use case that was not properly supported is reading the
config from a file, and the config is given `dict[str, Any]` as
the type.

Mypy can still do some type checking of the argument if called
with a dict literal, so I feel this is a reasonable compromise
between type checking strictness and usability.
2021-12-13 07:31:15 -08:00
EXPLOSION
41591f2fcd Use TypedDicts for logging.config.dictConfig (#6193)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-10-27 10:48:51 +03:00
Akuli
ee487304d7 Big diff: Use new "|" union syntax (#5872) 2021-08-08 11:05:21 +02:00
Sebastian Rittau
f0bf6eebbd AnyStr cleanup (#5487)
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs.
* Add StrOrBytesPath as preferred alias for AnyPath.
* Replace all remaining AnyPath instances with StrOrBytesPath.
* Mark AnyPath as obsolete.

Part of #5470
2021-05-17 20:45:48 +02:00
spaghEddieDoyle
4c72f7f268 Add some missing logging features (#5388) 2021-05-11 10:52:40 +02:00
Sebastian Rittau
4ac3ccad45 black: enable skip_magic_trailing_comma (#5252)
* black: enable skip_magic_trailing_comma

* Remove spurious commas
2021-04-27 08:32:32 -07:00
Sebastian Rittau
0cea325bc7 Modernize logging (#5068) 2021-03-22 19:26:43 -07: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