3 ms·
The pros and cons of different operator possibilities are discussed extensively in the PEP that added the matrix multiplication operator.
by ngoldbaum 11y ago
The pros and cons of different operator possibilities are discussed extensively in the PEP that added the matrix multiplication operator.
- yoha 11y agoDirect link: http://legacy.python.org/dev/peps/pep-0465/#choice-of-operator http://legacy.python.org/dev/peps/pep-0465/#choice-of-operat...
- KeytarHero 11y agoI love the snark in that PEP: > APL apparently used +.× , which by combining a multi-character token, confusing attribute-access-like . syntax, and a unicode character, ranks somewhere below U+2603 SNOWMAN on our candidate list. and then later, one of the reasons @ is better than the alternatives: > Whatever, we have to pick something.
- mixmastamyk 11y agoWhat about the & char?
- ngoldbaum 11y ago& is the bitwise and operator.
- mixmastamyk 11y agoYep, forgot thanks.
- JoshTriplett 11y agoNot particularly well, though. No actual explanation was given for rejecting ^(star), and :(star) wasn't even mentioned. (Aside: HN really needs a better way to escape star inline in text.)
- sdenton4 11y agoIt sounded like there was a bit of general preference for a single-character operator, which is a sentiment I can get behind.