Re: What makes functions special?

2011-07-10 Thread Terry Reedy
On 7/9/2011 6:34 PM, Steven D'Aprano wrote: Suppose instead an implementation of Python did not pre-compile the function. Each time you called spam(n), the implementatio n would have to locate the source code and interpret it on the spot. Would that be allowed?" If that's your question, then I

Re: What makes functions special?

2011-07-09 Thread Carl Banks
On Saturday, July 9, 2011 2:28:58 PM UTC-7, Eric Snow wrote: > A tracker issue [1] recently got me thinking about what makes > functions special. The discussion there was regarding the distinction > between compile time (generation of .pyc files for modules and > execution of

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 7:34 PM, Steven D'Aprano wrote: > Eric Snow wrote: > >> Mostly I am just >> trying to put together more pieces of the Python puzzle.  In this case >> I was trying to find out if the optimized execution of code objects >> for functions is a part of the language or just an imp

Re: What makes functions special?

2011-07-09 Thread Steven D'Aprano
Eric Snow wrote: > Mostly I am just > trying to put together more pieces of the Python puzzle. In this case > I was trying to find out if the optimized execution of code objects > for functions is a part of the language or just an implementation > detail. You keep using that phrase, "optimized e

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 6:38 PM, Ben Finney wrote: > Eric Snow writes: > >> On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney >> wrote: >> > Eric Snow writes: >> >> No other objects have code objects. No other objects in Python have >> >> this special optimization. >> > >> > Yes. The two facts are dir

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 6:21 PM, Terry Reedy wrote: > On 7/9/2011 2:28 PM, Eric Snow wrote: >> >> A tracker issue [1] recently got me thinking about what makes >> functions special.  The discussion there was regarding the distinction >> between compile time (generatio

Re: What makes functions special?

2011-07-09 Thread Ben Finney
Eric Snow writes: > On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney wrote: > > Eric Snow writes: > >> No other objects have code objects. No other objects in Python have > >> this special optimization. > > > > Yes. The two facts are directly related. […] > > Yes, functions are different and are tre

Re: What makes functions special?

2011-07-09 Thread Terry Reedy
On 7/9/2011 2:28 PM, Eric Snow wrote: A tracker issue [1] recently got me thinking about what makes functions special. The discussion there was regarding the distinction between compile time (generation of .pyc files for modules and execution of code blocks), [function] definition time, and

Re: What makes functions special?

2011-07-09 Thread Eric Snow
On Sat, Jul 9, 2011 at 4:41 PM, Ben Finney wrote: > Eric Snow writes: > >> A tracker issue [1] recently got me thinking about what makes >> functions special. > > As you describe, functions are special for your scenario because a > function definition needs to resu

Re: What makes functions special?

2011-07-09 Thread Ben Finney
Eric Snow writes: > A tracker issue [1] recently got me thinking about what makes > functions special. As you describe, functions are special for your scenario because a function definition needs to result in executable code as an object. > Definition time actually happens during com

What makes functions special?

2011-07-09 Thread Eric Snow
A tracker issue [1] recently got me thinking about what makes functions special. The discussion there was regarding the distinction between compile time (generation of .pyc files for modules and execution of code blocks), [function] definition time, and [function] execution time. Definition time