Skip to content

Commit 965d902

Browse files
authored
Merge pull request google#697 from google/python_styleguide
Project import generated by Copybara.
2 parents a5197ab + c2b992c commit 965d902

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

pyguide.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,11 @@ package twice.
272272

273273
Exemptions from this rule:
274274

275-
* Classes imported from the [`typing` module](#typing-imports).
276-
* Classes imported from the [`collections.abc` module](#typing-imports).
277-
* Classes imported from the
278-
[`typing_extensions` module](https://github.com/python/typing/tree/HEAD/typing_extensions).
275+
* Symbols from the following modules and used to support static analysis and
276+
type checking:
277+
* [`typing` module](#typing-imports)
278+
* [`collections.abc` module](#typing-imports)
279+
* [`typing_extensions` module](https://github.com/python/typing_extensions/blob/main/README.md)
279280
* Redirects from the
280281
[six.moves module](https://six.readthedocs.io/#module-six.moves).
281282

@@ -2543,9 +2544,10 @@ Imports should be on separate lines; there are
25432544
E.g.:
25442545
25452546
```python
2546-
Yes: import os
2547+
Yes: from collections.abc import Mapping, Sequence
2548+
import os
25472549
import sys
2548-
from typing import Mapping, Sequence
2550+
from typing import Any, NewType
25492551
```
25502552
25512553
```python
@@ -3171,6 +3173,8 @@ CapWorded. If the alias is used only in this module, it should be \_Private.
31713173
For example, if the name of the module together with the name of the type is too
31723174
long:
31733175
3176+
<!-- Annotate below with `typing.TypeAlias` for 3.10. -->
3177+
31743178
```python
31753179
_ShortName = module_with_long_name.TypeWithLongName
31763180
ComplexMap = Mapping[str, list[tuple[int, int]]]

0 commit comments

Comments
 (0)