<NME> matrix-multiplication.expect.txt
<BEF> <span class="hljs-meta">@meta</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">C</span>:</span>

<span class="hljs-meta">    @decorator</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span><span class="hljs-params">(self, H, V, beta, r)</span>:</span>
        S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r)
        <span class="hljs-keyword">return</span> S

<MSG> (python) don't include `(` `)` in functions `params` match (#2490)

- Before: `<params>(x,y,z)</params>`
- After: `(<params>x,y,z</params>)`

Improves consistency with other grammars.

<DFF> @@ -2,6 +2,6 @@
 <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">C</span>:</span>
 
 <span class="hljs-meta">    @decorator</span>
-    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span><span class="hljs-params">(self, H, V, beta, r)</span>:</span>
+    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span>(<span class="hljs-params">self, H, V, beta, r</span>):</span>
         S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r)
         <span class="hljs-keyword">return</span> S

{'commit': 'diff --git a/CHANGES.md b/CHANGES.md\nindex b6fdef3e..5947bb45 100644\n--- a/CHANGES.md\n+++ b/CHANGES.md\n@@ -22,6 +22,7 @@ Parser Engine Changes:\n \n Language Improvements:\n \n+- enh(python) Exclude parens from functions params (#2490) [Álvaro Mondéjar][]\n - enh(swift) Add `compactMap` to keywords as built_in (#2478) [Omid Golparvar][]\n - enh(nim) adds `func` keyword (#2468) [Adnan Yaqoob][]\n - enh(xml) deprecate ActionScript inside script tags (#2444) [Josh Goebel][]\n@@ -70,6 +71,7 @@ Developer Tools:\n [Josh Goebel]: https://github.com/yyyc514\n [Sean Williams]: https://github.com/hmmwhatsthisdo\n [Adnan Yaqoob]: https://github.com/adnanyaqoobvirk\n+[Álvaro Mondéjar]: https://github.com/mondeja\n \n \n ## Version 9.18.1\n@@ -2148,4 +2150,3 @@ your comments and question to [highlight.js forum][forum]. And don\'t be afraid\n if you find there some fancy Cyrillic letters -- it\'s for Russian users too :-)\n \n [forum]: http://softwaremaniacs.org/forum/viewforum.php?id=6\n-\ndiff --git a/src/languages/python.js b/src/languages/python.js\nindex e7ae1bf2..86e5d320 100644\n--- a/src/languages/python.js\n+++ b/src/languages/python.js\n@@ -86,8 +86,14 @@ export default function(hljs) {\n   };\n   var PARAMS = {\n     className: \'params\',\n-    begin: /\\(/, end: /\\)/,\n-    contains: [\'self\', PROMPT, NUMBER, STRING, hljs.HASH_COMMENT_MODE]\n+    variants: [\n+      // Exclude params at functions without params\n+      {begin: /\\(\\s*\\)/, skip: true, className: null },\n+      {\n+        begin: /\\(/, end: /\\)/, excludeBegin: true, excludeEnd: true,\n+        contains: [\'self\', PROMPT, NUMBER, STRING, hljs.HASH_COMMENT_MODE],\n+      },\n+    ],\n   };\n   SUBST.contains = [STRING, NUMBER, PROMPT];\n   return {\ndiff --git a/test/markup/python-repl/sample.expect.txt b/test/markup/python-repl/sample.expect.txt\nindex d5695847..6693b43c 100644\n--- a/test/markup/python-repl/sample.expect.txt\n+++ b/test/markup/python-repl/sample.expect.txt\n@@ -11,7 +11,7 @@ foo = 42"\n <span class="hljs-meta">&gt;&gt;&gt;</span> <span class="python"><span class="hljs-string">"""</span></span>\n <span class="hljs-meta">...</span> <span class="python"><span class="hljs-string">abc</span></span>\n <span class="hljs-meta">...</span> <span class="python"><span class="hljs-string">"""</span></span>\n-<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">test</span><span class="hljs-params">()</span>:</span></span>\n+<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">test</span>():</span></span>\n <span class="hljs-meta">...</span> <span class="python">    <span class="hljs-keyword">pass</span></span>\n <span class="hljs-meta">&gt;&gt;&gt;</span>\n <span class="hljs-meta">&gt;&gt;&gt;</span>\ndiff --git a/test/markup/python/function-header-comments.expect.txt b/test/markup/python/function-header-comments.expect.txt\nindex b8530371..4ebe4aaa 100644\n--- a/test/markup/python/function-header-comments.expect.txt\n+++ b/test/markup/python/function-header-comments.expect.txt\n@@ -1,10 +1,10 @@\n-<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">foo</span><span class="hljs-params">(\n+<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">foo</span>(<span class="hljs-params">\n   bar, <span class="hljs-comment"># commment</span>\n-)</span>:</span>\n+</span>):</span>\n     <span class="hljs-keyword">pass</span>\n \n \n-<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Foo</span><span class="hljs-params">(collections.namedtuple<span class="hljs-params">(<span class="hljs-string">\'Test\'</span>)</span>, <span class="hljs-params">(\n+<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Foo</span>(<span class="hljs-params">collections.namedtuple(<span class="hljs-params"><span class="hljs-string">\'Test\'</span></span>), (<span class="hljs-params">\n     <span class="hljs-string">\'name\'</span>, <span class="hljs-comment"># comment</span>\n-)</span>)</span>:</span>\n-    <span class="hljs-keyword">pass</span>\n\\ No newline at end of file\n+</span>)</span>):</span>\n+    <span class="hljs-keyword">pass</span>\ndiff --git a/test/markup/python/function-header.expect.txt b/test/markup/python/function-header.expect.txt\nindex cf3c8e5e..eb249617 100644\n--- a/test/markup/python/function-header.expect.txt\n+++ b/test/markup/python/function-header.expect.txt\n@@ -1,2 +1,2 @@\n-<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span><span class="hljs-params">(x: int)</span> -&gt; <span class="hljs-keyword">None</span>:</span>\n+<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span>(<span class="hljs-params">x: int</span>) -&gt; <span class="hljs-keyword">None</span>:</span>\n     <span class="hljs-keyword">pass</span>\ndiff --git a/test/markup/python/matrix-multiplication.expect.txt b/test/markup/python/matrix-multiplication.expect.txt\nindex 97323a19..256895b2 100644\n--- a/test/markup/python/matrix-multiplication.expect.txt\n+++ b/test/markup/python/matrix-multiplication.expect.txt\n@@ -2,6 +2,6 @@\n <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">C</span>:</span>\n \n <span class="hljs-meta">    @decorator</span>\n-    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span><span class="hljs-params">(self, H, V, beta, r)</span>:</span>\n+    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span>(<span class="hljs-params">self, H, V, beta, r</span>):</span>\n         S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r)\n         <span class="hljs-keyword">return</span> S\n', 'commit_subject': "(python) don't include `(` `)` in functions `params` match (#2490)", 'repo_name': 'highlightjs/highlight.js', 'committer': {'name': 'GitHub', 'email': '1505422b2465e9a84f6fdfaa161078890c593f06@github.com', 'time_sec': '1586648033', 'tz_offset': '-240', 'date': {'seconds': '1586648033'}}, 'commit_tree': 'c593f37d06fc812314f70f33726792f1d5be7eb7', 'commit_message': "(python) don't include `(` `)` in functions `params` match (#2490)\n\n- Before: `<params>(x,y,z)</params>`\r\n- After: `(<params>x,y,z</params>)`\r\n\r\nImproves consistency with other grammars.\r\n", 'language_name': 'HTML', 'license': 'bsd-3-clause', 'hunks': '@@ -2,6 +2,6 @@\n <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">C</span>:</span>\n \n <span class="hljs-meta">    @decorator</span>\n-    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span><span class="hljs-params">(self, H, V, beta, r)</span>:</span>\n+    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span>(<span class="hljs-params">self, H, V, beta, r</span>):</span>\n         S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r)\n         <span class="hljs-keyword">return</span> S\n', 'addition_count': 1, 'deletion_count': 1, 'src_file': 'a/test/markup/python/matrix-multiplication.expect.txt', 'tgt_file': 'b/test/markup/python/matrix-multiplication.expect.txt', 'file_extension': '.txt', 'before_file': '<span class="hljs-meta">@meta</span>\n<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">C</span>:</span>\n\n<span class="hljs-meta">    @decorator</span>\n    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">f</span><span class="hljs-params">(self, H, V, beta, r)</span>:</span>\n        S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r)\n        <span class="hljs-keyword">return</span> S\n', 'message': "(python) don't include `(` `)` in functions `params` match (#2490)\n\n- Before: `<params>(x,y,z)</params>`\r\n- After: `(<params>x,y,z</params>)`\r\n\r\nImproves consistency with other grammars.\r\n", 'author_name': 'GitHub', 'lang': 'expect'}