Thomas Jollans wrote:
On 30/07/11 20:39, Ethan Furman wrote:
How it works: since the sys.argv object does yet exist, I create an
object and assign it to sys.argv; then, when Python assigns the actual
argv to sys.argv, my object is tossed, and the __del__ method is called;
the __del__ method is t
On 30/07/11 20:39, Ethan Furman wrote:
> How it works: since the sys.argv object does yet exist, I create an
> object and assign it to sys.argv; then, when Python assigns the actual
> argv to sys.argv, my object is tossed, and the __del__ method is called;
> the __del__ method is then able to acces
Chris Angelico wrote:
On Sat, Jul 30, 2011 at 7:39 PM, Ethan Furman wrote:
Well, you /could/ have followed the link and read the explanation there...
;)
I tend to avoid clicking random links in posts :)
Ah -- I understand.
How it works: since the sys.argv object does yet exist...
That's
On Sat, Jul 30, 2011 at 7:39 PM, Ethan Furman wrote:
> Well, you /could/ have followed the link and read the explanation there...
> ;)
I tend to avoid clicking random links in posts :)
> How it works: since the sys.argv object does yet exist...
That's the bit I didn't understand. I assume that'
Chris Angelico wrote:
I'm afraid I don't understand this. Why create an object and do the
work in the destructor? When will the destructor be called? Will you
subsequently be overwriting sys.argv with the actual arguments?
This code snippet makes excellent sense if and only if it's executed
befo
On Sat, Jul 30, 2011 at 6:23 PM, Ethan Furman wrote:
> 8<-- sitecustomize.py -
> class SetTitle(object):
> def __del__(self):
> command = ' '.join(sys.argv)
>
> sys.argv = SetTitle()
I'm afraid I don't understand this. Why create an object and do the
work