for a new function, named parameter might be a better choise, but for
existing function, placeholder would be better, since you don't need to
modify the existing code.
--
http://mail.python.org/mailman/listinfo/python-list
sorry, should be "existing"
--
http://mail.python.org/mailman/listinfo/python-list
for a new function, named parameter might be a better choise, but for
existing function, placeholder would be better, since you don't need to
modify the exiting code.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Since python has named parameter(and I assume this PEP would support
> it as well), is it really that useful to have these place holder things
> ?
Probably not so much, you're right.
> As when the parameter list gets long, named param should be easier to
> read.
>
> Th
Giovanni Bajo wrote:
> Ronald Mai wrote:
>
> > Here is a reference implementation:
> >
> > _ = lambda x: x.pop(0)
> >
> > def partial(func, *args, **keywords):
> > def newfunc(*fargs, **fkeywords):
> > newkeywords = keywords.copy()
> > newkeywords.update(fkeywords)
Ronald Mai wrote:
> Here is a reference implementation:
>
> _ = lambda x: x.pop(0)
>
> def partial(func, *args, **keywords):
> def newfunc(*fargs, **fkeywords):
> newkeywords = keywords.copy()
> newkeywords.update(fkeywords)
> newargs = (lambda seq: tupl
In my opinion, Ellipsis might be in the middle, not only in leftmost or
rightmost, so a placeholder approach can be much more flexible and
convenient.
Here is a reference implementation:
_ = lambda x: x.pop(0)
def partial(func, *args, **keywords):
def newfunc(*fargs, **fkeywords):
Steven Bethard <[EMAIL PROTECTED]> wrote:
>
> getting attributes with defaults[1]:
> objs.sort(key=lambda a: getattr(a, 'lineno', 0))
> objs.sort(key=getattr(__, 'lineno', 0)
>
Yes, this exact example is one of the (very) few that I found in the
standard library where the syntax actual
Chris Perkins wrote:
[snip implementation]
While I think that func(x, ...) is more readable than partial(func, x),
I'm not sure that I would use either of them often enough to warrant
special syntax.
Interesting. Thought it might be worth listing a few of the current
places people use lambdas (an
>Scott David Daniels wrote:
>>>Chris Perkins wrote:
Random idea of the day: How about having syntax support for
currying/partial function application, like this:
func(..., a, b)
func(a, ..., b)
func(a, b, ...)
That is:
1) Make an Ellipsis literal legal syntax in an
Reinhold Birkenfeld wrote:
Steven Bethard wrote:
Chris Perkins wrote:
Random idea of the day: How about having syntax support for
currying/partial function application, like this:
func(..., a, b)
func(a, ..., b)
func(a, b, ...)
That is:
1) Make an Ellipsis literal legal syntax in an argument list.
Steven Bethard wrote:
> Chris Perkins wrote:
>> Random idea of the day: How about having syntax support for
>> currying/partial function application, like this:
>>
>> func(..., a, b)
>> func(a, ..., b)
>> func(a, b, ...)
>>
>> That is:
>> 1) Make an Ellipsis literal legal syntax in an argument li
Chris Perkins wrote:
Random idea of the day: How about having syntax support for
currying/partial function application, like this:
func(..., a, b)
func(a, ..., b)
func(a, b, ...)
That is:
1) Make an Ellipsis literal legal syntax in an argument list.
2) Have the compiler recognize the Ellipsis liter
Random idea of the day: How about having syntax support for
currying/partial function application, like this:
func(..., a, b)
func(a, ..., b)
func(a, b, ...)
That is:
1) Make an Ellipsis literal legal syntax in an argument list.
2) Have the compiler recognize the Ellipsis literal and transform th
14 matches
Mail list logo