-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
Labels
bugSomething isn't workingSomething isn't workingnarrowingrelated to flow-sensitive type narrowingrelated to flow-sensitive type narrowing
Milestone
Description
Summary
class Instance: ...
_instance: Instance | None = None
def get_instance() -> Instance:
"""Lazy static to get the instance"""
global _instance
if _instance is None:
_instance = Instance()
return _instanceWe already checked that if it's None we assign a value to it, so the return value can't be possibly None anymore
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingnarrowingrelated to flow-sensitive type narrowingrelated to flow-sensitive type narrowing