used-before-assignment warning with :=

I was running pylint (2.6.0) in VS Code against a module, the code was working. if (amt := self._data[index.row()][index.column()]) \ and float(amt) < 0.0: return QColor('red') I got the above error and had to change it to the below to clear the error. amt = self._data[index.row()][index.column()] if amt and float(amt) < 0.0: return QColor('red') I had thought the walrus was implemented to foster this style of code. Thanks, Ed

Hello, You should upgrade pylint to the latest version, in order to get supports for the walrus operator (2.8 or superior has it, maybe even 2.7.4). The match pattern will only be supported in the next major version too (2.9.0). Best regards, Le lun. 31 mai 2021 à 16:22, Ian Stapleton Cordasco < graffatcolmingov@gmail.com> a écrit :

This was an issue with pylint and was fixed in pylint v 2.8.0. Changelog: http://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pyli... On Mon., May 31, 2021, 7:19 a.m. Ed Lipson, <edlipsongm@gmail.com> wrote:

Hello, You should upgrade pylint to the latest version, in order to get supports for the walrus operator (2.8 or superior has it, maybe even 2.7.4). The match pattern will only be supported in the next major version too (2.9.0). Best regards, Le lun. 31 mai 2021 à 16:22, Ian Stapleton Cordasco < graffatcolmingov@gmail.com> a écrit :

This was an issue with pylint and was fixed in pylint v 2.8.0. Changelog: http://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pyli... On Mon., May 31, 2021, 7:19 a.m. Ed Lipson, <edlipsongm@gmail.com> wrote:
participants (4)
-
Ed Lipson
-
Ian Stapleton Cordasco
-
Mariatta
-
Pierre Sassoulas