You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following code which returns as attribute-error unless silenced:
def__eq__(self, value: object) ->bool:
"""Dice are equal if they give the same probabilities."""try:
returnself.probabilities==value.probabilities# pytype: disable=attribute-errorexceptAttributeError:
returnFalse
As handling attribute and type issues is a common case for try: ... except: blocks it would be great if pytype automatically ignored type errors which were specifically handled in the code.
The text was updated successfully, but these errors were encountered:
def eq(self, value: object) -> bool:
"""Dice are equal if they give the same probabilities."""
try:
return self.probabilities == value.probabilities # pytype: disable=attribute-error
except AttributeError:
return False
I have the following code which returns as
attribute-error
unless silenced:As handling attribute and type issues is a common case for
try: ... except:
blocks it would be great if pytype automatically ignored type errors which were specifically handled in the code.The text was updated successfully, but these errors were encountered: