| ▲ | Rewriting a 20-year-old Python library(b-list.org) | |||||||||||||
| 15 points by PaulHoule 5 days ago | 6 comments | ||||||||||||||
| ▲ | est 2 hours ago | parent | next [-] | |||||||||||||
> providing both sync and async code paths in the same class, often using a naming scheme which prefixes the async versions of the methods with an a I have a solution to write a single code path for both async and sync | ||||||||||||||
| ||||||||||||||
| ▲ | ra an hour ago | parent | prev | next [-] | |||||||||||||
Brings back memories if when b-list was on the front page of HN all the time. Another approach to preserve the fully functional api is decorators. | ||||||||||||||
| ▲ | globular-toast 3 hours ago | parent | prev [-] | |||||||||||||
The binary "is spam" thing seems like a non-issue, unless I'm misunderstanding something. In Python you can easily implement Boolean attributes using predicates without breaking the API, like so:
Then you can simply add another predicate to support the blatant case: | ||||||||||||||
| ||||||||||||||