Timeline for Multiplication of functions in Python
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 2, 2019 at 14:37 | comment | added | jpp | @chepner, In the context of writing mathematics, by hand, old school. Just because code vs written convention breaks down elsewhere doesn't justify being ambiguous here, that's a false argument. I'm only talking about this specific case. | |
| Jan 2, 2019 at 14:14 | comment | added | chepner |
IMO, the biggest hurdle to supporting function-level operators in Python is defining their semantics for functions in general. h(x) = f(x) * g(x) is fine if f and g take a single parameter, but what should f * g mean if f takes two arguments and g takes one? What if f and g both accept a keyword argument named foo, but f expects it to be an integer and g expects it to be a tuple? Lots of nice mathematical concepts fall apart when you try to apply them to Python's function model.
|
|
| Jan 2, 2019 at 14:12 | comment | added | chepner |
What contexts? The usual operator for composition is ∘, although that (like all Unicode characters) is not a recognized operator in Python. * could be considered an ASCII replacement, but as it is not used as such in Python, it's a stretch to call it "ambiguous".
|
|
| Jan 2, 2019 at 13:50 | history | answered | jpp | CC BY-SA 4.0 |