Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pylint for openSUSE:Factory checked in at 2023-05-16 14:16:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pylint (Old) and /work/SRC/openSUSE:Factory/.python-pylint.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pylint" Tue May 16 14:16:17 2023 rev:36 rq:1087260 version:2.17.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pylint/python-pylint.changes 2023-04-20 16:49:03.624503121 +0200 +++ /work/SRC/openSUSE:Factory/.python-pylint.new.1533/python-pylint.changes 2023-05-16 14:27:17.983698506 +0200 @@ -1,0 +2,43 @@ +Mon May 8 15:31:49 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 2.17.4: + * Fix a false positive for ``bad-dunder-name`` when there is a + user-defined ``__index__`` method. + * ``pyreverse``: added escaping of vertical bar character in + annotation labels + * produced by DOT printer to ensure it is not treated as field + separator of record-based nodes. + * Fixed a crash when generating a configuration file: + * ``tomlkit.exceptions.TOMLKitError: Can't add a table to a + dotted key`` caused by tomlkit ``v0.11.8``. + +------------------------------------------------------------------- +Mon May 8 13:57:50 UTC 2023 - Johannes Kastl <ka...@b1-systems.de> + +- add sle15_python_module_pythons + +------------------------------------------------------------------- +Thu May 4 19:37:21 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 2.17.3: + * Fix `unused-argument` false positive when `__new__` does not + use all the arguments of `__init__`. + * Fix ``unused-import`` false positive for usage of + ``six.with_metaclass``. + * `logging-not-lazy` is not longer emitted for explicitly + concatenated string arguments. + * Fix false positive for isinstance-second-argument-not-valid- + type when union types contains None. + * Fixed `unused-import` so that it observes the `dummy- + variables-rgx` option. + * `Union` typed variables without assignment are no longer + treated as `TypeAlias`. + * Fix false positive for ``positional-only-arguments-expected`` + when a function contains both a positional-only parameter + that has a default value, and ``**kwargs``. + * Fix false positive for ``keyword-arg-before-vararg`` when a + positional-only parameter with a default value precedes ``*args``. + * Improve output of ``consider-using-generator`` message for + ``min()` calls with ``default`` keyword. + +------------------------------------------------------------------- Old: ---- pylint-2.17.2-gh.tar.gz New: ---- pylint-2.17.4-gh.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pylint.spec ++++++ --- /var/tmp/diff_new_pack.3aMYqR/_old 2023-05-16 14:27:18.419700999 +0200 +++ /var/tmp/diff_new_pack.3aMYqR/_new 2023-05-16 14:27:18.423701022 +0200 @@ -16,9 +16,10 @@ # +%{?sle15_python_module_pythons} %bcond_without tests Name: python-pylint -Version: 2.17.2 +Version: 2.17.4 Release: 0 Summary: Syntax and style checker for Python code License: GPL-2.0-or-later @@ -35,7 +36,7 @@ Requires: python-dill >= 0.3.6 Requires: python-platformdirs >= 2.2 Requires: python-tomlkit >= 0.10.1 -Requires: (python-astroid >= 2.15.2 with python-astroid < 2.17.0~dev0) +Requires: (python-astroid >= 2.15.4 with python-astroid < 2.17.0~dev0) Requires: (python-isort >= 4.2.5 with python-isort < 6) Requires: (python-mccabe >= 0.6 with python-mccabe < 0.8) %if 0%{?python_version_nodots} < 311 @@ -46,7 +47,7 @@ %endif %if %{with tests} # SECTION pylint deps -BuildRequires: %{python_module astroid >= 2.15.2 with %python-astroid < 2.17.0~dev0} +BuildRequires: %{python_module astroid >= 2.15.4 with %python-astroid < 2.17.0~dev0} BuildRequires: %{python_module dill >= 0.3.6} BuildRequires: %{python_module isort >= 4.2.5 with %python-isort < 6} BuildRequires: %{python_module mccabe >= 0.6 with %python-mccabe < 0.8} @@ -105,7 +106,7 @@ %if %{with tests} %check export LC_ALL="en_US.UTF-8" -%pytest --benchmark-disable -k "not test_linter_with_unpickleable_plugins_is_pickleable" +%pytest %{?jobs:-n %jobs} --benchmark-disable -k "not test_linter_with_unpickleable_plugins_is_pickleable" %endif %post ++++++ pylint-2.17.2-gh.tar.gz -> pylint-2.17.4-gh.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/CONTRIBUTORS.txt new/pylint-2.17.4/CONTRIBUTORS.txt --- old/pylint-2.17.2/CONTRIBUTORS.txt 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/CONTRIBUTORS.txt 2023-05-06 17:20:29.000000000 +0200 @@ -130,10 +130,10 @@ - Eli Fine <ejf...@gmail.com> (eli88fine): Fixed false positive duplicate code warning for lines with symbols only - Andrew Haigh <nel...@gmail.com> (nelfin) - Ãmile Crater <em...@crater.logilab.fr> +- Yilei "Dolee" Yang <yileiy...@google.com> - Pavel Roskin <pro...@gnu.org> - David Gilman <davidgilm...@gmail.com> - ã¸ã¼ãã <hira9603859...@gmail.com> -- Yilei "Dolee" Yang <yileiy...@google.com> - Thomas Hisch <t.hi...@gmail.com> - Marianna Polatoglou <mpolatog...@bloomberg.net>: minor contribution for wildcard import check - Manuel Vázquez Acosta <mva....@gmail.com> @@ -206,6 +206,7 @@ - chohner <m...@chohner.com> - Tiago Honorato <61059243+tiagohonor...@users.noreply.github.com> - Steven M. Vascellaro <svascell...@gmail.com> +- Rogdham <cont...@rogdham.net> - Robin Tweedie <70587124+robin-wa...@users.noreply.github.com> - Roberto Leinardi <leina...@gmail.com>: PyCharm plugin maintainer - Ricardo Gemignani <ricardo.gemign...@gmail.com> @@ -254,7 +255,6 @@ - Scott Worley <scottwor...@scottworley.com> - Saugat Pachhai <suagatchhe...@outlook.com> - Rémi Cardona <remi.card...@polyconseil.fr> -- Rogdham <cont...@rogdham.net> - Raphael Gaschignard <raph...@makeleaps.com> - Ram Rachum <r...@rachum.com> (cool-RR) - Radostin Stoyanov <rst0...@users.noreply.github.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/doc/exts/pylint_options.py new/pylint-2.17.4/doc/exts/pylint_options.py --- old/pylint-2.17.2/doc/exts/pylint_options.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/doc/exts/pylint_options.py 2023-05-06 17:20:29.000000000 +0200 @@ -70,8 +70,10 @@ checker_string += get_rst_title(f"``{checker.capitalize()}`` **Checker**", "-") toml_doc = tomlkit.document() + tool_table = tomlkit.table(is_super_table=True) + toml_doc.add(tomlkit.key("tool"), tool_table) pylint_tool_table = tomlkit.table(is_super_table=True) - toml_doc.add(tomlkit.key(["tool", "pylint"]), pylint_tool_table) + tool_table.add(tomlkit.key("pylint"), pylint_tool_table) checker_table = tomlkit.table() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/doc/user_guide/configuration/all-options.rst new/pylint-2.17.4/doc/user_guide/configuration/all-options.rst --- old/pylint-2.17.2/doc/user_guide/configuration/all-options.rst 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/doc/user_guide/configuration/all-options.rst 2023-05-06 17:20:29.000000000 +0200 @@ -171,7 +171,7 @@ """""""""""" *Minimum Python version to use for version dependent checks. Will default to the version used to run pylint.* -**Default:** ``(3, 10)`` +**Default:** ``(3, 11)`` --recursive @@ -233,7 +233,7 @@ confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"] - disable = ["consider-using-augmented-assign"] + disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "consider-using-augmented-assign"] enable = [] @@ -271,7 +271,7 @@ persistent = true - py-version = [3, 10] + py-version = [3, 11] recursive = false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/doc/whatsnew/2/2.17/index.rst new/pylint-2.17.4/doc/whatsnew/2/2.17/index.rst --- old/pylint-2.17.2/doc/whatsnew/2/2.17/index.rst 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/doc/whatsnew/2/2.17/index.rst 2023-05-06 17:20:29.000000000 +0200 @@ -29,6 +29,95 @@ .. towncrier release notes start +What's new in Pylint 2.17.4? +---------------------------- +Release date: 2023-05-06 + + +False Positives Fixed +--------------------- + +- Fix a false positive for ``bad-dunder-name`` when there is a user-defined + ``__index__`` method. + + Closes #8613 (`#8613 <https://github.com/PyCQA/pylint/issues/8613>`_) + + + +Other Bug Fixes +--------------- + +- ``pyreverse``: added escaping of vertical bar character in annotation labels + produced by DOT printer to ensure it is not treated as field separator of + record-based nodes. + + Closes #8603 (`#8603 <https://github.com/PyCQA/pylint/issues/8603>`_) + +- Fixed a crash when generating a configuration file: + ``tomlkit.exceptions.TOMLKitError: Can't add a table to a dotted key`` + caused by tomlkit ``v0.11.8``. + + Closes #8632 (`#8632 <https://github.com/PyCQA/pylint/issues/8632>`_) + + +What's new in Pylint 2.17.3? +---------------------------- +Release date: 2023-04-24 + + +False Positives Fixed +--------------------- + +- Fix `unused-argument` false positive when `__new__` does not use all the + arguments of `__init__`. + + Closes #3670 (`#3670 <https://github.com/PyCQA/pylint/issues/3670>`_) + +- Fix ``unused-import`` false positive for usage of ``six.with_metaclass``. + + Closes #7506 (`#7506 <https://github.com/PyCQA/pylint/issues/7506>`_) + +- `logging-not-lazy` is not longer emitted for explicitly concatenated string + arguments. + + Closes #8410 (`#8410 <https://github.com/PyCQA/pylint/issues/8410>`_) + +- Fix false positive for isinstance-second-argument-not-valid-type when union + types contains None. + + Closes #8424 (`#8424 <https://github.com/PyCQA/pylint/issues/8424>`_) + +- Fixed `unused-import` so that it observes the `dummy-variables-rgx` option. + + Closes #8500 (`#8500 <https://github.com/PyCQA/pylint/issues/8500>`_) + +- `Union` typed variables without assignment are no longer treated as + `TypeAlias`. + + Closes #8540 (`#8540 <https://github.com/PyCQA/pylint/issues/8540>`_) + +- Fix false positive for ``positional-only-arguments-expected`` when a function + contains both a positional-only parameter that has a default value, and + ``**kwargs``. + + Closes #8555 (`#8555 <https://github.com/PyCQA/pylint/issues/8555>`_) + +- Fix false positive for ``keyword-arg-before-vararg`` when a positional-only + parameter with a default value precedes ``*args``. + + Closes #8570 (`#8570 <https://github.com/PyCQA/pylint/issues/8570>`_) + + + +Other Bug Fixes +--------------- + +- Improve output of ``consider-using-generator`` message for ``min()` calls + with ``default`` keyword. + + Closes #8563 (`#8563 <https://github.com/PyCQA/pylint/issues/8563>`_) + + What's new in Pylint 2.17.2? ---------------------------- Release date: 2023-04-03 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/doc/whatsnew/fragments/7506.false_positive new/pylint-2.17.4/doc/whatsnew/fragments/7506.false_positive --- old/pylint-2.17.2/doc/whatsnew/fragments/7506.false_positive 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/doc/whatsnew/fragments/7506.false_positive 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -Fix ``unused-import`` false positive for usage of ``six.with_metaclass``. - -Closes #7506 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/__pkginfo__.py new/pylint-2.17.4/pylint/__pkginfo__.py --- old/pylint-2.17.2/pylint/__pkginfo__.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/__pkginfo__.py 2023-05-06 17:20:29.000000000 +0200 @@ -9,7 +9,7 @@ from __future__ import annotations -__version__ = "2.17.2" +__version__ = "2.17.4" def get_numversion_from_version(v: str) -> tuple[int, int, int]: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/checkers/base/name_checker/checker.py new/pylint-2.17.4/pylint/checkers/base/name_checker/checker.py --- old/pylint-2.17.2/pylint/checkers/base/name_checker/checker.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/checkers/base/name_checker/checker.py 2023-05-06 17:20:29.000000000 +0200 @@ -602,10 +602,7 @@ # Union is a special case because it can be used as a type alias # or as a type annotation. We only want to check the former. assert node is not None - return not ( - isinstance(node.parent, nodes.AnnAssign) - and node.parent.value is not None - ) + return not isinstance(node.parent, nodes.AnnAssign) elif isinstance(inferred, nodes.FunctionDef): if inferred.qname() == "typing.TypeAlias": return True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/checkers/logging.py new/pylint-2.17.4/pylint/checkers/logging.py --- old/pylint-2.17.2/pylint/checkers/logging.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/checkers/logging.py 2023-05-06 17:20:29.000000000 +0200 @@ -246,7 +246,7 @@ if isinstance(format_arg, nodes.BinOp): binop = format_arg emit = binop.op == "%" - if binop.op == "+": + if binop.op == "+" and not self._is_node_explicit_str_concatenation(binop): total_number_of_strings = sum( 1 for operand in (binop.left, binop.right) @@ -294,6 +294,19 @@ """Return True if the operand in argument is a literal string.""" return isinstance(operand, nodes.Const) and operand.name == "str" + @staticmethod + def _is_node_explicit_str_concatenation(node: nodes.NodeNG) -> bool: + """Return True if the node represents an explicitly concatenated string.""" + if not isinstance(node, nodes.BinOp): + return False + return ( + LoggingChecker._is_operand_literal_str(node.left) + or LoggingChecker._is_node_explicit_str_concatenation(node.left) + ) and ( + LoggingChecker._is_operand_literal_str(node.right) + or LoggingChecker._is_node_explicit_str_concatenation(node.right) + ) + def _check_call_func(self, node: nodes.Call) -> None: """Checks that function call is not format_string.format().""" func = utils.safe_infer(node.func) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/checkers/method_args.py new/pylint-2.17.4/pylint/checkers/method_args.py --- old/pylint-2.17.2/pylint/checkers/method_args.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/checkers/method_args.py 2023-05-06 17:20:29.000000000 +0200 @@ -111,6 +111,8 @@ and inferred_func.args.posonlyargs ): return + if inferred_func.args.kwarg: + return pos_args = [a.name for a in inferred_func.args.posonlyargs] kws = [k.arg for k in node.keywords if k.arg in pos_args] if not kws: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/checkers/refactoring/refactoring_checker.py new/pylint-2.17.4/pylint/checkers/refactoring/refactoring_checker.py --- old/pylint-2.17.2/pylint/checkers/refactoring/refactoring_checker.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/checkers/refactoring/refactoring_checker.py 2023-05-06 17:20:29.000000000 +0200 @@ -1070,11 +1070,15 @@ and isinstance(node.func, nodes.Name) and node.func.name in checked_call ): - # functions in checked_calls take exactly one argument + # functions in checked_calls take exactly one positional argument # check whether the argument is list comprehension if len(node.args) == 1 and isinstance(node.args[0], nodes.ListComp): # remove square brackets '[]' inside_comp = node.args[0].as_string()[1:-1] + if node.keywords: + inside_comp = f"({inside_comp})" + inside_comp += ", " + inside_comp += ", ".join(kw.as_string() for kw in node.keywords) call_name = node.func.name if call_name in {"any", "all"}: self.add_message( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/checkers/typecheck.py new/pylint-2.17.4/pylint/checkers/typecheck.py --- old/pylint-2.17.2/pylint/checkers/typecheck.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/checkers/typecheck.py 2023-05-06 17:20:29.000000000 +0200 @@ -37,6 +37,7 @@ is_mapping, is_module_ignored, is_node_in_type_annotation_context, + is_none, is_overload_stub, is_postponed_evaluation_enabled, is_super, @@ -798,8 +799,9 @@ def _is_invalid_isinstance_type(arg: nodes.NodeNG) -> bool: # Return True if we are sure that arg is not a type if PY310_PLUS and isinstance(arg, nodes.BinOp) and arg.op == "|": - return _is_invalid_isinstance_type(arg.left) or _is_invalid_isinstance_type( - arg.right + return any( + _is_invalid_isinstance_type(elt) and not is_none(elt) + for elt in (arg.left, arg.right) ) inferred = utils.safe_infer(arg) if not inferred: @@ -812,9 +814,10 @@ if isinstance(inferred, astroid.Instance) and inferred.qname() == BUILTIN_TUPLE: return False if PY310_PLUS and isinstance(inferred, bases.UnionType): - return _is_invalid_isinstance_type( - inferred.left - ) or _is_invalid_isinstance_type(inferred.right) + return any( + _is_invalid_isinstance_type(elt) and not is_none(elt) + for elt in (inferred.left, inferred.right) + ) return True @@ -998,8 +1001,14 @@ @only_required_for_messages("keyword-arg-before-vararg") def visit_functiondef(self, node: nodes.FunctionDef) -> None: - # check for keyword arg before varargs + # check for keyword arg before varargs. + if node.args.vararg and node.args.defaults: + # When `positional-only` parameters are present then only + # `positional-or-keyword` parameters are checked. I.e: + # >>> def name(pos_only_params, /, pos_or_keyword_params, *args): ... + if node.args.posonlyargs and not node.args.args: + return self.add_message("keyword-arg-before-vararg", node=node, args=(node.name)) visit_asyncfunctiondef = visit_functiondef diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/checkers/variables.py new/pylint-2.17.4/pylint/checkers/variables.py --- old/pylint-2.17.2/pylint/checkers/variables.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/checkers/variables.py 2023-05-06 17:20:29.000000000 +0200 @@ -2602,6 +2602,16 @@ argnames = node.argnames() # Care about functions with unknown argument (builtins) if name in argnames: + if node.name == "__new__": + is_init_def = False + # Look for the `__init__` method in all the methods of the same class. + for n in node.parent.get_children(): + is_init_def = hasattr(n, "name") and (n.name == "__init__") + if is_init_def: + break + # Ignore unused arguments check for `__new__` if `__init__` is defined. + if is_init_def: + return self._check_unused_arguments(name, node, stmt, argnames, nonlocal_names) else: if stmt.parent and isinstance( @@ -3052,6 +3062,13 @@ imported_name in self._type_annotation_names or as_name in self._type_annotation_names ) + + is_dummy_import = ( + as_name + and self.linter.config.dummy_variables_rgx + and self.linter.config.dummy_variables_rgx.match(as_name) + ) + if isinstance(stmt, nodes.Import) or ( isinstance(stmt, nodes.ImportFrom) and not stmt.modname ): @@ -3062,12 +3079,11 @@ # because they can be imported for exporting. continue - if is_type_annotation_import: + if is_type_annotation_import or is_dummy_import: # Most likely a typing import if it wasn't used so far. + # Also filter dummy variables. continue - if as_name == "_": - continue if as_name is None: msg = f"import {imported_name}" else: @@ -3085,8 +3101,9 @@ # __future__ import in another module. continue - if is_type_annotation_import: + if is_type_annotation_import or is_dummy_import: # Most likely a typing import if it wasn't used so far. + # Also filter dummy variables. continue if imported_name == "*": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/config/arguments_manager.py new/pylint-2.17.4/pylint/config/arguments_manager.py --- old/pylint-2.17.2/pylint/config/arguments_manager.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/config/arguments_manager.py 2023-05-06 17:20:29.000000000 +0200 @@ -704,8 +704,11 @@ stdout. """ toml_doc = tomlkit.document() + tool_table = tomlkit.table(is_super_table=True) + toml_doc.add(tomlkit.key("tool"), tool_table) + pylint_tool_table = tomlkit.table(is_super_table=True) - toml_doc.add(tomlkit.key(["tool", "pylint"]), pylint_tool_table) + tool_table.add(tomlkit.key("pylint"), pylint_tool_table) for group in sorted( self._arg_parser._action_groups, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/constants.py new/pylint-2.17.4/pylint/constants.py --- old/pylint-2.17.2/pylint/constants.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/constants.py 2023-05-06 17:20:29.000000000 +0200 @@ -281,6 +281,7 @@ "__getnewargs_ex__", "__getnewargs__", "__getstate__", + "__index__", "__setstate__", "__reduce__", "__reduce_ex__", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pylint/pyreverse/dot_printer.py new/pylint-2.17.4/pylint/pyreverse/dot_printer.py --- old/pylint-2.17.2/pylint/pyreverse/dot_printer.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pylint/pyreverse/dot_printer.py 2023-05-06 17:20:29.000000000 +0200 @@ -121,11 +121,19 @@ ) label += rf"{method_name}({', '.join(args)})" if func.returns: - label += ": " + get_annotation_label(func.returns) + annotation_label = get_annotation_label(func.returns) + label += ": " + self._escape_annotation_label(annotation_label) label += rf"{HTMLLabels.LINEBREAK_LEFT.value}" label += "}" return label + def _escape_annotation_label(self, annotation_label: str) -> str: + # Escape vertical bar characters to make them appear as a literal characters + # otherwise it gets treated as field separator of record-based nodes + annotation_label = annotation_label.replace("|", r"\|") + + return annotation_label + def emit_edge( self, from_node: str, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/pyproject.toml new/pylint-2.17.4/pyproject.toml --- old/pylint-2.17.2/pyproject.toml 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/pyproject.toml 2023-05-06 17:20:29.000000000 +0200 @@ -39,7 +39,7 @@ # Also upgrade requirements_test_min.txt. # Pinned to dev of second minor update to allow editable installs and fix primer issues, # see https://github.com/pylint-dev/astroid/issues/1341 - "astroid>=2.15.2,<=2.17.0-dev0", + "astroid>=2.15.4,<=2.17.0-dev0", "isort>=4.2.5,<6", "mccabe>=0.6,<0.8", "tomli>=1.1.0;python_version<'3.11'", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/requirements_test_min.txt new/pylint-2.17.4/requirements_test_min.txt --- old/pylint-2.17.2/requirements_test_min.txt 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/requirements_test_min.txt 2023-05-06 17:20:29.000000000 +0200 @@ -1,6 +1,6 @@ -e .[testutils,spelling] # astroid dependency is also defined in pyproject.toml -astroid==2.15.2 # Pinned to a specific version for tests +astroid==2.15.4 # Pinned to a specific version for tests typing-extensions~=4.5 py~=1.11.0 pytest~=7.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tbump.toml new/pylint-2.17.4/tbump.toml --- old/pylint-2.17.2/tbump.toml 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tbump.toml 2023-05-06 17:20:29.000000000 +0200 @@ -1,7 +1,7 @@ github_url = "https://github.com/PyCQA/pylint" [version] -current = "2.17.2" +current = "2.17.4" regex = ''' ^(?P<major>0|[1-9]\d*) \. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/checkers/unittest_typecheck.py new/pylint-2.17.4/tests/checkers/unittest_typecheck.py --- old/pylint-2.17.2/tests/checkers/unittest_typecheck.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/checkers/unittest_typecheck.py 2023-05-06 17:20:29.000000000 +0200 @@ -10,7 +10,7 @@ from pylint.testutils import CheckerTestCase, MessageTest, set_config try: - from coverage import tracer as _ # pylint: disable=unused-import + from coverage import tracer as _ C_EXTENTIONS_AVAILABLE = True except ImportError: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/data/nullable_pattern.py new/pylint-2.17.4/tests/data/nullable_pattern.py --- old/pylint-2.17.2/tests/data/nullable_pattern.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.17.4/tests/data/nullable_pattern.py 2023-05-06 17:20:29.000000000 +0200 @@ -0,0 +1,10 @@ +""" docstring for file nullable_pattern.py """ +from typing import Optional + +class NullablePatterns: + def return_nullable_1(self) -> int | None: + """ Nullable return type using the | operator as mentioned in PEP 604, see https://peps.python.org/pep-0604 """ + pass + + def return_nullable_2(self) -> Optional[int]: + pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/c/consider/consider_using_generator.py new/pylint-2.17.4/tests/functional/c/consider/consider_using_generator.py --- old/pylint-2.17.2/tests/functional/c/consider/consider_using_generator.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/c/consider/consider_using_generator.py 2023-05-06 17:20:29.000000000 +0200 @@ -18,3 +18,8 @@ sum(x*x for x in range(10)) min(x*x for x in range(10)) max(x*x for x in range(10)) + +# Keyword arguments +# https://github.com/pylint-dev/pylint/issues/8563 +min([x*x for x in range(10)], default=42) # [consider-using-generator] +min((x*x for x in range(10)), default=42) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/c/consider/consider_using_generator.txt new/pylint-2.17.4/tests/functional/c/consider/consider_using_generator.txt --- old/pylint-2.17.2/tests/functional/c/consider/consider_using_generator.txt 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/c/consider/consider_using_generator.txt 2023-05-06 17:20:29.000000000 +0200 @@ -3,3 +3,4 @@ consider-using-generator:12:0:12:29::Consider using a generator instead 'sum(x * x for x in range(10))':UNDEFINED consider-using-generator:13:0:13:29::Consider using a generator instead 'min(x * x for x in range(10))':UNDEFINED consider-using-generator:14:0:14:29::Consider using a generator instead 'max(x * x for x in range(10))':UNDEFINED +consider-using-generator:24:0:24:41::Consider using a generator instead 'min((x * x for x in range(10)), default=42)':UNDEFINED diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/ext/bad_dunder/bad_dunder_name.py new/pylint-2.17.4/tests/functional/ext/bad_dunder/bad_dunder_name.py --- old/pylint-2.17.2/tests/functional/ext/bad_dunder/bad_dunder_name.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/ext/bad_dunder/bad_dunder_name.py 2023-05-06 17:20:29.000000000 +0200 @@ -49,6 +49,9 @@ def __doc__(self): return "Docstring" + def __index__(self): + return 1 + def __increase_me__(val): return val + 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/i/import_dummy.py new/pylint-2.17.4/tests/functional/i/import_dummy.py --- old/pylint-2.17.2/tests/functional/i/import_dummy.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.17.4/tests/functional/i/import_dummy.py 2023-05-06 17:20:29.000000000 +0200 @@ -0,0 +1,5 @@ +"""Testing importing module as dummy variable.""" +import gettext as _ +import sys as __ +import typing as ___dummy +from base64 import b64encode as ____dummy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/i/isinstance_second_argument_py310.py new/pylint-2.17.4/tests/functional/i/isinstance_second_argument_py310.py --- old/pylint-2.17.2/tests/functional/i/isinstance_second_argument_py310.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/i/isinstance_second_argument_py310.py 2023-05-06 17:20:29.000000000 +0200 @@ -1,13 +1,17 @@ -'''Tests for invalid isinstance with compound types''' +"""Tests for invalid isinstance with compound types""" # True negatives isinstance(0, int | str) isinstance(0, int | int | int) isinstance(0, int | str | list | float) isinstance(0, (int | str) | (list | float)) +isinstance(0, int | None) +isinstance(0, None | int) IntOrStr = int | str isinstance(0, IntOrStr) +IntOrNone = int | None +isinstance(0, IntOrNone) ListOrDict = list | dict isinstance(0, (float | ListOrDict) | IntOrStr) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/i/isinstance_second_argument_py310.txt new/pylint-2.17.4/tests/functional/i/isinstance_second_argument_py310.txt --- old/pylint-2.17.2/tests/functional/i/isinstance_second_argument_py310.txt 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/i/isinstance_second_argument_py310.txt 2023-05-06 17:20:29.000000000 +0200 @@ -1,3 +1,3 @@ -isinstance-second-argument-not-valid-type:15:0:15:22::Second argument of isinstance is not a type:INFERENCE -isinstance-second-argument-not-valid-type:16:0:16:28::Second argument of isinstance is not a type:INFERENCE -isinstance-second-argument-not-valid-type:18:0:18:24::Second argument of isinstance is not a type:INFERENCE +isinstance-second-argument-not-valid-type:19:0:19:22::Second argument of isinstance is not a type:INFERENCE +isinstance-second-argument-not-valid-type:20:0:20:28::Second argument of isinstance is not a type:INFERENCE +isinstance-second-argument-not-valid-type:22:0:22:24::Second argument of isinstance is not a type:INFERENCE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/k/keyword_arg_before_vararg_positional_only.py new/pylint-2.17.4/tests/functional/k/keyword_arg_before_vararg_positional_only.py --- old/pylint-2.17.2/tests/functional/k/keyword_arg_before_vararg_positional_only.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.17.4/tests/functional/k/keyword_arg_before_vararg_positional_only.py 2023-05-06 17:20:29.000000000 +0200 @@ -0,0 +1,13 @@ +"""Test `keyword-arg-before-vararg` in the context of positional-only parameters""" + +# pylint: disable=missing-function-docstring, unused-argument + + +def name1(param1, /, param2=True, *args): ... # [keyword-arg-before-vararg] +def name2(param1=True, /, param2=True, *args): ... # [keyword-arg-before-vararg] +def name3(param1, param2=True, /, param3=True, *args): ... # [keyword-arg-before-vararg] +def name4(param1, /, *args): ... +def name5(param1=True, /, *args): ... +def name6(param1, /, *args, param2=True): ... +def name7(param1=True, /, *args, param2=True): ... +def name8(param1, param2=True, /, *args, param3=True): ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/k/keyword_arg_before_vararg_positional_only.rc new/pylint-2.17.4/tests/functional/k/keyword_arg_before_vararg_positional_only.rc --- old/pylint-2.17.2/tests/functional/k/keyword_arg_before_vararg_positional_only.rc 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.17.4/tests/functional/k/keyword_arg_before_vararg_positional_only.rc 2023-05-06 17:20:29.000000000 +0200 @@ -0,0 +1,2 @@ +[testoptions] +min_pyver=3.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/k/keyword_arg_before_vararg_positional_only.txt new/pylint-2.17.4/tests/functional/k/keyword_arg_before_vararg_positional_only.txt --- old/pylint-2.17.2/tests/functional/k/keyword_arg_before_vararg_positional_only.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.17.4/tests/functional/k/keyword_arg_before_vararg_positional_only.txt 2023-05-06 17:20:29.000000000 +0200 @@ -0,0 +1,3 @@ +keyword-arg-before-vararg:6:0:6:9:name1:Keyword argument before variable positional arguments list in the definition of name1 function:UNDEFINED +keyword-arg-before-vararg:7:0:7:9:name2:Keyword argument before variable positional arguments list in the definition of name2 function:UNDEFINED +keyword-arg-before-vararg:8:0:8:9:name3:Keyword argument before variable positional arguments list in the definition of name3 function:UNDEFINED diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/l/logging/logging_not_lazy.py new/pylint-2.17.4/tests/functional/l/logging/logging_not_lazy.py --- old/pylint-2.17.2/tests/functional/l/logging/logging_not_lazy.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/l/logging/logging_not_lazy.py 2023-05-06 17:20:29.000000000 +0200 @@ -9,10 +9,10 @@ var_name = "Var:" # Statements that should be flagged: renamed_logging.warn("%s, %s" % (4, 5)) # [logging-not-lazy] +renamed_logging.warn("Var: " + var) # [logging-not-lazy] renamed_logging.exception("%s" % "Exceptional!") # [logging-not-lazy] renamed_logging.log(renamed_logging.INFO, "msg: %s" % "Run!") # [logging-not-lazy] renamed_logging.log(renamed_logging.INFO, "Var: " + var) # [logging-not-lazy] -renamed_logging.warn("%s" + " the rest of a single string") # [logging-not-lazy] renamed_logging.log(renamed_logging.INFO, var_name + var) # [logging-not-lazy] # Statements that should not be flagged: @@ -21,6 +21,11 @@ logging.warn("%s, %s" % (4, 5)) logging.log(logging.INFO, "msg: %s" % "Run!") logging.log("Var: " + var) +# Explicit string concatenations are fine: +renamed_logging.warn("%s" + " the rest of a single string") +renamed_logging.warn("Msg: " + "%s", "first piece " + "second piece") +renamed_logging.warn("first" + "second" + "third %s", "parameter") +renamed_logging.warn(("first" + "second" + "third %s")) # Regression crash test for incorrect format call renamed_logging.error( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/l/logging/logging_not_lazy.txt new/pylint-2.17.4/tests/functional/l/logging/logging_not_lazy.txt --- old/pylint-2.17.2/tests/functional/l/logging/logging_not_lazy.txt 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/l/logging/logging_not_lazy.txt 2023-05-06 17:20:29.000000000 +0200 @@ -1,8 +1,8 @@ logging-not-lazy:11:0:11:39::Use lazy % formatting in logging functions:UNDEFINED -logging-not-lazy:12:0:12:48::Use lazy % formatting in logging functions:UNDEFINED -logging-not-lazy:13:0:13:61::Use lazy % formatting in logging functions:UNDEFINED -logging-not-lazy:14:0:14:56::Use lazy % formatting in logging functions:UNDEFINED -logging-not-lazy:15:0:15:59::Use lazy % formatting in logging functions:UNDEFINED +logging-not-lazy:12:0:12:35::Use lazy % formatting in logging functions:UNDEFINED +logging-not-lazy:13:0:13:48::Use lazy % formatting in logging functions:UNDEFINED +logging-not-lazy:14:0:14:61::Use lazy % formatting in logging functions:UNDEFINED +logging-not-lazy:15:0:15:56::Use lazy % formatting in logging functions:UNDEFINED logging-not-lazy:16:0:16:57::Use lazy % formatting in logging functions:UNDEFINED -bad-format-string:27:4:27:27::Invalid format string:UNDEFINED -logging-format-interpolation:27:4:27:27::Use lazy % formatting in logging functions:UNDEFINED +bad-format-string:32:4:32:27::Invalid format string:UNDEFINED +logging-format-interpolation:32:4:32:27::Use lazy % formatting in logging functions:UNDEFINED diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/p/positional_only_arguments_expected.py new/pylint-2.17.4/tests/functional/p/positional_only_arguments_expected.py --- old/pylint-2.17.2/tests/functional/p/positional_only_arguments_expected.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/p/positional_only_arguments_expected.py 2023-05-06 17:20:29.000000000 +0200 @@ -16,3 +16,21 @@ cake.nihon(1, r=2, i=3) # [positional-only-arguments-expected] cake.nihon(a=1, r=2, i=3) # [positional-only-arguments-expected] cake.nihon(1, r=2, i=3, cheese=True) # [positional-only-arguments-expected] + + +def function_with_kwargs(apple, banana="Yellow banana", /, **kwargs): + """ + Calling this function with the `banana` keyword should not emit + `positional-only-arguments-expected` since it is added to `**kwargs`. + + >>> function_with_kwargs("Red apple", banana="Green banana") + >>> "Red apple" + >>> "Yellow banana" + >>> {"banana": "Green banana"} + """ + print(apple) + print(banana) + print(kwargs) + + +function_with_kwargs("Red apple", banana="Green banana") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/r/regression/regression_4439.py new/pylint-2.17.4/tests/functional/r/regression/regression_4439.py --- old/pylint-2.17.2/tests/functional/r/regression/regression_4439.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/r/regression/regression_4439.py 2023-05-06 17:20:29.000000000 +0200 @@ -7,7 +7,7 @@ from typing import Optional -from attr import attrib, attrs +from attr import attrib, attrs # pylint: disable=import-error @attrs() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/t/typealias_naming_style_default.py new/pylint-2.17.4/tests/functional/t/typealias_naming_style_default.py --- old/pylint-2.17.2/tests/functional/t/typealias_naming_style_default.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/t/typealias_naming_style_default.py 2023-05-06 17:20:29.000000000 +0200 @@ -26,5 +26,8 @@ ANOTHERBADNAME = Union[int, str] # [invalid-name] # Regression tests -# This is not a TypeAlias, and thus shouldn't flag the message +# They are not TypeAlias, and thus shouldn't flag the message x: Union[str, int] = 42 +y: Union[str, int] +# But the following, using a good TypeAlias name, is: +GoodTypeAliasToUnion: TypeAlias = Union[str, int] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/t/typealias_naming_style_rgx.py new/pylint-2.17.4/tests/functional/t/typealias_naming_style_rgx.py --- old/pylint-2.17.2/tests/functional/t/typealias_naming_style_rgx.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/t/typealias_naming_style_rgx.py 2023-05-06 17:20:29.000000000 +0200 @@ -3,8 +3,8 @@ # Valid TypeAliasShouldBeLikeThis: TypeAlias = int -_TypeAliasShouldBeLikeThis: Union[str, int] +_TypeAliasShouldBeLikeThis = Union[str, int] # Invalid TypeAliasShouldntBeLikeThis: TypeAlias = int # [invalid-name] -_TypeAliasShouldntBeLikeThis: Union[str, int] # [invalid-name] +_TypeAliasShouldntBeLikeThis = Union[str, int] # [invalid-name] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/u/unused/unused_argument.py new/pylint-2.17.4/tests/functional/u/unused/unused_argument.py --- old/pylint-2.17.2/tests/functional/u/unused/unused_argument.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/u/unused/unused_argument.py 2023-05-06 17:20:29.000000000 +0200 @@ -107,3 +107,24 @@ def set_thing(self, thing, *, other=None): """Subclass does not raise unused-argument""" self.thing = thing + + +# Test that Class with both `__init__` and `__new__` don't check +# on `__new__` for unused arguments + +# pylint: disable=invalid-name + +class TestClassWithInitAndNew: + def __init__(self, argA, argB): + self.argA = argA + self.argB = argB + + def __new__(cls, argA, argB): + return object.__new__(cls) + +# Test that `__new__` method is checked for unused arguments +# when `__init__` is not in the Class + +class TestClassWithOnlyNew: + def __new__(cls, argA, argB): # [unused-argument, unused-argument] + return object.__new__(cls) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/functional/u/unused/unused_argument.txt new/pylint-2.17.4/tests/functional/u/unused/unused_argument.txt --- old/pylint-2.17.2/tests/functional/u/unused/unused_argument.txt 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/functional/u/unused/unused_argument.txt 2023-05-06 17:20:29.000000000 +0200 @@ -7,3 +7,5 @@ unused-argument:73:0:None:None:AAAA.selected:Unused argument 'kwargs':INFERENCE unused-argument:92:23:92:26:BBBB.__init__:Unused argument 'arg':INFERENCE unused-argument:103:34:103:39:Ancestor.set_thing:Unused argument 'other':INFERENCE +unused-argument:129:21:129:25:TestClassWithOnlyNew.__new__:Unused argument 'argA':INFERENCE +unused-argument:129:27:129:31:TestClassWithOnlyNew.__new__:Unused argument 'argB':INFERENCE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.dot new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.dot --- old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.dot 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.dot 2023-05-06 17:20:29.000000000 +0200 @@ -7,6 +7,7 @@ "data.suppliermodule_test.DoNothing2" [color="black", fontcolor="black", label=<{DoNothing2|<br ALIGN="LEFT"/>|}>, shape="record", style="solid"]; "data.suppliermodule_test.DoSomething" [color="black", fontcolor="black", label=<{DoSomething|my_int : Optional[int]<br ALIGN="LEFT"/>my_int_2 : Optional[int]<br ALIGN="LEFT"/>my_string : str<br ALIGN="LEFT"/>|do_it(new_int: int): int<br ALIGN="LEFT"/>}>, shape="record", style="solid"]; "data.suppliermodule_test.Interface" [color="black", fontcolor="black", label=<{Interface|<br ALIGN="LEFT"/>|<I>get_value</I>()<br ALIGN="LEFT"/><I>set_value</I>(value)<br ALIGN="LEFT"/>}>, shape="record", style="solid"]; +"data.nullable_pattern.NullablePatterns" [color="black", fontcolor="black", label=<{NullablePatterns|<br ALIGN="LEFT"/>|<I>return_nullable_1</I>(): int \| None<br ALIGN="LEFT"/><I>return_nullable_2</I>(): Optional[int]<br ALIGN="LEFT"/>}>, shape="record", style="solid"]; "data.property_pattern.PropertyPatterns" [color="black", fontcolor="black", label=<{PropertyPatterns|prop1<br ALIGN="LEFT"/>prop2<br ALIGN="LEFT"/>|}>, shape="record", style="solid"]; "data.clientmodule_test.Specialization" [color="black", fontcolor="black", label=<{Specialization|TYPE : str<br ALIGN="LEFT"/>relation<br ALIGN="LEFT"/>relation2<br ALIGN="LEFT"/>top : str<br ALIGN="LEFT"/>|from_value(value: int)<br ALIGN="LEFT"/>increment_value(): None<br ALIGN="LEFT"/>transform_value(value: int): int<br ALIGN="LEFT"/>}>, shape="record", style="solid"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.html new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.html --- old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.html 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.html 2023-05-06 17:20:29.000000000 +0200 @@ -26,6 +26,10 @@ get_value()* set_value(value)* } + class NullablePatterns { + return_nullable_1()* int | None + return_nullable_2()* Optional[int] + } class PropertyPatterns { prop1 prop2 @@ -44,7 +48,7 @@ DoNothing --* Ancestor : cls_member DoNothing --* Specialization : relation DoNothing2 --o Specialization : relation2 - + </div> </body> </html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.mmd new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.mmd --- old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.mmd 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.mmd 2023-05-06 17:20:29.000000000 +0200 @@ -21,6 +21,10 @@ get_value()* set_value(value)* } + class NullablePatterns { + return_nullable_1()* int | None + return_nullable_2()* Optional[int] + } class PropertyPatterns { prop1 prop2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.puml new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.puml --- old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.puml 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.puml 2023-05-06 17:20:29.000000000 +0200 @@ -22,6 +22,10 @@ {abstract}get_value() {abstract}set_value(value) } +class "NullablePatterns" as data.nullable_pattern.NullablePatterns { + {abstract}return_nullable_1() -> int | None + {abstract}return_nullable_2() -> Optional[int] +} class "PropertyPatterns" as data.property_pattern.PropertyPatterns { prop1 prop2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.vcg new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.vcg --- old/pylint-2.17.2/tests/pyreverse/data/classes_No_Name.vcg 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/classes_No_Name.vcg 2023-05-06 17:20:29.000000000 +0200 @@ -6,50 +6,53 @@ manhattan_edges:yes node: {title:"data.clientmodule_test.Ancestor" label:"\fbAncestor\fn\n\f____________\n\f08attr : str\n\f08cls_member\n\f____________\n\f10get_value()\n\f10set_value()" shape:box -} + } node: {title:"data.suppliermodule_test.CustomException" label:"\fb 09CustomException\fn\n\f_________________" shape:box -} + } node: {title:"data.suppliermodule_test.DoNothing" label:"\fbDoNothing\fn\n\f___________" shape:box -} + } node: {title:"data.suppliermodule_test.DoNothing2" label:"\fbDoNothing2\fn\n\f____________" shape:box -} + } node: {title:"data.suppliermodule_test.DoSomething" label:"\fbDoSomething\fn\n\f__________________________\n\f08my_int : Optional[int]\n\f08my_int_2 : Optional[int]\n\f08my_string : str\n\f__________________________\n\f10do_it()" shape:box -} + } node: {title:"data.suppliermodule_test.Interface" label:"\fbInterface\fn\n\f___________\n\f10get_value()\n\f10set_value()" shape:box -} + } + node: {title:"data.nullable_pattern.NullablePatterns" label:"\fbNullablePatterns\fn\n\f___________________\n\f10return_nullable_1()\n\f10return_nullable_2()" + shape:box + } node: {title:"data.property_pattern.PropertyPatterns" label:"\fbPropertyPatterns\fn\n\f__________________\n\f08prop1\n\f08prop2\n\f__________________" shape:box -} + } node: {title:"data.clientmodule_test.Specialization" label:"\fbSpecialization\fn\n\f_________________\n\f08TYPE : str\n\f08relation\n\f08relation2\n\f08top : str\n\f_________________\n\f10from_value()\n\f10increment_value()\n\f10transform_value()" shape:box -} + } edge: {sourcename:"data.clientmodule_test.Specialization" targetname:"data.clientmodule_test.Ancestor" arrowstyle:solid backarrowstyle:none backarrowsize:10 -} + } edge: {sourcename:"data.clientmodule_test.Ancestor" targetname:"data.suppliermodule_test.Interface" arrowstyle:solid backarrowstyle:none linestyle:dotted backarrowsize:10 -} + } edge: {sourcename:"data.suppliermodule_test.DoNothing" targetname:"data.clientmodule_test.Ancestor" arrowstyle:solid backarrowstyle:none textcolor:green label:"cls_member" -} + } edge: {sourcename:"data.suppliermodule_test.DoNothing" targetname:"data.clientmodule_test.Specialization" arrowstyle:solid backarrowstyle:none textcolor:green label:"relation" -} + } edge: {sourcename:"data.suppliermodule_test.DoNothing2" targetname:"data.clientmodule_test.Specialization" arrowstyle:solid backarrowstyle:none textcolor:green label:"relation2" -} + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/classes_colorized.dot new/pylint-2.17.4/tests/pyreverse/data/classes_colorized.dot --- old/pylint-2.17.2/tests/pyreverse/data/classes_colorized.dot 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/classes_colorized.dot 2023-05-06 17:20:29.000000000 +0200 @@ -7,6 +7,7 @@ "data.suppliermodule_test.DoNothing2" [color="aliceblue", fontcolor="black", label=<{DoNothing2|<br ALIGN="LEFT"/>|}>, shape="record", style="filled"]; "data.suppliermodule_test.DoSomething" [color="aliceblue", fontcolor="black", label=<{DoSomething|my_int : Optional[int]<br ALIGN="LEFT"/>my_int_2 : Optional[int]<br ALIGN="LEFT"/>my_string : str<br ALIGN="LEFT"/>|do_it(new_int: int): int<br ALIGN="LEFT"/>}>, shape="record", style="filled"]; "data.suppliermodule_test.Interface" [color="aliceblue", fontcolor="black", label=<{Interface|<br ALIGN="LEFT"/>|<I>get_value</I>()<br ALIGN="LEFT"/><I>set_value</I>(value)<br ALIGN="LEFT"/>}>, shape="record", style="filled"]; +"data.nullable_pattern.NullablePatterns" [color="aliceblue", fontcolor="black", label=<{NullablePatterns|<br ALIGN="LEFT"/>|<I>return_nullable_1</I>(): int \| None<br ALIGN="LEFT"/><I>return_nullable_2</I>(): Optional[int]<br ALIGN="LEFT"/>}>, shape="record", style="filled"]; "data.property_pattern.PropertyPatterns" [color="aliceblue", fontcolor="black", label=<{PropertyPatterns|prop1<br ALIGN="LEFT"/>prop2<br ALIGN="LEFT"/>|}>, shape="record", style="filled"]; "data.clientmodule_test.Specialization" [color="aliceblue", fontcolor="black", label=<{Specialization|TYPE : str<br ALIGN="LEFT"/>relation<br ALIGN="LEFT"/>relation2<br ALIGN="LEFT"/>top : str<br ALIGN="LEFT"/>|from_value(value: int)<br ALIGN="LEFT"/>increment_value(): None<br ALIGN="LEFT"/>transform_value(value: int): int<br ALIGN="LEFT"/>}>, shape="record", style="filled"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/classes_colorized.puml new/pylint-2.17.4/tests/pyreverse/data/classes_colorized.puml --- old/pylint-2.17.2/tests/pyreverse/data/classes_colorized.puml 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/classes_colorized.puml 2023-05-06 17:20:29.000000000 +0200 @@ -22,6 +22,10 @@ {abstract}get_value() {abstract}set_value(value) } +class "NullablePatterns" as data.nullable_pattern.NullablePatterns #aliceblue { + {abstract}return_nullable_1() -> int | None + {abstract}return_nullable_2() -> Optional[int] +} class "PropertyPatterns" as data.property_pattern.PropertyPatterns #aliceblue { prop1 prop2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.dot new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.dot --- old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.dot 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.dot 2023-05-06 17:20:29.000000000 +0200 @@ -3,6 +3,7 @@ charset="utf-8" "data" [color="black", label=<data>, shape="box", style="solid"]; "data.clientmodule_test" [color="black", label=<data.clientmodule_test>, shape="box", style="solid"]; +"data.nullable_pattern" [color="black", label=<data.nullable_pattern>, shape="box", style="solid"]; "data.property_pattern" [color="black", label=<data.property_pattern>, shape="box", style="solid"]; "data.suppliermodule_test" [color="black", label=<data.suppliermodule_test>, shape="box", style="solid"]; "data.clientmodule_test" -> "data.suppliermodule_test" [arrowhead="open", arrowtail="none"]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.html new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.html --- old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.html 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.html 2023-05-06 17:20:29.000000000 +0200 @@ -8,12 +8,14 @@ } class clientmodule_test { } + class nullable_pattern { + } class property_pattern { } class suppliermodule_test { } clientmodule_test --> suppliermodule_test - + </div> </body> </html> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.mmd new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.mmd --- old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.mmd 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.mmd 2023-05-06 17:20:29.000000000 +0200 @@ -3,6 +3,8 @@ } class clientmodule_test { } + class nullable_pattern { + } class property_pattern { } class suppliermodule_test { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.puml new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.puml --- old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.puml 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.puml 2023-05-06 17:20:29.000000000 +0200 @@ -1,16 +1,14 @@ @startuml packages_No_Name set namespaceSeparator none package "data" as data { - } package "data.clientmodule_test" as data.clientmodule_test { - +} +package "data.nullable_pattern" as data.nullable_pattern { } package "data.property_pattern" as data.property_pattern { - } package "data.suppliermodule_test" as data.suppliermodule_test { - } data.clientmodule_test --> data.suppliermodule_test @enduml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.vcg new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.vcg --- old/pylint-2.17.2/tests/pyreverse/data/packages_No_Name.vcg 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/packages_No_Name.vcg 2023-05-06 17:20:29.000000000 +0200 @@ -6,18 +6,21 @@ manhattan_edges:yes node: {title:"data" label:"\fbdata\fn" shape:box -} + } node: {title:"data.clientmodule_test" label:"\fbdata.clientmodule_test\fn" shape:box -} + } + node: {title:"data.nullable_pattern" label:"\fbdata.nullable_pattern\fn" + shape:box + } node: {title:"data.property_pattern" label:"\fbdata.property_pattern\fn" shape:box -} + } node: {title:"data.suppliermodule_test" label:"\fbdata.suppliermodule_test\fn" shape:box -} + } edge: {sourcename:"data.clientmodule_test" targetname:"data.suppliermodule_test" arrowstyle:solid backarrowstyle:none backarrowsize:0 -} + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/packages_colorized.dot new/pylint-2.17.4/tests/pyreverse/data/packages_colorized.dot --- old/pylint-2.17.2/tests/pyreverse/data/packages_colorized.dot 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/packages_colorized.dot 2023-05-06 17:20:29.000000000 +0200 @@ -3,6 +3,7 @@ charset="utf-8" "data" [color="aliceblue", label=<data>, shape="box", style="filled"]; "data.clientmodule_test" [color="aliceblue", label=<data.clientmodule_test>, shape="box", style="filled"]; +"data.nullable_pattern" [color="aliceblue", label=<data.nullable_pattern>, shape="box", style="filled"]; "data.property_pattern" [color="aliceblue", label=<data.property_pattern>, shape="box", style="filled"]; "data.suppliermodule_test" [color="aliceblue", label=<data.suppliermodule_test>, shape="box", style="filled"]; "data.clientmodule_test" -> "data.suppliermodule_test" [arrowhead="open", arrowtail="none"]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/data/packages_colorized.puml new/pylint-2.17.4/tests/pyreverse/data/packages_colorized.puml --- old/pylint-2.17.2/tests/pyreverse/data/packages_colorized.puml 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/data/packages_colorized.puml 2023-05-06 17:20:29.000000000 +0200 @@ -6,6 +6,9 @@ package "data.clientmodule_test" as data.clientmodule_test #aliceblue { } +package "data.nullable_pattern" as data.nullable_pattern #aliceblue { + +} package "data.property_pattern" as data.property_pattern #aliceblue { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/test_diadefs.py new/pylint-2.17.4/tests/pyreverse/test_diadefs.py --- old/pylint-2.17.2/tests/pyreverse/test_diadefs.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/test_diadefs.py 2023-05-06 17:20:29.000000000 +0200 @@ -141,6 +141,7 @@ assert modules == [ (True, "data"), (True, "data.clientmodule_test"), + (True, "data.nullable_pattern"), (True, "data.property_pattern"), (True, "data.suppliermodule_test"), ] @@ -154,6 +155,7 @@ (True, "DoNothing2"), (True, "DoSomething"), (True, "Interface"), + (True, "NullablePatterns"), (True, "PropertyPatterns"), (True, "Specialization"), ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/tests/pyreverse/test_inspector.py new/pylint-2.17.4/tests/pyreverse/test_inspector.py --- old/pylint-2.17.2/tests/pyreverse/test_inspector.py 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/tests/pyreverse/test_inspector.py 2023-05-06 17:20:29.000000000 +0200 @@ -136,6 +136,7 @@ expected = [ "data", "data.clientmodule_test", + "data.nullable_pattern", "data.property_pattern", "data.suppliermodule_test", ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.17.2/towncrier.toml new/pylint-2.17.4/towncrier.toml --- old/pylint-2.17.2/towncrier.toml 2023-04-03 14:16:52.000000000 +0200 +++ new/pylint-2.17.4/towncrier.toml 2023-05-06 17:20:29.000000000 +0200 @@ -1,5 +1,5 @@ [tool.towncrier] -version = "2.17.2" +version = "2.17.4" directory = "doc/whatsnew/fragments" filename = "doc/whatsnew/2/2.17/index.rst" template = "doc/whatsnew/fragments/_template.rst"