[Python-ideas] [Python-3000] PEP 3107 Function Annotations: overloadable ->
tony at pagedna.com
Tue Jan 2 17:33:00 CET 2007
On Jan 1, 2007, at 10:34 PM, Josiah Carlson wrote:
> -1 on the -> operator as specified in the email you link. There is no
> reason to add aribtrary operators for call-site annotations.
What was the arbitrary operator? -> is not arbitrary, and there was a
given to add it.
> PEP 3107
> has already defined the syntax for function definition site
> as follows...
> def name(argument=default:annotation) -> annotation:
> The mail you link, talks about an arbitrary -> operator for call-site
> annotations. Without seeing actual use-cases where a -> operator
> be useful in the real-world, I can't help but be -1 on the -> operator
> and -1 on the __returns__ method.
That email had a use case... The gain is being able to write
def wrap(text: str, split: Function(str)-> list):
def wrap(text: str, split: Function(str) == list):
def wrap(text: str, split: Function(str, returns=list)):
or one of the other methods that Kay came up with.
More information about the Python-ideas