How can I get around declaring an unused variable in a for loop?

后端 未结 10 1230
自闭症患者
自闭症患者 2020-11-27 16:03

If I have a list comprehension (for example) like this:

[\'\' for x in myList]

Effectively making a new list that has an empty string for e

10条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 17:01

    Add the following comment after the for loop on the same line:

    #pylint: disable=unused-variable

    for i in range(100): #pylint: disable=unused-variable
    

提交回复
热议问题