Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • About Bonfire
Cassandra is only carbon now
Cassandra is only carbon now
@xgranade@wandering.shop  ·  activity timestamp 2 hours ago

@emmatyping @whitequark @glyph @SnoopJ @ancoghlan @mcc

```
from typing import TypeVar, Callable, Optional
T = TypeVar("T")
U = TypeVar("U")

def g[T, U](fn: Callable[[T | U], U], x: T) -> U:
return fn(fn(x))

def f(_: Optional[int]) -> None:
pass

x = f(12) # Fails
f(f(12)) # Fails
g(f, 12) # Works
```

  • Copy link
  • Flag this post
  • Block

bonfire.mavnn.eu

News and community around mavnn.eu projects.

bonfire.mavnn.eu: About · Code of conduct · Privacy ·
Bonfire social · 1.0.1-alpha.27 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Public Groups
  • Code of Conduct