python-hyper / h11

A pure-Python, bring-your-own-I/O implementation of HTTP/1.1
https://h11.readthedocs.io/
MIT License
490 stars 62 forks source link

provide a new version of Connection that returns/accepts enum types for PAUSED/NEED_DATA our_role their_role etc #153

Open graingert opened 2 years ago

graingert commented 2 years ago

the current Connection.next_event Event | type[_Sentinel] return type is slightly painful to work with. It would be useful to have a version that returns enum based sentinels instead

graingert commented 2 years ago

see also https://github.com/python-hyper/h11/pull/144 and https://discuss.python.org/t/pep-661-sentinel-values/9126/1