Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 11:21 am, Emile van Sebille wrote: > On 12/29/2009 7:02 AM Joel Davis said... > > > On Dec 29, 2:29 am, "Gabriel Genellina" > > wrote: > >> I'm sure other limitations apply too -- don't rely on this technique for > >> anything

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 10:08 am, Steve Holden wrote: > Joel Davis wrote: > > On Dec 29, 2:04 am, Steven D'Aprano > > wrote: > >> On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: > >>> my thanks go out to Emile and Mr Hanson for their responses, I think >

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 2:29 am, "Gabriel Genellina" wrote: > En Tue, 29 Dec 2009 00:28:32 -0300, Joel Davis   > escribió: > > > > > On Dec 28, 9:37 pm, Joel Davis wrote: > > my thanks go out to Emile and Mr Hanson for their responses, I think > > I&

Re: getting name of passed reference

2009-12-29 Thread Joel Davis
On Dec 29, 2:04 am, Steven D'Aprano wrote: > On Mon, 28 Dec 2009 19:28:32 -0800, Joel Davis wrote: > > my thanks go out to Emile and Mr Hanson for their responses, I think > > I've found the solution, much shorter as well: > > >     > #!/usr/bin/python > &g

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
On Dec 28, 9:37 pm, Joel Davis wrote: > As far as more positive things are concerned, is anyone aware of what > the support for _getframe(1) the way I used it is? Does steven have a > newer (or older) version than me, maybe? (2.6.2) it seems like the > sort of thing that ought to

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
As far as more positive things are concerned, is anyone aware of what the support for _getframe(1) the way I used it is? Does steven have a newer (or older) version than me, maybe? (2.6.2) it seems like the sort of thing that ought to have pretty uniform behavior, but are their certain calls it var

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
On Dec 28, 8:40 pm, Steven D'Aprano wrote: > On Mon, 28 Dec 2009 17:27:21 -0800, Joel Davis wrote: > > For posterity, I figured out a solution: > > >  > #!/usr/bin/python > > >  > import sys > >  > from traceback import extract_stack > > >

Re: getting name of passed reference

2009-12-28 Thread Joel Davis
frame = sys._getframe(1) > print extract_stack(frame,2)[0][3] > MyFunc(varPassed) the print statement returns the full function call including parameters as they were written in the script (variable names and all) On Dec 28, 8:10 pm, Emile van Sebille wrote: > On 12/28/

getting name of passed reference

2009-12-28 Thread Joel Davis
I'm just curious if anyone knows of a way to get the variable name of a reference passed to the function. Put another way, in the example: def MyFunc ( varPassed ): print varPassed; MyFunc(nwVar) how would I get the string "nwVar" from inside of "MyFunc"? is it possible? -- http://mai

Re: Partial list comprehensions

2009-12-04 Thread Joel Davis
On Dec 4, 3:41 pm, Mensanator wrote: > On Dec 4, 2:22 pm, Joel Davis wrote: > > > Is it possible to run a list comprehension over a certain portion of > > the list? My goals is to be able to run the comprehension on the > > innermost elements of the list, but leav

Partial list comprehensions

2009-12-04 Thread Joel Davis
Is it possible to run a list comprehension over a certain portion of the list? My goals is to be able to run the comprehension on the innermost elements of the list, but leaving the outermost intact. -- http://mail.python.org/mailman/listinfo/python-list

Unpacking Tuples

2009-11-30 Thread Joel Davis
I hate to post such a simple Q and A here, but I seriously can't find it anywhere. Python (unsure of starting with which version) enables the remainder of the tuple to be placed in a "catch-all", for example: >> myTuple = (1,2,3,4) >> varOne, varTwo, *remaindingTuple = myTuple. where the values

Re: filename of calling function?

2009-11-28 Thread Joel Davis
On Nov 28, 11:40 am, Phlip wrote: > On Nov 28, 8:19 am, Phlip wrote: > > > > > Consider these two python modules: > > > aa.py > > > def a(): > >     print '?' > > > bb.py > >   import aa > > > def bb(): > >   aa.a() > > > bb() > > > How do I make the print line emit the filename of bb.py? (It cou

Re: python gui builders

2009-11-17 Thread Joel Davis
On Nov 16, 5:06 am, me wrote: > Good People > > I do not write stuff for humans, as it has been my job to remove > humans from the loop. But I have to make a front end to a > component database where everything was built in Python. > > I have looked at the Tk stuff that is built into Python -> not

Re: python simply not scaleable enough for google?

2009-11-12 Thread Joel Davis
On Nov 12, 10:07 am, mcherm wrote: > On Nov 11, 7:38 pm, Vincent Manis wrote: > > > 1. The statement `Python is slow' doesn't make any sense to me. > > Python is a programming language; it is implementations that have > > speed or lack thereof. >    [...] > > 2. A skilled programmer could build a