How do I suppress “has no attribute” errors from mypy when assigning a new attribute to a function?

前端 未结 0 1424
再見小時候
再見小時候 2021-02-19 06:02

I often use the following idiom for static initialization:

def compute_answer() -> int:
    if compute_answer.ret is None:
        # Do stuff that only happens         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题