[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Dan Sommers
On 11/18/19 4:53 PM, Andrew Barnert via Python-ideas wrote: > On Nov 18, 2019, at 13:14, Chris Angelico wrote: >> I wasn't aiming that at you, so much as pointing out how incredibly >> tricky it is to pin down all these definitions. So tricky, in fact, >> that it's almost completely not worth t

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Andrew Barnert via Python-ideas
On Nov 18, 2019, at 13:14, Chris Angelico wrote: > > I wasn't aiming that at you, so much as pointing out how incredibly > tricky it is to pin down all these definitions. So tricky, in fact, > that it's almost completely not worth trying to define at all (in my > opinion). 90% of the time it’s o

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Chris Angelico
On Tue, Nov 19, 2019 at 8:04 AM Random832 wrote: > > On Mon, Nov 18, 2019, at 14:04, Chris Angelico wrote: > > If by "constant" you mean that they are immutable, then maybe; there > > aren't very many mutable callables (by comparison to the huge number > > of functions). But you can't assume that

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Random832
On Mon, Nov 18, 2019, at 14:04, Chris Angelico wrote: > If by "constant" you mean that they are immutable, then maybe; there > aren't very many mutable callables (by comparison to the huge number > of functions). But you can't assume that a function is as constant as > a string literal. I meant a

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Chris Angelico
On Tue, Nov 19, 2019 at 6:15 AM Andrew Barnert wrote: > > On Nov 18, 2019, at 11:07, Chris Angelico wrote: > > > > If by "constant" you mean that they are immutable, then maybe; there > > aren't very many mutable callables (by comparison to the huge number > > of functions). > > Functions are mut

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Andrew Barnert via Python-ideas
On Nov 18, 2019, at 11:07, Chris Angelico wrote: > > If by "constant" you mean that they are immutable, then maybe; there > aren't very many mutable callables (by comparison to the huge number > of functions). Functions are mutable. You can edit their __defaults__, or even replace their __code_

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Andrew Barnert via Python-ideas
On Nov 18, 2019, at 10:27, Random832 wrote: > > On Mon, Nov 18, 2019, at 13:00, Andrew Barnert via Python-ideas wrote: >>def f(a, b): return a**(b+1) >>g = partial(f, b==2) >>h = lambda x: f(x, 2) >> >> Python can’t tell the difference between f, g, and h; they’re all >> variables.

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Chris Angelico
On Tue, Nov 19, 2019 at 5:26 AM Random832 wrote: > > On Mon, Nov 18, 2019, at 13:00, Andrew Barnert via Python-ideas wrote: > > def f(a, b): return a**(b+1) > > g = partial(f, b==2) > > h = lambda x: f(x, 2) > > > > Python can’t tell the difference between f, g, and h; they’re all > >

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Random832
On Mon, Nov 18, 2019, at 13:00, Andrew Barnert via Python-ideas wrote: > def f(a, b): return a**(b+1) > g = partial(f, b==2) > h = lambda x: f(x, 2) > > Python can’t tell the difference between f, g, and h; they’re all > variables. An IDE could keep track of the fact that f was bound

[Python-ideas] Re: Differentiate variables form everything else

2019-11-18 Thread Andrew Barnert via Python-ideas
On Nov 18, 2019, at 06:05, tonycst...@gmail.com wrote: > > Inability to visually identify a variable without looking at where its > placed and/or how its used is sometimes brain damaging task when it comes to > understanding code someone else wrote. What’s the difference between a variable and