Quantcast
Channel: Pylint type confusion - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by siva for Pylint type confusion

Changing the return type of the get_user() function to typing.Optional[User] solves the problem.pylint is complaining because, according to the type hint only, user might be the value True, and...

View Article



Pylint type confusion

user = get_user() # returns object of type User or Falseif not user: raise HTTPException()print(user.name) # pylint error: Instance of 'bool' has no 'name' memberGoal: get rid of pylint error in the...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images