Skip to content

Instantly share code, notes, and snippets.

@AlexWaygood
Created October 8, 2021 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexWaygood/f9ae35eb43418a2e674826db516dc654 to your computer and use it in GitHub Desktop.
Save AlexWaygood/f9ae35eb43418a2e674826db516dc654 to your computer and use it in GitHub Desktop.
from typing import Optional
from random import choice
class T:
def foo(self) -> None:
pass
var: Optional[T] = choice((None, T()))
var.foo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment