Hi Nathaniel,
2017-02-17 11:28 GMT+01:00 Nathaniel Smith <n...@pobox.com>: > > Note that this is definitely a different proposal from the original, > since the original proposer's goal was to be able to use this with > existing, unmodified functions that expect a regular value, not a > lambda. > > I don't really see how that goal can be accomplished without massively > revising Python's runtime model, so this doesn't really bother me, but > it should be noted :-). > Yep ;-) > > Anyway, you might also be interested in: > > https://mail.python.org/pipermail/python-ideas/2016- > November/043590.html > > which is a similar idea and some more motivating examples, except that > it allows for the full richness of Python's call syntax, and passes > ASTs rather than lambdas to allow for non-standard evaluation rules. > > Frankly, I think that proposal is too baroque. The simplicity of my proposal is intentional. Just passing in a callable makes it simpler and makes it also more likely that existing functions could be used with it. I have considered adding all kind of syntax for adding extra arguments to the wrapped callable, extra arguments for the invoked function, ... basically that just makes it a mess. If you want that, use the existing syntax. By the way, got a private e-mail mentioning that the proposed syntax is already claimed by type annotations. So therefore a :: b is now my proposed syntax. Stephan > -n > > -- > Nathaniel J. Smith -- https://vorpus.org >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/