You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran python-modernize on a legacy code base and it turned result = filter(lambda item: True if item.get_license_number_minor() == self.get_license_number_minor() else False, license_list)
into result = [item for item in license_list if True if item.get_license_number_minor() == self.get_license_number_minor() else False]
which the Python interpreter won't execute: SyntaxError: invalid syntax
So, there are missing brackets around the if expression.
P.S.: Yes, the original code is strange, but it worked. Meanwhile i simplified the code and then python-modernize worked.
The text was updated successfully, but these errors were encountered:
I ran python-modernize on a legacy code base and it turned
result = filter(lambda item: True if item.get_license_number_minor() == self.get_license_number_minor() else False, license_list)
into
result = [item for item in license_list if True if item.get_license_number_minor() == self.get_license_number_minor() else False]
which the Python interpreter won't execute:
SyntaxError: invalid syntax
So, there are missing brackets around the if expression.
P.S.: Yes, the original code is strange, but it worked. Meanwhile i simplified the code and then python-modernize worked.
The text was updated successfully, but these errors were encountered: