4 # Ben used the phrase "play the hand you are dealt"
5 # And I think this is a thing that you're missing in general
6 # That when some things can't be different, you optimize them
7 # You were born with awesome Jew hair, so make it awesome
8 # And you were born a man
9 # So get good at being a man
10 # I became a mom, unexpectedly
11 # So I tried to be a good mom, lean into the personality traits I have that made me more maternal
12 # There are some instances in life where you should try to change the hand you are dealt
13 # But I think hair (and gender, as you know) aren't those things, at least not usually
14 # That's sometimes what bothers me about some trans people who don't pass well
15 # Spencer could have been a good man
16 # Or Ada could be an ugly, non-passing, masculine, male-interests woman
17 # And he chose wrongly I think
20 # in a nearby alternate future in which my analogue read different books in a differnt order
22 # "I don't got by that anymore" _As you know_
23 # "Right." (he doesn't say sorry) "You're looking ... well ..."
24 # (I know he meant it as an interjection, but I decide to interpret it as an adverb) "Thank you"
26 # a Python program should be the best Python program it could be
27 # "This isn't about code, is it?"
30 from typing import Callable, Optional, TypeVar, Union
35 def option_map(arg: Optional[T], fn: Callable[[T], U]) -> Optional[U]:
42 def bool_from_str1(s: str) -> Union[bool, ValueError]:
50 def endpoint1(parameter: Optional[str]) -> Optional[bool]:
51 return option_map(parameter, bool_from_str1)
55 def bool_from_str2(s):
63 def endpoint2(parameter):
67 return bool_from_str2(parameter)
72 if __name__ == "__main__":
73 for endpoint in [endpoint1, endpoint2]:
74 for arg in ("true", "false", None, "rah"):