Re: binding names doesn't affect the bound objects (was: print doesn't respect file inheritance?)

2008-07-28 Thread bukzor
On Jul 26, 7:08 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > On Sat, 26 Jul 2008 14:07:52 +1000 > > Ben Finney <[EMAIL PROTECTED]> wrote: > > >     sys.stdout = n > > > Re-binds the name 'sys.stdout' to the object already referenced by the > > name 'n'. No objects are changed by this; only b

Re: binding names doesn't affect the bound objects

2008-07-26 Thread Ben Finney
"D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: > Hmm. Are you saying that the following doesn't work? > > $ python > >>> f = open("test", "w") > >>> import sys > >>> sys.stdout = f > >>> print "test message" > >>> sys.exit(0) > $ cat test > test message > > > In other words, you can't change th

Re: binding names doesn't affect the bound objects (was: print doesn't respect file inheritance?)

2008-07-26 Thread D'Arcy J.M. Cain
On Sat, 26 Jul 2008 14:07:52 +1000 Ben Finney <[EMAIL PROTECTED]> wrote: > > sys.stdout = n > > Re-binds the name 'sys.stdout' to the object already referenced by the > name 'n'. No objects are changed by this; only bindings of names to > objects. I do agree that the object formerly known as