Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JukkaL committed Jul 19, 2024
1 parent f5f6136 commit bd47ccf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Past mypy versions didn't check if untyped methods were compatible with overridd

For example, this now generates an error if using `--check-untyped-defs`:

```py
```python
class Base:
def f(self, x: int = 0) -> None: ...

Expand Down Expand Up @@ -99,19 +99,23 @@ This was also contributed by Ivan Levkivskyi (PR [17408](https://github.com/pyth

The details of how mypy checks if two `@overload` signatures are unsafely overlapping were overhauled. This both fixes some false positives, and allows mypy to detect additional unsafe signatures.

This feature was contribted by Ivan Levkivskyi (PR [17392](https://github.com/python/mypy/pull/17392)).
This feature was contributed by Ivan Levkivskyi (PR [17392](https://github.com/python/mypy/pull/17392)).


#### Better Support for Type Hints in Expressions

#### Allow Type Hints in Expressions
Mypy now allows more expressions that evaluate to valid type annotations in all expression contexts. The inferred types of these expressions are also sometimes more precise. Previously they were often `object`.

Mypy now allows all type expressions in all expressions, outside type annotations and other type contexts. For example, this no longer generates an error:
This example uses a union type that includes a callable type as an expression, and it no longer generates an error:

```python
from typing import Callable

print(Callable[[], int] | None) # No error
```

This feature was contributed by Jukka Lehtosalo (PR [17404](https://github.com/python/mypy/pull/17404)).


#### Mypyc Improvements

Expand Down

0 comments on commit bd47ccf

Please sign in to comment.