Skip to content
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

Add regression test for #5770 #5846

Merged
merged 4 commits into from
Mar 13, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ Release date: TBA

Closes #5731

* Fixed a crash involving a ``NewType`` named with an f-string.

Closes #5770
Ref PyCQA/astroid#1400

* Improved ``bad-open-mode`` message when providing ``None`` to the ``mode``
argument of an ``open()`` call.

Expand Down
5 changes: 5 additions & 0 deletions doc/whatsnew/2.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ Other Changes

Closes #5731

* Fixed a crash involving a ``NewType`` named with an f-string.

Closes #5770
Ref PyCQA/astroid#1400

* Improved ``bad-open-mode`` message when providing ``None`` to the ``mode``
argument of an ``open()`` call.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Regression test for issue 5770: NewType created with f-string
See: https://github.com/PyCQA/pylint/issues/5770
"""
from typing import NewType

def make_new_type(suffix):
"""Dynamically create a NewType with `suffix`"""
new_type = NewType(f'IntRange_{suffix}', suffix)
print(new_type)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[MASTER]
load-plugins=pylint.extensions.redefined_variable_type,