[Python-ideas] Quick idea: defining variables from functions that take the variable name

Steven D'Aprano steve at pearwood.info
Wed Jun 1 12:47:32 EDT 2016


On Wed, Jun 01, 2016 at 05:33:19PM +0100, Paul Moore wrote:

> > # Your proposal.
> > def T as (lambda: Typevar)()
> > def x as (lambda: sympy.Symbol)()
> 
> That's hardly fair. The two examples you quote are the ones that
> really *do* work with the "one-argument function" restriction:

Ah yes, you're right, I misread Alan's proposal. Typevar would work, 
because it is an expression that evaluates to a callable of one 
function. I read Alan as saying that the expression would be called.



-- 
Steve


More information about the Python-ideas mailing list