Daiyue Weng <daiyuew...@gmail.com> writes:
> Hi, I found that when I tried to make an equality test on empty like,
> if errors == :
> PyCharm always warns me,
> Expression can be simplified.
> I am wondering what's wrong and how to fix this?
It is not wrong, but it can be simplified to just:
This is quite usual in Python, but some people prefer the more elaborate form,
or something like:
if len(errors) == 0:
Piet van Oostrum <pie...@pietvanoostrum.com>
PGP key: [8DAE142BE17999C4]