Files
typeshed/third_party
Ran Benita 4f396f8130 Improve the pytz stubs (#2475)
Based on the pytz docs http://pytz.sourceforge.net/ and code (version
2018.5).

- Accurately model the return value of the `timezone()` function. This
  necessitates modeling the internal pytz class hierarchy which is quite
  inconsistent.

- Expose `_BaseTzInfo` as `BaseTzInfo`.

  This change is useful because this type is importable and otherwise
  there is no pytz type which can be used in type annotations, e.g. in a
  function which takes a pytz `tzinfo` with the `localize` method,
  rather than a general `datetime.tzinfo`.

- Remove the lazy.pyi stubs. The `lazy` module contains some unrelated
  general data structures. It is not a public API - it is not documented
  and the types are not included in `__all__`.

- Remove methods which are already specified by inheritance in
  `datetime.tzinfo`.

- Add several public exception classes.

- Fill in the generic type parameters of the exposed `Dict`/`List`
  constants. Also change `Dict` -> `Mapping` because it is not actually
  a proper `dict`.

- Some style/ordering improvements.
2018-09-26 07:11:24 -07:00
..
2018-09-26 07:11:24 -07:00