Hello,
Ben North <ben <at> redfrontdoor.org> writes:
>
> I find 'functools.partial' useful, but occasionally I'm unable to use it
> because it lacks a 'from the right' version. E.g., to create a function
> which splits a string on commas, you can't say
>
> # Won't work when called:
> split_comma = partial(str.split, sep = ',')
In py3k, we could also use "..." (the Ellipsis object) to denote places where an
argument is missing, so that:
split_comma = partial(str.split, ..., ',')
would do what you want.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com