Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
This is the basis of most older async frameworks (see: Tornado, Twisted). A while ago I put together a short talk on how to go from this feature -> a very basic version of Twisted's @inline_callback decorator.
https://github.com/ltavag/async_presentation/tree/master
> In my mind this is a holdover from when Python was much more procedural/C-like
That never existed.
The earliest commits are spotty and incomplete, but e.g. the first commit in which I can find the len() builtin (https://github.com/python/cpython/commit/c636014c430620325f8...) also has calls to file.read and list.append, and the first python-level methods are created just a few commits later (https://github.com/python/cpython/commit/336f2816cd3599b0347...).
This was years before magic methods were even added (https://github.com/python/cpython/commit/04691fc1c1bb737c0db...).
So no, it's not a "holdover from" anything.
If you actually think this code is better there's a real library that does this: https://github.com/EntilZha/PyFunctional.
Related posts
- Kotlin/Java/Javascript/Scala users do you miss the ability to chain functional operators in Python?
- PyFunctional makes creating data pipelines easy by using chained functional operators
- Functional Python Programming
- Is it impossible to contribute to open source as a data engineer?
- Show HN: Leaderboard of most downloaded PyPI packages