The nice thing about Python is that it's intuitive and feels natural. To that end, this syntax for defining functions is nice, and I would love to see it implemented in native Python:
f(x) = x^2 + 1
But most of the other ideas are less intuitive than their native counterparts. For example, I think that the native form:
With the usual method of declaring a function, it was easy to understand that 'x' was local to the function. Adding a second, more concise way to express functions led to confusion about the scope of 'x'.
Also, declaring types for the function and arguments (which is optional but has been strongly recommended since the Fortran '77 era) had to be done outside of the function, which again is unlike the usual syntax.
The only code I've ever seen statement functions used in dated from the 1970s.
I think the Fortran problem was that f(x) = x^2 + 1 looks a lot like a normal statement, with only a subtle clue on the left hand side ("Hey, f isn't an array!...") Whereas in python, having 'lambda' is a bigger clue. Hard to know without trying it out on some test subjects. I don't think anyone really studied why the Fortran thing was a problem, but of course lots of people (including me) have guesses.
As for type hinting, Python 3 does support it: https://docs.python.org/3/library/typing.html but I think the better lesson to learn is that it can be hard to future-proof alternative syntax or syntactic sugar. I looked at the 3.X docs, and PEP 484 and 526, no mention of how this typing can work with lambdas, and no comment that it doesn't (!)
Mis-seeing it as an array makes a lot of sense for the f(x) syntax. That's probably even more true than it would be in a higher level language like python, because you're doing more stuff like that.
But for Python3 lambda type hints, I'm reading a definitive comment in PEP 3107 that it isn't supported [0]. Anecdotally, that also jives with what I'm seeing on the REPL.
Python 3.6.0 (default, Jan 18 2017, 02:51:38)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import typing
>>> f = lambda x: int: x * 6
File "<stdin>", line 1
f = lambda x: int: x * 6
^
SyntaxError: invalid syntax
Not trying to be pedantic here, just illustrating the point that this style of function can collide with future language developments, and confuse users.
This is a cool demonstration of how make some fundamental changes to Python by using operator overloading, but it feels fragile and very different from Python. At the end of the day, I'd think that if you want to program like this, you want a different language.
Leaves me wondering if I'd be shooting off my little toe or my whole foot!
Might be fun to show pythonic equivalents for the ones that are relatively easy to make pythonic. You might discover some useful pythonic functions along the way.
The naming is odd, because the syntax hasn't changed, only the semantics of some operators have changed.
An example of syntactic sugar is list comprehensions. It's a new syntax for expressions using map, filter, etc. It's "new" syntax for something that can be described in terms of the "old" syntax without altering the semantics.
Given the name, I was expecting some kind of macro system or hacks to the Python parser.
Yes, I agree with you. Strictly speaking, I was creating new semantics of the operators which looks like "new" syntax, to mimic "syntactic sugar". But I have no idea how to name this in a more understandable way.
What it severely lacks is readme that clearly states what it does with some realistic examples and is understandable by people who have no idea what CLOS is, so: It allows you to do function overloading which is resolved dynamically based on actual types of passed values or even values themselves. With the included (trivial) C extension it's only about 50% slower than Python method call, so in all for expected usecase it's faster than Visitor pattern not to mention more DRY.