Re:Python: Uncovering the Overlooked Core Functionalities
by JimDabell on Wednesday July 26, 2023 @03:49AM
(#36874338)
You’re correct. In GvR’s own words:
https://mail.python.org/pipermail/python-3000/2006-November/...
Re:Python: Uncovering the Overlooked Core Functionalities
by masklinn on Wednesday July 26, 2023 @04:18AM
(#36874581)
Thanks. I may have already read that post (or I just correctly backtracked the reasoning), as I was pretty much convinced namespacing conflict (the second bit of rationale) was a factor for the dunder-ing of methods, but I had no source so ultimately decided not to put it in.
Re:Python: Uncovering the Overlooked Core Functionalities
by movpasd on Saturday July 29, 2023 @07:07AM
(#36919018)
Thanks for the thorough correction. I think I was making that assumption due to the semantics of the language, which suggests classes and methods being somewhat "bolted onto" a dict-based core. Unfortunately for me, it makes me all the more dissatisfied with the choice.
That never existed. Or if it did, it was long before any trace exists, and there's trace from quite a way back when 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...). Though there may be missing commits, this is 30 in, back when Python was an internal CWI thing (although nearly a year in, according to the official timelines of the early days).
This was years before magic methods were even added (https://github.com/python/cpython/commit/04691fc1c1bb737c0db...).
So no, I don't think it's a "holdover from" anything. Rather seems like it's GvR's sensibilities.