Declaring A Function Argument As Global?

Tim Daneliuk tundra at tundraware.com
Thu Jan 16 13:40:07 EST 2003


Skip Montanaro wrote:
> I believe this should work
> 
>     def lhandler(list):
>         list[:] = list[1:]
> 
> Skip
> 

'Works like a charm.  But why?  I thought list[:] merely makes a copy of
something - obviously there is more to the story if it is on the LHS.
'Care to explain the semantics here?

Many thanks to all who responded...
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com





More information about the Python-list mailing list