Skip to content

Commit 5fef4d4

Browse files
authored
Use python.typing.org for typing documentation links (#17323)
## Summary There is a new official URL for the typing documentation: https://typing.python.org/ Change all https://typing.readthedocs.io/ links to use the new sub domain, which is slightly shorter and looks more official. ## Test Plan Tested to see if each and every new URL is accessible. I noticed that some links go to https://typing.python.org/en/latest/source/stubs.html which seems to be outdated, but that is a separate issue. The same page shows up for the old URL.
1 parent 144484d commit 5fef4d4

37 files changed

Lines changed: 57 additions & 57 deletions

crates/red_knot_python_semantic/resources/mdtest/annotations/callable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
References:
44

5-
- <https://typing.readthedocs.io/en/latest/spec/callables.html#callable>
5+
- <https://typing.python.org/en/latest/spec/callables.html#callable>
66

77
Note that `typing.Callable` is deprecated at runtime, in favour of `collections.abc.Callable` (see:
88
<https://docs.python.org/3/library/typing.html#deprecated-aliases>). However, removal of
@@ -299,4 +299,4 @@ def _(c: Callable[[int], int]):
299299
reveal_type(c.__call__) # revealed: Unknown
300300
```
301301

302-
[gradual form]: https://typing.readthedocs.io/en/latest/spec/glossary.html#term-gradual-form
302+
[gradual form]: https://typing.python.org/en/latest/spec/glossary.html#term-gradual-form

crates/red_knot_python_semantic/resources/mdtest/annotations/int_float_complex.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In order to support common use cases, an annotation of `float` actually means `int | float`, and an
44
annotation of `complex` actually means `int | float | complex`. See
5-
[the specification](https://typing.readthedocs.io/en/latest/spec/special-types.html#special-cases-for-float-and-complex)
5+
[the specification](https://typing.python.org/en/latest/spec/special-types.html#special-cases-for-float-and-complex)
66

77
## float
88

crates/red_knot_python_semantic/resources/mdtest/annotations/literal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Literal
22

3-
<https://typing.readthedocs.io/en/latest/spec/literal.html#literals>
3+
<https://typing.python.org/en/latest/spec/literal.html#literals>
44

55
## Parameterization
66

crates/red_knot_python_semantic/resources/mdtest/annotations/literal_string.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,4 @@ def f():
147147
reveal_type(x) # revealed: LiteralString
148148
```
149149

150-
[1]: https://typing.readthedocs.io/en/latest/spec/literal.html#literalstring
150+
[1]: https://typing.python.org/en/latest/spec/literal.html#literalstring

crates/red_knot_python_semantic/resources/mdtest/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,5 +1800,5 @@ Some of the tests in the *Class and instance variables* section draw inspiration
18001800

18011801
[descriptor protocol tests]: descriptor_protocol.md
18021802
[pyright's documentation]: https://microsoft.github.io/pyright/#/type-concepts-advanced?id=class-and-instance-variables
1803-
[typing spec on `classvar`]: https://typing.readthedocs.io/en/latest/spec/class-compat.html#classvar
1803+
[typing spec on `classvar`]: https://typing.python.org/en/latest/spec/class-compat.html#classvar
18041804
[`typing.classvar`]: https://docs.python.org/3/library/typing.html#typing.ClassVar

crates/red_knot_python_semantic/resources/mdtest/doc/public_type_undeclared_symbols.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ class Wrapper:
122122
reveal_type(Wrapper.value) # revealed: Unknown | None
123123
```
124124

125-
[gradual guarantee]: https://typing.readthedocs.io/en/latest/spec/concepts.html#the-gradual-guarantee
125+
[gradual guarantee]: https://typing.python.org/en/latest/spec/concepts.html#the-gradual-guarantee

crates/red_knot_python_semantic/resources/mdtest/generics/legacy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ from typing import TypeVar
6969
T = TypeVar("T", int)
7070
```
7171

72-
[generics]: https://typing.readthedocs.io/en/latest/spec/generics.html
72+
[generics]: https://typing.python.org/en/latest/spec/generics.html

crates/red_knot_python_semantic/resources/mdtest/generics/scoping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,4 +299,4 @@ class C[T]:
299299
ok2: Inner[T]
300300
```
301301

302-
[scoping]: https://typing.readthedocs.io/en/latest/spec/generics.html#scoping-rules-for-type-variables
302+
[scoping]: https://typing.python.org/en/latest/spec/generics.html#scoping-rules-for-type-variables

crates/red_knot_python_semantic/resources/mdtest/import/conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document describes the conventions for importing symbols.
44

55
Reference:
66

7-
- <https://typing.readthedocs.io/en/latest/spec/distributing.html#import-conventions>
7+
- <https://typing.python.org/en/latest/spec/distributing.html#import-conventions>
88

99
## Builtins scope
1010

crates/red_knot_python_semantic/resources/mdtest/suppressions/no_type_check.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> If a type checker supports the `no_type_check` decorator for functions, it should suppress all
44
> type errors for the def statement and its body including any nested functions or classes. It
55
> should also ignore all parameter and return type annotations and treat the function as if it were
6-
> unannotated. [source](https://typing.readthedocs.io/en/latest/spec/directives.html#no-type-check)
6+
> unannotated. [source](https://typing.python.org/en/latest/spec/directives.html#no-type-check)
77
88
## Error in the function body
99

@@ -95,7 +95,7 @@ def test() -> Undefined:
9595

9696
Red Knot does not support decorating classes with `no_type_check`. The behaviour of `no_type_check`
9797
when applied to classes is
98-
[not specified currently](https://typing.readthedocs.io/en/latest/spec/directives.html#no-type-check),
98+
[not specified currently](https://typing.python.org/en/latest/spec/directives.html#no-type-check),
9999
and is not supported by Pyright or mypy.
100100

101101
A future improvement might be to emit a diagnostic if a `no_type_check` annotation is applied to a

0 commit comments

Comments
 (0)