Python Forum
Pylint/pyflakes/flake8 missed AttributeError
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pylint/pyflakes/flake8 missed AttributeError
#1
Hi,
I have the code
class MainC:
    def __init__(self):
        self.arg1 = None

# Method One, Not working
OBJ_LIST = {}
for i in range(10):
    OBJ_LIST[i] = MainC()

for i in range(10):
    print(OBJ_LIST[i].arg2)  # There is a error here

# Method Two, Also not working
OBJ_LIST = []
for i in range(10):
    OBJ_LIST.append(MainC())

for i in range(10):
    print(OBJ_LIST[i].arg2)  # There is a error here
While I am running pylint/pyflakes/flake8 I don't get any error about attribute error.
What can I do to find that error without running the code

Thanks,
Yoni
Reply


Messages In This Thread
Pylint/pyflakes/flake8 missed AttributeError - by elyoni - Feb-19-2020, 07:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pySerial - missed messages q_nerk 2 1,814 Jan-27-2022, 09:59 PM
Last Post: Jeff_t
  Pylint more Fast leandrogmuller 2 2,252 Oct-20-2020, 05:21 PM
Last Post: leandrogmuller
  pylint not recognizing some objects in VS Code marceloreborn 1 1,859 Jul-31-2020, 01:36 AM
Last Post: Larz60+
  pylint question dcollett 0 1,597 Mar-26-2020, 08:49 PM
Last Post: dcollett
  Pylint Statment Count Shangeetha 1 2,087 Dec-22-2019, 04:58 PM
Last Post: Larz60+
  pylint & #! pileofrogs 1 2,179 May-23-2019, 01:58 PM
Last Post: heiner55
  redefinition of a method in a class: pylint warning kboo 1 4,310 Feb-13-2018, 11:21 AM
Last Post: buran
  pyflakes vs flake8 broutray 3 7,970 Jun-02-2017, 07:54 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020