I'd like Pycharm to assert when the user sets the value to something other than an int. I'm already using a type hint. Is there another way to get this functionality?
def someproperty(self, value):
"""
:type value: int
"""
assert isinstance(value, int)
# other stuff
Using pycharm you can get somewhat close to static type checking, using type declarations and increasing the severity of the "Type checker" inspection:
This will make type checks very prominent in your code: