diff --git a/python/pluginResources/messages/PyBundle.properties b/python/pluginResources/messages/PyBundle.properties
index 8e24045d31b7..1824b550ea30 100644
--- a/python/pluginResources/messages/PyBundle.properties
+++ b/python/pluginResources/messages/PyBundle.properties
@@ -164,13 +164,13 @@ python.run.anything.pip.provider=Run pip command
python.run.anything.conda.provider=Run conda command
python.testing.target.not.provided=The target is not provided
-python.testing.provide.qualified.name=Provide a qualified name of a function, class or module
-python.testing.pattern.can.only.be.used=Pattern can only be used to match files in a folder. Can't use pattern for a file.
+python.testing.provide.qualified.name=Provide a qualified name of a function, class, or module
+python.testing.pattern.can.only.be.used=Pattern can only be used to match files in a folder. Can't use a pattern for a file.
python.testing.cant.resolve=Can''t resolve {0}. Try to remove the configuration and generate it again
python.testing.cant.find.where.declared=Can''t find file where {0} declared. Make sure it is in the project root
-python.testing.cant.get.importable.name=Can''t get an importable name for {0}. Is it a Python file in project?
+python.testing.cant.get.importable.name=Can''t get an importable name for {0}. Is it a Python file in the project?
-runcfg.tests.cant_rerun=Can't rerun tests since test IDs can't be resolved. Try to delete run configuration, then right-click to create a new one.
+runcfg.tests.cant_rerun=Can't rerun tests since test IDs can't be resolved. Try to delete the run configuration, then right-click to create a new one.
runcfg.tests.empty_suite=Empty suite
### doctest run conf
@@ -450,11 +450,11 @@ python.sdk.common.options.environment=Environment
python.sdk.rendering.project.default=Project Default
python.sdk.rendering.project.default.0=Project Default ({0})
python.sdk.installation.notification.group=Python interpreter installation
-python.sdk.installation.balloon.error.message=Python installation interrupted
Download Python manually from python.org, install it and configure the project interpreter.
+python.sdk.installation.balloon.error.message=Python installation interrupted
Download Python manually from python.org, install it, and configure the project interpreter.
python.sdk.installation.balloon.error.action=See the documentation
python.sdk.python.executable.not.found=Python executable {0} is missing
python.sdk.failed.to.create.interpreter.title=Failed to create interpreter
-python.sdk.can.t.obtain.python.version=Can't obtain python version
+python.sdk.can.t.obtain.python.version=Cannot obtain python version
python.sdk.empty.version.string=Python interpreter returned the empty output as a version string
python.sdk.non.zero.exit.code=Python interpreter process exited with a non-zero exit code {0}
python.sdk.executable.not.found.header=Python executable is not found. Choose one of the following options:
@@ -483,7 +483,7 @@ sdk.gen.updating.interpreter=Updating Python interpreter
sdk.scanning.installed.packages=Scanning Installed Packages
sdk.gen.stubs.for.binary.modules=Generate stubs for binary module {0}
sdk.gen.failed.notification.title=Couldn't refresh skeletons for remote interpreter
-sdk.gen.cannot.create.skeleton.dir=Can''t create skeleton dir {0}
+sdk.gen.cannot.create.skeleton.dir=Cannot create skeleton dir {0}
sdk.updating.interpreter.paths=Updating interpreter paths\u2026
sdk.updating.interpreter.version=Updating interpreter version\u2026
@@ -798,7 +798,7 @@ debugger.exception.breakpoint.activation.policy=Activation policy
debugger.exception.breakpoint.any.exception=Any exception
debugger.line.breakpoint.type=Python Line Breakpoint
debugger.delete.signature.cache=Delete Cache
-debugger.simplified.view.description=Disables watching classes, functions and modules objects
+debugger.simplified.view.description=Disables watching classes, functions, and modules objects
debugger.simplified.view.text=Simplified Variables View
debugger.data.view.colored=Colored
debugger.data.view.close.selected.viewer=Close selected viewer
@@ -832,7 +832,7 @@ debugger.variables.loading.on.demand.text=On demand
debugger.variables.loading.on.demand.description=Load variable values on demand
debugger.variables.view.loading.timed.out=Loading timed out
debugger.variables.view.switch.to.loading.on.demand=Switch to loading on demand
-debugger.variables.view.warning.message=The values of several variables couldn't be loaded
+debugger.variables.view.warning.message=The values of several variables couldn't be loaded
debugger.variables.view.quoting.policy=Variables Quoting
debugger.variables.view.quoting.single.text=Single quotes
debugger.variables.view.quoting.single.description=Enclose values in single quotes
@@ -852,7 +852,7 @@ debugger.stack.frame.frame.not.available=
debugger.stack.frame.unable.to.display.frame.variables=Unable to display frame variables
debugger.stack.frames.not.available.in.non.suspended.state=Frames not available in non-suspended state
debugger.test.failed.caption=Test failed
-debugger.error.in.test.setup.or.teardown.caption=Error in test set up or tear down
+debugger.error.in.test.setup.or.teardown.caption=Error in test setup or teardown
debugger.remote.port.out.of.boundaries=The port number is out of boundaries
debugger.dataViewer.action.export.name=Export\u2026
@@ -929,7 +929,7 @@ pydev.console.console.process.terminated.with.exit.code=Console process terminat
pydev.console.couldnt.connect.to.console.process=Couldn't connect to console process.
pydev.console.debugger.connected=\nDebugger connected.\n
pydev.console.couldnt.read.integer.value.from.stream=Couldn't read an integer value from stream
-pydev.console.python.interpreter.is.not.selected=Python interpreter is not selected. Please setup Python interpreter first.
+pydev.console.python.interpreter.is.not.selected=Python interpreter is not selected. Please set up Python interpreter first.
external.documentation.python.plugin=Python External Documentation
external.documentation.pycharm=External Documentation
@@ -1008,7 +1008,7 @@ python.packaging.dialog.description.attempt.to.uninstall.for.one.dependent.packa
# Do you want to proceed?
python.packaging.dialog.description.attempt.to.uninstall.for.several.dependent.packages.single.package.description={0} -> {1}
python.packaging.dialog.description.attempt.to.uninstall.for.several.dependent.packages=\
- You are attempting to uninstall packages which are required for another packages.\n\n\
+ You are attempting to uninstall packages which are required for other packages.\n\n\
{0}\n\n\
Do you want to proceed?
@@ -1054,7 +1054,7 @@ form.integrated.tools.package.requirements.file.invalid.path=Invalid package req
form.integrated.tools.path.to.pipenv.executable=Path to Pipenv executable:
form.integrated.tools.render.external.documentation.for.stdlib=Render external documentation for stdlib
form.integrated.tools.sphinx.working.directory=Sphinx working directory:
-form.integrated.tools.treat.txt.files.as.restructuredtext=Treat *.txt files as reStructuredText
+form.integrated.tools.treat.txt.files.as.restructuredtext=Treat *.txt files as reStructuredText
form.console.options.always.show.debug.console=Always show Debug Console
form.console.options.settings.title.system.settings=General settings
form.console.options.show.console.variables.by.default=Show console variables by default
@@ -1250,7 +1250,7 @@ python.long.string.literals=Long string literals
python.long.collection.literals=Long collection literals
python.sequential.comments=Sequential comments
python.type.annotations=Type annotations
-python.type.annotations.hint=When unchecked, type annotations remain expanded on first "Collapse All" action.
+python.type.annotations.hint=When unchecked, type annotations remain expanded on first "Collapse All" action
python.provide.a.qualified.name.of.a.module=Provide a qualified name of a module
python.input.file.doesn.t.exist=Input file doesn't exist
python.call.graph=Call Graph
@@ -1439,7 +1439,7 @@ python.toolwindow.packages.add.package.path.selector=Select File Or Directory
python.toolwindow.packages.add.package.dialog.title=Install Package
python.toolwindow.packages.load.more={0} items. Filter or double-click to show.
python.toolwindow.packages.converting.description.progress=Reading package description
-python.toolwindow.packages.documentation.local.interpreter=PyCharm need at least one local interpreter to display package documentation.
+python.toolwindow.packages.documentation.local.interpreter=PyCharm needs at least one local interpreter to display package documentation
python.toolwindow.packages.sdk.label.html={0} ({1})
python.packages.dictionary.name=Python Packages Dictionary
@@ -1479,8 +1479,8 @@ python.interpreters.rename.interpreter.action.text=Rename
python.interpreters.show.interpreter.paths.text=Show Interpreter Paths
python.interpreters.rename.interpreter.dialog.message=New name:
python.interpreters.rename.interpreter.dialog.title=Rename Python Interpreter
-rename.python.interpreter.dialog.provide.name.error.text=Provide a name for Python interpreter.
-rename.python.interpreter.name.already.exists.error.text=Python interpreter with the same name already exists.
+rename.python.interpreter.dialog.provide.name.error.text=Provide a name for a Python interpreter
+rename.python.interpreter.name.already.exists.error.text=Python interpreter with the same name already exists
pandas.completion.type.text=DataFrame: {0}
dict.completion.type.text=dict key
@@ -1591,7 +1591,7 @@ inlay.parameters.python.hints.blacklist.explanation=\
foo(\\<star\\>\\<star\\>kwargs) - function foo with parameter **kwargs
\
\
Names or placeholders must be provided for all parameters, including the optional ones.
\
- Qualified method names must include class names, or placeholders for them.
\
+ Qualified method names must include class names or placeholders for them.
\
Use the "Do not show hints for current method" {0} action to add patterns from the editor.
# Requirements
@@ -1710,7 +1710,7 @@ python.project.model.progress.title.unlinking.projects.at=Unlinking {0} projects
python.project.model.progress.title.discovering.projects=Discovering {0} projects
project.error.install.python=Python could not be installed {0}. Try restarting PyCharm. If it does not help, install Python manually and try again.
-project.error.install.not.supported=Python is not installed and this target does not support installation. Please, install it manually.
+project.error.install.not.supported=Python is not installed, and this target does not support installation. Please install it manually.
project.error.all.pythons.bad=No usable Python installations were found on your system. Please install Python manually. Check logs for more info.
project.error.cant.venv=Could not create a virtual environment
@@ -1732,8 +1732,8 @@ uv.run.configuration.editor.field.uv.arguments=uv arguments:
uv.run.configuration.editor.field.check.sync=Warn about package synchronization before running
uv.run.configuration.validation.sdk=Please specify a valid uv sdk
-uv.run.configuration.validation.script=Please specify a valid python script to execute
-uv.run.configuration.validation.module=Please specify a valid python module to execute
+uv.run.configuration.validation.script=Please specify a valid Python script to execute
+uv.run.configuration.validation.module=Please specify a valid Python module to execute
command.name.add.package.to.conda.environments.yml=Add a package to conda environments.yml
command.name.add.package.to.requirements.txt=Add a package to requirements.txt
command.name.add.package.to.setup.py=Add a package to setup.py
@@ -1743,7 +1743,7 @@ python.uv.lockfile.out.of.sync=The lock file at `uv.lock` is out of sync
python.uv.update.lock=Update uv lock
pycharm.free.mode.upgrade.title=Upgrade to PyCharm Pro
-pycharm.free.mode.upgrade.body=Unlock the full potential of your IDE! Boost productivity,
work faster and be more efficient with powerful development tools.- Support for JavaScript, TypeScript, React and others
- Advances support for Django, Flask and FastAPI
- Remote development
- Local and remote full-scale Jupyter notebooks
+pycharm.free.mode.upgrade.body=Unlock the full potential of your IDE! Boost productivity,
work faster and be more efficient with powerful development tools.- Support for JavaScript, TypeScript, React, and others
- Advances support for Django, Flask, and FastAPI
- Remote development
- Local and remote full-scale Jupyter notebooks
pycharm.free.mode.upgrade.button=Purchase Subscription
python.packaging.sync.packages=Syncing project dependencies
python.sdk.read.only=Python SDK ''{0}'' is read-only and operation cannot be performed.
@@ -1783,7 +1783,7 @@ progress.title.checking.test.framework=Looking for an Installed Test Framework
python.sdk.broken.configuration=Unsupported configuration detected in the Python SDK {0}, please recreate it.
sdk.create.condaenv.suggestion=Create a conda environment using environment.yml
-sdk.remote.target.are.not.supported.for.conda.environment=Remote target are not supported for Conda environment
+sdk.remote.target.are.not.supported.for.conda.environment=Remote target is not supported for Conda environment
sdk.cannot.create.conda.environment.yml.not.found=Cannot create Conda environment, environment.yml does not exist
sdk.cannot.use.existing.conda.environment=Cannot use existing Conda environment
diff --git a/python/python-psi-impl/resources/messages/PyPsiBundle.properties b/python/python-psi-impl/resources/messages/PyPsiBundle.properties
index 1004708de7e2..6693d63e9601 100644
--- a/python/python-psi-impl/resources/messages/PyPsiBundle.properties
+++ b/python/python-psi-impl/resources/messages/PyPsiBundle.properties
@@ -136,7 +136,7 @@ ANN.name.used.both.as.global.and.param=Name ''{0}'' is used both as a parameter
ANN.assignment.to.keyword=Assignment to keyword
ANN.cannot.assign.to.debug=Cannot assign to __debug__
ANN.unparenthesized.assignment.expression.statement=Unparenthesized assignment expressions are prohibited at the top level of an expression statement
-ANN.unparenthesized.assignment.expression.value=Unparenthesized assignment expressions are prohibited at the top level of the right hand side of an assignment statement
+ANN.unparenthesized.assignment.expression.value=Unparenthesized assignment expressions are prohibited at the top level of the right-hand side of an assignment statement
ANN.assignment.expressions.within.a.comprehension.cannot.be.used.in.a.class.body=Assignment expressions within a comprehension cannot be used in a class body
ANN.assignment.expression.as.a.target=Assignment expression cannot be used as a target here
ANN.assignment.expression.in.an.iterable=Assignment expression cannot be used in a comprehension iterable
@@ -145,7 +145,7 @@ ANN.python.does.not.support.yield.from.inside.async.functions=Python does not su
ANN.yield.outside.of.function='yield' outside of function
ANN.non.empty.return.inside.asynchronous.generator=non-empty 'return' inside asynchronous generator
ANN.return.outside.of.function='return' outside of function
-ANN.can.t.use.starred.expression.here=Can't use starred expression here
+ANN.can.t.use.starred.expression.here=Cannot use starred expression here
ANN.illegal.target.for.variable.annotation=An illegal target for a variable annotation
ANN.variable.annotation.cannot.be.combined.with.tuple.unpacking=A variable annotation cannot be combined with tuple unpacking
ANN.variable.annotation.cannot.be.used.in.assignment.with.multiple.targets=A variable annotation cannot be used in assignment with multiple targets
@@ -376,7 +376,7 @@ QFIX.NAME.remove.dict.key=Remove this key
QFIX.NAME.move.except.up=Move except clause up
QFIX.NAME.add.field.to.class=Add field to class
QFIX.add.field.to.class=Add field ''{0}'' to class {1}
-QFIX.add.field.to.class.popup.content.added.init=Added a __init__ to class {0}
to accommodate new field {1}
+QFIX.add.field.to.class.popup.content.added.init=Added __init__ to class {0}
to accommodate new field {1}
QFIX.NAME.remove.parameter=Remove parameter
QFIX.NAME.remove.type.parameter=Remove type parameter
QFIX.NAME.rename.parameter=Rename parameter
@@ -1011,7 +1011,7 @@ INSP.dataclasses.argument.ignored.if.class.already.defines.method=''{0}'' is ign
INSP.dataclasses.order.argument.should.be.false.if.class.defines.one.of.order.methods='order' should be False if the class defines one of order methods
INSP.dataclasses.frozen.attribute.should.be.false.if.class.defines.setattr.or.delattr='frozen' should be False if the class defines '__setattr__' or '__delattr__'
INSP.dataclasses.unsafe.hash.attribute.should.be.false.if.class.defines.hash='unsafe_hash' should be False if the class defines '__hash__'
-INSP.dataclasses.frozen.dataclasses.can.not.inherit.non.frozen.one=Frozen dataclasses can not inherit non-frozen one and vice versa
+INSP.dataclasses.frozen.dataclasses.can.not.inherit.non.frozen.one=Frozen dataclasses cannot inherit non-frozen one and vice versa
INSP.dataclasses.method.is.ignored.if.class.already.defines.parameter=''{0}'' is ignored if the class already defines ''{1}'' parameter
INSP.dataclasses.hash.ignored.if.class.already.defines.cmp.or.order.or.frozen.parameters='__hash__' is ignored if the class already defines 'cmp/order' and 'frozen' parameters
INSP.dataclasses.mutable.attribute.default.not.allowed.use.default.factory=Mutable default ''{0}'' is not allowed. Use ''default_factory''
@@ -1047,21 +1047,21 @@ QFIX.dunder.slots.enabled.twice=Remove slots=True
INSP.NAME.final.classes.methods.and.variables=Invalid usages of final classes, methods, and variables
INSP.final.super.classes.are.marked.as.final.and.should.not.be.subclassed={0} {1,choice,1#is|2#are} marked as ''@final'' and should not be subclassed
INSP.final.method.marked.as.final.should.not.be.overridden=''{0}'' is marked as ''@final'' and should not be overridden
-INSP.final.final.could.not.be.mixed.with.abstract.decorators='Final' could not be mixed with abstract decorators
-INSP.final.final.class.could.not.contain.abstract.methods='Final' class could not contain abstract methods
-INSP.final.no.need.to.mark.method.in.final.class.as.final=No need to mark method in 'Final' class as '@final'
-INSP.final.non.method.function.could.not.be.marked.as.final=Non-method function could not be marked as '@final'
-INSP.final.final.could.not.be.used.in.annotations.for.function.parameters='Final' could not be used in annotations for function parameters
-INSP.final.final.could.not.be.used.in.annotation.for.function.return.value='Final' could not be used in annotation for a function return value
-INSP.final.if.assigned.value.omitted.there.should.be.explicit.type.argument.to.final=If assigned value is omitted, there should be an explicit type argument to 'Final'
+INSP.final.final.could.not.be.mixed.with.abstract.decorators='Final' cannot be mixed with abstract decorators
+INSP.final.final.class.could.not.contain.abstract.methods='Final' class cannot contain abstract methods
+INSP.final.no.need.to.mark.method.in.final.class.as.final=No need to mark a method in the 'Final' class as '@final'
+INSP.final.non.method.function.could.not.be.marked.as.final=Non-method function cannot be marked as '@final'
+INSP.final.final.could.not.be.used.in.annotations.for.function.parameters='Final' cannot be used in function parameter annotations
+INSP.final.final.could.not.be.used.in.annotation.for.function.return.value='Final' cannot be used in a function return type annotation
+INSP.final.if.assigned.value.omitted.there.should.be.explicit.type.argument.to.final=If the assigned value is omitted, an explicit type argument for 'Final' is required
INSP.final.final.name.should.be.initialized.with.value='Final' name should be initialized with a value
-INSP.final.already.declared.name.could.not.be.redefined.as.final=Already declared name could not be redefined as 'Final'
-INSP.final.either.instance.attribute.or.class.attribute.could.be.type.hinted.as.final=Either instance attribute or class attribute could be type hinted as 'Final'
-INSP.final.final.attribute.could.not.be.overridden=''{0}'' is ''Final'' and could not be overridden
-INSP.final.final.attribute.should.be.declared.in.class.body.or.init='Final' attribute should be declared in class body or '__init__'
-INSP.final.final.target.could.not.be.reassigned=''{0}'' is ''Final'' and could not be reassigned
-INSP.final.final.could.only.be.used.as.outermost.type='Final' could only be used as the outermost type
-INSP.final.final.could.not.be.used.inside.loop='Final' could not be used inside a loop
+INSP.final.already.declared.name.could.not.be.redefined.as.final=Already declared name cannot be redefined as 'Final'
+INSP.final.either.instance.attribute.or.class.attribute.could.be.type.hinted.as.final=Either instance attribute or class attribute can be type-hinted as 'Final'
+INSP.final.final.attribute.could.not.be.overridden=''{0}'' is ''Final'' and cannot be overridden
+INSP.final.final.attribute.should.be.declared.in.class.body.or.init='Final' attribute should be declared in the class body or '__init__'
+INSP.final.final.target.could.not.be.reassigned=''{0}'' is ''Final'' and cannot be reassigned
+INSP.final.final.could.only.be.used.as.outermost.type='Final' can only be used as the outermost type
+INSP.final.final.could.not.be.used.inside.loop='Final' cannot be used inside a loop
INSP.final.can.only.be.parameterized.with.one.type='Final' can only be parameterized with one type
# PyInconsistentIndentationInspection
@@ -1247,7 +1247,7 @@ INSP.type.hints.type.alias.must.be.immediately.initialized=Type alias must be im
INSP.type.hints.type.alias.must.be.top.level.declaration=Type alias must be top-level declaration
INSP.type.hints.type.alias.invalid.assigned.value=Assigned value of type alias must be a correct type
INSP.type.hints.type.alias.cannot.be.parameterized='TypeAlias' cannot be parameterized
-INSP.type.hints.type.hint.is.not.valid=Type hint is invalid or refers to the expression which is not a correct type
+INSP.type.hints.type.hint.is.not.valid=Invalid type annotation
INSP.type.hints.forward.reference.in.union=Union type annotations with forward references must be wrapped in quotes entirely
INSP.type.hints.circular.reference=Circular reference
INSP.type.hints.typeIs.has.zero.parameters=User-defined TypeGuard or TypeIs functions must have at least one parameter
diff --git a/python/testData/highlighting/invalidAssignmentExpressions.py b/python/testData/highlighting/invalidAssignmentExpressions.py
index 53339b9d0f32..6b3ab08020b3 100644
--- a/python/testData/highlighting/invalidAssignmentExpressions.py
+++ b/python/testData/highlighting/invalidAssignmentExpressions.py
@@ -1,7 +1,7 @@
y := f(x) # INVALID
(y := f(x)) # Valid, though not recommended
-y0 = y1 := f(x) # INVALID
+y0 = y1 := f(x) # INVALID
y0 = (y1 := f(x)) # Valid, though discouraged
class A:
diff --git a/python/testData/highlighting/starInGenerator.py b/python/testData/highlighting/starInGenerator.py
index 708541eaf698..b682b551845d 100644
--- a/python/testData/highlighting/starInGenerator.py
+++ b/python/testData/highlighting/starInGenerator.py
@@ -1 +1 @@
-y = (*() for _ in ())
\ No newline at end of file
+y = (*() for _ in ())
\ No newline at end of file
diff --git a/python/testData/highlighting/unpackingInNonParenthesizedTuplesInReturnAndYield.py b/python/testData/highlighting/unpackingInNonParenthesizedTuplesInReturnAndYield.py
index 179068349569..72bc8ac68d6a 100644
--- a/python/testData/highlighting/unpackingInNonParenthesizedTuplesInReturnAndYield.py
+++ b/python/testData/highlighting/unpackingInNonParenthesizedTuplesInReturnAndYield.py
@@ -1,4 +1,4 @@
def func(xs):
yield 42, *xs
- yield from 42, *xs
+ yield from 42, *xs
return 42, *xs
\ No newline at end of file
diff --git a/python/testData/highlighting/unpackingInNonParenthesizedTuplesInReturnAndYieldBefore38.py b/python/testData/highlighting/unpackingInNonParenthesizedTuplesInReturnAndYieldBefore38.py
index ecc3550daa9a..16e054f29f7f 100644
--- a/python/testData/highlighting/unpackingInNonParenthesizedTuplesInReturnAndYieldBefore38.py
+++ b/python/testData/highlighting/unpackingInNonParenthesizedTuplesInReturnAndYieldBefore38.py
@@ -1,4 +1,4 @@
def func(xs):
yield 42, *xs
- yield from 42, *xs
+ yield from 42, *xs
return 42, *xs
\ No newline at end of file
diff --git a/python/testData/highlighting/unpackingStar.py b/python/testData/highlighting/unpackingStar.py
index 9128341647e9..a5dd7d8d799f 100644
--- a/python/testData/highlighting/unpackingStar.py
+++ b/python/testData/highlighting/unpackingStar.py
@@ -3,8 +3,8 @@
[1, *x]
{1, *x}
-if *x:
+if *x:
pass
-1 + (*x)
+1 + (*x)
1 + (*x,)
diff --git a/python/testData/inspections/PyCompatibilityInspection/starExpressionInIndexes.py b/python/testData/inspections/PyCompatibilityInspection/starExpressionInIndexes.py
index 27b5c28071dd..89d0be98c1e9 100644
--- a/python/testData/inspections/PyCompatibilityInspection/starExpressionInIndexes.py
+++ b/python/testData/inspections/PyCompatibilityInspection/starExpressionInIndexes.py
@@ -6,9 +6,9 @@ a[1, *x]
# Not supported
-a[(*x)]
-a[1:*x]
-a[*x:*x]
+a[(*x)]
+a[1:*x]
+a[*x:*x]
# Ok in Python 3
a[(*x,)]
diff --git a/python/testData/inspections/PyCompatibilityInspection/starExpressionInTypeAnnotation.py b/python/testData/inspections/PyCompatibilityInspection/starExpressionInTypeAnnotation.py
index 6016949b04c6..0933c56a1fa2 100644
--- a/python/testData/inspections/PyCompatibilityInspection/starExpressionInTypeAnnotation.py
+++ b/python/testData/inspections/PyCompatibilityInspection/starExpressionInTypeAnnotation.py
@@ -13,6 +13,6 @@ x: tup
x: tuple[int, *tuple[str, ...]]
# Error in Python 3.11
-def f(x: *b): pass
-def f8(**kwargs: *a): pass
-x: *b
\ No newline at end of file
+def f(x: *b): pass
+def f8(**kwargs: *a): pass
+x: *b
\ No newline at end of file
diff --git a/python/testData/inspections/PyCompatibilityInspection/unpackingInNonParenthesizedTuplesInReturnAndYield.py b/python/testData/inspections/PyCompatibilityInspection/unpackingInNonParenthesizedTuplesInReturnAndYield.py
index 50f890133d41..035ed5f2912a 100644
--- a/python/testData/inspections/PyCompatibilityInspection/unpackingInNonParenthesizedTuplesInReturnAndYield.py
+++ b/python/testData/inspections/PyCompatibilityInspection/unpackingInNonParenthesizedTuplesInReturnAndYield.py
@@ -1,6 +1,6 @@
def gen(xs):
yield 42, *xs
- yield from 42, *xs
+ yield from 42, *xs
def func(xs):
diff --git a/python/testData/inspections/PyDataclassInspection/FrozenInheritanceDataclassTransform/a.py b/python/testData/inspections/PyDataclassInspection/FrozenInheritanceDataclassTransform/a.py
index 969cbc8a3977..1c64651ececb 100644
--- a/python/testData/inspections/PyDataclassInspection/FrozenInheritanceDataclassTransform/a.py
+++ b/python/testData/inspections/PyDataclassInspection/FrozenInheritanceDataclassTransform/a.py
@@ -3,20 +3,20 @@ from decorator import my_dataclass, my_dataclass_frozen_default
@my_dataclass()
-class B1(BaseFrozenExplicit):
+class B1(BaseFrozenExplicit):
b: str = "2"
-@my_dataclass(frozen=True)
+@my_dataclass(frozen=True)
class B2(BaseNonFrozenImplicit):
b: str = "2"
@my_dataclass()
-class B1(BaseFrozenWithFrozenDefault):
+class B1(BaseFrozenWithFrozenDefault):
b: str = "2"
@my_dataclass_frozen_default()
-class B2(BaseNonFrozenImplicit):
+class B2(BaseNonFrozenImplicit):
b: str = "2"
diff --git a/python/testData/inspections/PyDataclassInspection/frozenInheritance.py b/python/testData/inspections/PyDataclassInspection/frozenInheritance.py
index 582e32b1c1ea..95d1ccd55c91 100644
--- a/python/testData/inspections/PyDataclassInspection/frozenInheritance.py
+++ b/python/testData/inspections/PyDataclassInspection/frozenInheritance.py
@@ -7,7 +7,7 @@ class A1:
a: int = 1
@dataclasses.dataclass
-class B1(A1):
+class B1(A1):
b: str = "2"
@@ -15,7 +15,7 @@ class frozen=True)
+@dataclasses.dataclass(frozen=True)
class B2(A2):
b: str = "2"
diff --git a/python/testData/inspections/PyDataclassInspection/frozenInheritanceDataclassTransformMetaclassNoDefault.py b/python/testData/inspections/PyDataclassInspection/frozenInheritanceDataclassTransformMetaclassNoDefault.py
index 2041338db485..f97ce18c8319 100644
--- a/python/testData/inspections/PyDataclassInspection/frozenInheritanceDataclassTransformMetaclassNoDefault.py
+++ b/python/testData/inspections/PyDataclassInspection/frozenInheritanceDataclassTransformMetaclassNoDefault.py
@@ -40,7 +40,7 @@ class Customer7(Customer3, frozen=False):
salary: float
# This should generate an error: trying to make frozen=False when parent is frozen=True
-class Customer8(Customer2, frozen=False): # E
+class Customer8(Customer2, frozen=False): # E
salary: float
# OK: Can mutate Customer3 because it's explicitly non-frozen
diff --git a/python/testData/inspections/PyFinalInspection/ImportedClassFinalOverriding/a.py b/python/testData/inspections/PyFinalInspection/ImportedClassFinalOverriding/a.py
index fa62b2da204d..a9c4ad138582 100644
--- a/python/testData/inspections/PyFinalInspection/ImportedClassFinalOverriding/a.py
+++ b/python/testData/inspections/PyFinalInspection/ImportedClassFinalOverriding/a.py
@@ -2,4 +2,4 @@ from typing_extensions import Final
from b import A
class B(A):
- a: Final[str] = "3"
+ a: Final[str] = "3"
diff --git a/python/testData/inspections/PyFinalInspection/ImportedClassFinalReassignment/a.py b/python/testData/inspections/PyFinalInspection/ImportedClassFinalReassignment/a.py
index fd060b61e280..b324178aad92 100644
--- a/python/testData/inspections/PyFinalInspection/ImportedClassFinalReassignment/a.py
+++ b/python/testData/inspections/PyFinalInspection/ImportedClassFinalReassignment/a.py
@@ -1,13 +1,13 @@
from b import A
-A.a = 4
+A.a = 4
class B(A):
@classmethod
def my_cls_method(cls):
- cls.a = 6
+ cls.a = 6
-B.a = 7
+B.a = 7
class C(A):
- a = 8
\ No newline at end of file
+ a = 8
\ No newline at end of file
diff --git a/python/testData/inspections/PyFinalInspection/ImportedInstanceFinalOverriding/a.py b/python/testData/inspections/PyFinalInspection/ImportedInstanceFinalOverriding/a.py
index 8d08c1fa465b..b229a1360610 100644
--- a/python/testData/inspections/PyFinalInspection/ImportedInstanceFinalOverriding/a.py
+++ b/python/testData/inspections/PyFinalInspection/ImportedInstanceFinalOverriding/a.py
@@ -4,10 +4,10 @@ from b import A
class B(A):
def __init__(self):
super().__init__()
- self.a: Final[str] = "2"
+ self.a: Final[str] = "2"
class C(A):
- a: Final[str]
+ a: Final[str]
def __init__(self):
super().__init__()
diff --git a/python/testData/inspections/PyFinalInspection/ImportedInstanceFinalReassignment/a.py b/python/testData/inspections/PyFinalInspection/ImportedInstanceFinalReassignment/a.py
index a8b406edbb41..995bd91c2168 100644
--- a/python/testData/inspections/PyFinalInspection/ImportedInstanceFinalReassignment/a.py
+++ b/python/testData/inspections/PyFinalInspection/ImportedInstanceFinalReassignment/a.py
@@ -1,14 +1,14 @@
from b import A, B
-A().a = 3
-B().b = 3
+A().a = 3
+B().b = 3
class C(B):
def __init__(self):
super().__init__()
- self.b = 4
+ self.b = 4
def my_method(self):
- self.b = 5
+ self.b = 5
-C().b = 6
\ No newline at end of file
+C().b = 6
\ No newline at end of file
diff --git a/python/testData/inspections/PyFinalInspection/ImportedModuleFinalReassignment/a.py b/python/testData/inspections/PyFinalInspection/ImportedModuleFinalReassignment/a.py
index a42037d336c3..9e9f987edac5 100644
--- a/python/testData/inspections/PyFinalInspection/ImportedModuleFinalReassignment/a.py
+++ b/python/testData/inspections/PyFinalInspection/ImportedModuleFinalReassignment/a.py
@@ -1,5 +1,5 @@
import b
-b.a = 2
+b.a = 2
from b import a
-a = 3
\ No newline at end of file
+a = 3
\ No newline at end of file
diff --git a/python/testData/inspections/PyFinalInspection/ImportedVariableFinalReassignment/a.py b/python/testData/inspections/PyFinalInspection/ImportedVariableFinalReassignment/a.py
index 40b55ba14cef..44706d91b44e 100644
--- a/python/testData/inspections/PyFinalInspection/ImportedVariableFinalReassignment/a.py
+++ b/python/testData/inspections/PyFinalInspection/ImportedVariableFinalReassignment/a.py
@@ -2,4 +2,4 @@ from b import *
print(BAR)
-BAR = 43
\ No newline at end of file
+BAR = 43
\ No newline at end of file
diff --git a/python/testData/inspections/PyFinalInspection/omittedAssignedValueInStubOnClassLevel.pyi b/python/testData/inspections/PyFinalInspection/omittedAssignedValueInStubOnClassLevel.pyi
index ae91d38296c2..674c7767f2fc 100644
--- a/python/testData/inspections/PyFinalInspection/omittedAssignedValueInStubOnClassLevel.pyi
+++ b/python/testData/inspections/PyFinalInspection/omittedAssignedValueInStubOnClassLevel.pyi
@@ -1,6 +1,6 @@
from typing_extensions import Final
class A:
- a: Final
+ a: Final
b: Final[int]
c: int
\ No newline at end of file
diff --git a/python/testData/inspections/PyFinalInspection/omittedAssignedValueInStubOnModuleLevel.pyi b/python/testData/inspections/PyFinalInspection/omittedAssignedValueInStubOnModuleLevel.pyi
index 1ddbcff53d19..e68ba268d075 100644
--- a/python/testData/inspections/PyFinalInspection/omittedAssignedValueInStubOnModuleLevel.pyi
+++ b/python/testData/inspections/PyFinalInspection/omittedAssignedValueInStubOnModuleLevel.pyi
@@ -1,7 +1,7 @@
from typing_extensions import Final
a: Final[int]
-b: Final
-b = "10"
+b: Final
+b = "10"
c: Final[str] = "10"
d: int
\ No newline at end of file
diff --git a/python/testData/inspections/PyTypeHintsInspection/ExplicitTypeAliasesMultiFile/a.py b/python/testData/inspections/PyTypeHintsInspection/ExplicitTypeAliasesMultiFile/a.py
index 1f5d12e59833..3211160443b9 100644
--- a/python/testData/inspections/PyTypeHintsInspection/ExplicitTypeAliasesMultiFile/a.py
+++ b/python/testData/inspections/PyTypeHintsInspection/ExplicitTypeAliasesMultiFile/a.py
@@ -1,18 +1,18 @@
from util import *
def bad_type_aliases(
- p1: BadTypeAlias1,
- p2: BadTypeAlias2,
- p3: BadTypeAlias3,
- p4: BadTypeAlias4,
- p5: BadTypeAlias5,
- p6: BadTypeAlias6,
- p7: BadTypeAlias7,
- p8: BadTypeAlias8,
- p9: BadTypeAlias9,
- p10: BadTypeAlias10,
- p11: BadTypeAlias11,
- p12: BadTypeAlias12,
+ p1: BadTypeAlias1,
+ p2: BadTypeAlias2,
+ p3: BadTypeAlias3,
+ p4: BadTypeAlias4,
+ p5: BadTypeAlias5,
+ p6: BadTypeAlias6,
+ p7: BadTypeAlias7,
+ p8: BadTypeAlias8,
+ p9: BadTypeAlias9,
+ p10: BadTypeAlias10,
+ p11: BadTypeAlias11,
+ p12: BadTypeAlias12,
): pass
def good_type_aliases(
diff --git a/python/testData/inspections/PyTypeHintsInspection/ImplicitTypeAliasesMultiFile/a.py b/python/testData/inspections/PyTypeHintsInspection/ImplicitTypeAliasesMultiFile/a.py
index 70e616cf3cbf..db3a8a063b99 100644
--- a/python/testData/inspections/PyTypeHintsInspection/ImplicitTypeAliasesMultiFile/a.py
+++ b/python/testData/inspections/PyTypeHintsInspection/ImplicitTypeAliasesMultiFile/a.py
@@ -1,20 +1,20 @@
from util import *
def bad_type_aliases(
- p1: BadTypeAlias1,
- p2: BadTypeAlias2,
- p3: BadTypeAlias3,
- p4: BadTypeAlias4,
- p5: BadTypeAlias5,
- p6: BadTypeAlias6,
- p7: BadTypeAlias7,
- p8: BadTypeAlias8,
- p9: BadTypeAlias9,
- p10: BadTypeAlias10,
- p11: BadTypeAlias11,
- p12: BadTypeAlias12,
- p13: BadTypeAlias13,
- p14: BadTypeAlias14,
+ p1: BadTypeAlias1,
+ p2: BadTypeAlias2,
+ p3: BadTypeAlias3,
+ p4: BadTypeAlias4,
+ p5: BadTypeAlias5,
+ p6: BadTypeAlias6,
+ p7: BadTypeAlias7,
+ p8: BadTypeAlias8,
+ p9: BadTypeAlias9,
+ p10: BadTypeAlias10,
+ p11: BadTypeAlias11,
+ p12: BadTypeAlias12,
+ p13: BadTypeAlias13,
+ p14: BadTypeAlias14,
): pass
def good_type_aliases(
diff --git a/python/testData/inspections/PyTypeHintsInspection/typeExprInvalidAnnotationsConformanceTestsSuite.py b/python/testData/inspections/PyTypeHintsInspection/typeExprInvalidAnnotationsConformanceTestsSuite.py
index 50bb54a107d5..ff2339a60a3f 100644
--- a/python/testData/inspections/PyTypeHintsInspection/typeExprInvalidAnnotationsConformanceTestsSuite.py
+++ b/python/testData/inspections/PyTypeHintsInspection/typeExprInvalidAnnotationsConformanceTestsSuite.py
@@ -3,19 +3,19 @@ import types
var1 = 3
def invalid_annotations(
- p1: eval("".join(map(chr, [105, 110, 116]))),
- p2: [int, str],
- p3: (int, str),
- p4: [int for i in range(1)],
- p5: {},
- p6: (lambda: int)(),
- p7: [int][0],
- p8: int if 1 < 3 else str,
- p9: var1,
- p10: True,
- p11: 1,
- p12: -1,
- p13: int or str,
- p14: f"int",
- p15: types,
+ p1: eval("".join(map(chr, [105, 110, 116]))),
+ p2: [int, str],
+ p3: (int, str),
+ p4: [int for i in range(1)],
+ p5: {},
+ p6: (lambda: int)(),
+ p7: [int][0],
+ p8: int if 1 < 3 else str,
+ p9: var1,
+ p10: True,
+ p11: 1,
+ p12: -1,
+ p13: int or str,
+ p14: f"int",
+ p15: types,
): ...
\ No newline at end of file
diff --git a/python/testSrc/com/jetbrains/python/inspections/PyFinalInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyFinalInspectionTest.java
index 1b491f077d8a..29a7e82a2ecc 100644
--- a/python/testSrc/com/jetbrains/python/inspections/PyFinalInspectionTest.java
+++ b/python/testSrc/com/jetbrains/python/inspections/PyFinalInspectionTest.java
@@ -166,7 +166,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
doTestByText("""
from typing_extensions import final
@final
- def foo():
+ def foo():
pass""");
}
@@ -179,7 +179,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
a: Final[int]
b: Final
- b = "10"
+ b = "10"
c: Final[str] = "10"
d: int
""")
@@ -194,7 +194,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
from typing_extensions import Final
class A:
- a: Final
+ a: Final
b: Final[int]
c: int
d: Final[int]
@@ -240,15 +240,15 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
() -> doTestByText("""
from typing_extensions import Final
- def foo(a: Final) -> None:
+ def foo(a: Final) -> None:
pass
- def bar(a, # type: Final[str]
+ def bar(a, # type: Final[str]
):
pass
def baz(a):
- # type: (Final[int]) -> None
+ # type: (Final[int]) -> None
pass""")
);
}
@@ -259,21 +259,21 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
from typing_extensions import Final, TypeAlias
a1: Final[int] = 10
- b1: List[Final[int]] = []
+ b1: List[Final[int]] = []
a2 = 10 # type: Final[int]
- b2 = [] # type: List[Final[int]]
+ b2 = [] # type: List[Final[int]]
a3: Final = 10
- b3: List[Final] = []
+ b3: List[Final] = []
a4 = 10 # type: Final
- b4 = [] # type: List[Final]
+ b4 = [] # type: List[Final]
- A1: TypeAlias = List[Final[int]]
- A2: TypeAlias = 'List[Final[int]]'
- A3 = List[Final[int]] # type: TypeAlias
- A4 = 'List[Final[int]]' # type: TypeAlias""");
+ A1: TypeAlias = List[Final[int]]
+ A2: TypeAlias = 'List[Final[int]]'
+ A3 = List[Final[int]] # type: TypeAlias
+ A4 = 'List[Final[int]]' # type: TypeAlias""");
}
// PY-34945
@@ -285,15 +285,15 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
a: Final[int] = 10
print(a)
- a: Final[str] = "10"
+ a: Final[str] = "10"
b = 10 # type: int
print(b)
- b = "10" # type: Final[str]
+ b = "10" # type: Final[str]
c: Final[int] = 10
print(c)
- c: str = "10\"""")
+ c: str = "10\"""")
);
}
@@ -307,15 +307,15 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
class A:
a: Final[int] = 10
print(a)
- a: Final[str] = "10"
+ a: Final[str] = "10"
b = 10 # type: int
print(b)
- b = "10" # type: Final[str]
+ b = "10" # type: Final[str]
c: Final[int] = 10
print(c)
- c: str = "10\"""")
+ c: str = "10\"""")
);
}
@@ -329,15 +329,15 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
def foo():
a: Final[int] = 10
print(a)
- a: Final[str] = "10"
+ a: Final[str] = "10"
b = 10 # type: int
print(b)
- b = "10" # type: Final[str]
+ b = "10" # type: Final[str]
c: Final[int] = 10
print(c)
- c: str = "10\"""")
+ c: str = "10\"""")
);
}
@@ -353,8 +353,8 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
self.a: Final[str] = "str"
def method(self):
- self.a: Final[int] = 10
- self.b: Final[int] = 10""")
+ self.a: Final[int] = 10
+ self.b: Final[int] = 10""")
);
}
@@ -369,12 +369,12 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
class A:
a: Final[int] = 1
b: Final[str] = "1"
- c: Final[int]
+ c: Final[int]
def __init__(self):
- self.a: Final[int] = 2
- self.b = "2"
- self.c: Final[int] = 2""")
+ self.a: Final[int] = 2
+ self.b = "2"
+ self.c: Final[int] = 2""")
);
}
@@ -386,13 +386,13 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
from typing_extensions import Final
a: Final[int] = 1
- a = 2
+ a = 2
b: Final[str] = "3"
- b += "4"
+ b += "4"
c: Final[int] = 5
- c += 6""")
+ c += 6""")
);
}
@@ -412,33 +412,33 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
a: Final[int] = 1
def __init__(self):
- self.a = 2
- self.a += 2
+ self.a = 2
+ self.a += 2
def method(self):
- self.a = 3
- self.a += 3
+ self.a = 3
+ self.a += 3
@classmethod
def cls_method(cls):
- cls.a = 5
- cls.a += 5
+ cls.a = 5
+ cls.a += 5
- A.a = 4
- A.a += 4
+ A.a = 4
+ A.a += 4
class B(A):
@classmethod
def my_cls_method(cls):
- cls.a = 6
- cls.a += 6
+ cls.a = 6
+ cls.a += 6
- B.a = 7
- B.a += 7
+ B.a = 7
+ B.a += 7
class C(A):
- a = 8
+ a = 8
""")
);
}
@@ -458,41 +458,41 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
class A:
def __init__(self):
self.a: Final[int] = 1
- self.a += 1
+ self.a += 1
def method(self):
- self.a = 2
- self.a = +2
+ self.a = 2
+ self.a = +2
- A().a = 3
- A().a = +3
+ A().a = 3
+ A().a = +3
class B:
b: Final[int]
def __init__(self):
self.b = 1
- self.b += 1
+ self.b += 1
def method(self):
- self.b = 2
- self.b += 2
+ self.b = 2
+ self.b += 2
- B().b = 3
- B().b += 3
+ B().b = 3
+ B().b += 3
class C(B):
def __init__(self):
super().__init__()
- self.b = 4
- self.b += 4
+ self.b = 4
+ self.b += 4
def my_method(self):
- self.b = 5
- self.b += 5
+ self.b = 5
+ self.b += 5
- C().b = 6
- C().b += 6""")
+ C().b = 6
+ C().b += 6""")
);
}
@@ -510,11 +510,11 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
def foo():
a: Final[int] = 1
- a = 2
+ a = 2
def bar():
b: Final[int] = 3
- b += 4""")
+ b += 4""")
);
}
@@ -531,7 +531,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
def inner():
nonlocal x
- x = [4, 5]
+ x = [4, 5]
inner()""")
);
@@ -549,7 +549,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
def foo():
global y
- y = [4, 5]
+ y = [4, 5]
""")
);
}
@@ -563,7 +563,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
from typing_extensions import Final
y: Final[List[int]] = [0, 1]
- y += [4, 5]
+ y += [4, 5]
""")
);
}
@@ -579,7 +579,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
a: Final[int] = 1
class B(A):
- a: Final[str] = "3"
+ a: Final[str] = "3"
""")
);
}
@@ -605,10 +605,10 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
class B(A):
def __init__(self):
super().__init__()
- self.a: Final[str] = "2"
+ self.a: Final[str] = "2"
class C(A):
- a: Final[str]
+ a: Final[str]
def __init__(self):
super().__init__()
@@ -630,16 +630,16 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
for i in undefined:
if undefined:
- x: Final[int] = 1
+ x: Final[int] = 1
while undefined:
- y: Final[str] = '1'
+ y: Final[str] = '1'
\s
def foo():
for i in undefined:
if undefined:
- x: Final[int] = 1
+ x: Final[int] = 1
while undefined:
- y: Final[str] = '1'""")
+ y: Final[str] = '1'""")
);
}
@@ -650,11 +650,11 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
() -> doTestByText("""
from typing_extensions import Final
- def foo1() -> Final[int]:
+ def foo1() -> Final[int]:
pass
def foo2():
- # type: () -> Final[int]
+ # type: () -> Final[int]
pass""")
);
}
@@ -666,9 +666,9 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
from abc import ABC, abstractmethod
@final
- class A(ABC):
+ class A(ABC):
@abstractmethod
- def method(self):
+ def method(self):
pass
\s
class B(ABC):
@@ -679,7 +679,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
class C(ABC):
@final
@abstractmethod
- def method(self):
+ def method(self):
pass""");
}
@@ -691,7 +691,7 @@ public class PyFinalInspectionTest extends PyInspectionTestCase {
@final
class A:
@final
- def method(self):
+ def method(self):
pass""");
}
diff --git a/python/testSrc/com/jetbrains/python/inspections/PyTypeHintsInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyTypeHintsInspectionTest.java
index da794dc072df..d2325b453778 100644
--- a/python/testSrc/com/jetbrains/python/inspections/PyTypeHintsInspectionTest.java
+++ b/python/testSrc/com/jetbrains/python/inspections/PyTypeHintsInspectionTest.java
@@ -944,14 +944,14 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
def __init__(self, v):
pass
- def a(b: A(int)):
+ def a(b: A(int)):
pass
def c(d):
# type: (A(int)) -> None
pass
- def e(f: A()):
+ def e(f: A()):
pass
def g(h):
@@ -962,7 +962,7 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
v2 = None # type: A(int)
U = A
- def i(j: U(int)):
+ def i(j: U(int)):
pass
\s
v3 = None # type: U(int)
@@ -1549,7 +1549,7 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
doTestByText("""
from typing import Self
- something: Self | None = None
+ something: Self | None = None
""");
}
@@ -2549,7 +2549,7 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
a1 = 3
a2 = a1
a3 = a2
- def foo(p: a3): ...
+ def foo(p: a3): ...
""");
}
@@ -2927,19 +2927,19 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
public void testInvalidTypeAliasStatement() {
doTestByText("""
var1 = 1
- type BadTypeAlias1 = eval("".join(map(chr, [105, 110, 116])))
- type BadTypeAlias2 = [int, str]
- type BadTypeAlias3 = ((int, str),)
- type BadTypeAlias4 = [int for i in range(1)]
- type BadTypeAlias5 = {"a": "b"}
- type BadTypeAlias6 = (lambda: int)()
- type BadTypeAlias7 = [int][0]
- type BadTypeAlias8 = int if 1 < 3 else str
- type BadTypeAlias9 = var1
- type BadTypeAlias10 = True
- type BadTypeAlias11 = 1
- type BadTypeAlias12 = list or set
- type BadTypeAlias13 = f"{'int'}"
+ type BadTypeAlias1 = eval("".join(map(chr, [105, 110, 116])))
+ type BadTypeAlias2 = [int, str]
+ type BadTypeAlias3 = ((int, str),)
+ type BadTypeAlias4 = [int for i in range(1)]
+ type BadTypeAlias5 = {"a": "b"}
+ type BadTypeAlias6 = (lambda: int)()
+ type BadTypeAlias7 = [int][0]
+ type BadTypeAlias8 = int if 1 < 3 else str
+ type BadTypeAlias9 = var1
+ type BadTypeAlias10 = True
+ type BadTypeAlias11 = 1
+ type BadTypeAlias12 = list or set
+ type BadTypeAlias13 = f"{'int'}"
""");
}
@@ -3014,14 +3014,14 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
// PY-76851
public void testSimpleRecursiveTypeAliasStatement() {
doTestByText("""
- type TypeAlias = TypeAlias
+ type TypeAlias = TypeAlias
""");
}
// PY-76851
public void testRecursiveTypeAliasStatementInUnion() {
doTestByText("""
- type TypeAlias = int | TypeAlias
+ type TypeAlias = int | TypeAlias
type TypeAlias2 = int | str
""");
}
@@ -3029,7 +3029,7 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
// PY-76851
public void testUnionRecursiveTypeAliasStatement() {
doTestByText("""
- type TypeAlias = TypeAlias | int
+ type TypeAlias = TypeAlias | int
""");
}
@@ -3037,9 +3037,9 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
// PY-76851
public void testDeepRecursiveTypeAliasStatement() {
doTestByText("""
- type TypeAlias1 = TypeAlias2
- type TypeAlias2 = TypeAlias3
- type TypeAlias3 = TypeAlias1
+ type TypeAlias1 = TypeAlias2
+ type TypeAlias2 = TypeAlias3
+ type TypeAlias3 = TypeAlias1
""");
}
@@ -3362,7 +3362,7 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
CARTESIAN = [Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST]
print(CARTESIAN[0])
- type Alias = [int, str]
+ type Alias = [int, str]
myAlias: TypeAlias = [int, str]
""");
}