Skip to content

Add initial changelog for 1.16 #18652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,48 @@

## Next Release

...
### Different Property Getter and Setter Types

Mypy now supports using different types for property getter and setter.
```python
class A:
value: int

@property
def f(self) -> int:
return self.value
@f.setter
def f(self, x: str | int) -> None:
try:
self.value = int(x)
except ValueError:
raise Exception(f"'{x}' is not a valid value for 'f'")
```

Contributed by Ivan Levkivskyi (PR [18510](https://github.com/python/mypy/pull/18510))

### Selectively Disable Deprecated Warnings

It's now possible to selectively disable warnings generated from
[`warnings.deprecated`](https://docs.python.org/3/library/warnings.html#warnings.deprecated)
using the [`--deprecated-calls-exclude`](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-deprecated-calls-exclude)
option.

```python
# mypy --enable-error-code deprecated
# --deprecated-calls-exclude=foo.A
import foo

foo.A().func() # OK, the deprecated warning is ignored

# file foo.py
from typing_extensions import deprecated
class A:
@deprecated("Use A.func2 instead")
def func(self): pass
```

Contributed by Marc Mueller (PR [18641](https://github.com/python/mypy/pull/18641))

## Mypy 1.15

Expand Down