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 ArticlePylint 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
More Pages to Explore .....