The discussion from last month continues. How do contracts differ from asserts? What is their relationship with unit tests?
Anders Hovmöller suggests a syntax for specifying keyword arguments where the local variable name matches the formal parameter name:
foo(a=a, b=b, c=c, d=3, e=e) # current syntax foo(*, a, b, c, d=3, e) # equivalent
Robert Vanden Eynde suggests a python transpiler that compiles syntax extensions into standard python:
- a,b += f(x) → _t = f(x); a += _t; b += _t; (augmented assignement unpacking)
- a = 2x + 1 → a = 2*x + 1 (juxtaposition is product)
- f(*, x, y) → f(x=x, y=y) (simplekwargs)
- DSL specific language
- all def become @partially def
Paddy3118 proposes that python should have a string-reversing function that doesn't mess up combining characters and such. The ensuing discussion has some interesting examples of problems with RTL, combining characters, etc. As Stephan Houben notes, though, it is rarely necessary to reverse a string outside of programming puzzles.
Samantha Quan suggests that the statement "Beautiful is better than ugly." in the Zen of Python is Lookist and will make people feel excluded, so it should be changed or removed. Some participants in the discussion opine that Quan is trolling (perhaps following from a recent python issue), some reject the proposal as politically correct nonsense, and some at least mildly support the idea.
One post suggested that "the Language should be renamed to Cobra, after the brilliant military strategist Cobra Commander" so as not to offend humorless people with all the Monty Python references.