blob: 94aa33ef6df14915da948234b9c1e3a8bfd9bb3f [file] [log] [blame]
from mypy.plugin import Plugin
class MyPlugin(Plugin):
def get_type_analyze_hook(self, fullname):
if fullname in ("decimal.Decimal", "_decimal.Decimal"):
return decimal_to_int_hook
return None
def plugin(version):
return MyPlugin
def decimal_to_int_hook(ctx):
return ctx.api.named_type('builtins.int', [])