LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author] [stats]
  From: Andrew Pullin <andrew@hotspurbgc.com.au>
  To  : Andrew Reid <andrew.reid@plug.cx>
<linuxsa@linuxsa.org.au> Date: Wed, 7 Nov 2001 11:10:55 +1000

Re: Unsetting variables in Python

Hi all,
    Why do you need to "unset" a variable? In most other
languages that I have programmed in, if you need to "unset"
a variable then you usually give it a null value, ie stringv
= "". If it is a memory issue and a variable is of a set
length then you would free the memory using the appropriate
command. Are you trying to free up memory here? If not, why
bother killing the variable at all? If memory is not an
issue, then a dead variable won't make any difference
anyhow. If the program doesn't refer to the variable again
then it just takes up space. Sorry if this isn't much help,
but I am interested why you need to do this.
    Cheers!
        Andrew.


----- Original Message -----
From: Andrew Reid <andrew.reid@plug.cx>
To: <linuxsa@linuxsa.org.au>
Sent: Tuesday, November 06, 2001 1:19 PM
Subject: Unsetting variables in Python


> Hrmm.. A little question for someone that might know
Python a little
> better than I do.
>
> In just about every other language that I've coded in,
there is an
> unset() function of sorts that obliterates the variable
that you pass
> it, such that it is no longer available to be refered to.
>
>     PHP Example:
>
>     $test = "This is a test";
>     printf ($test);
>     unset ($test);
>     // $test is no longer available to be used. It may be
redeclared
>     though.
>
> Does anyone know the Python equivelant, if there is one?
>
>    - andrew
>
> --
> void signature(){
>     cout << "Andrew Reid -- andrew.reid@plug.cx" << endl;
>     cout << "Cell: +61 401 946 813" << endl;
>     cout << "Quidquid latine dictum sit, altum viditur" <<
endl;
> }
>
> --
> LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on
irc.linux.org.au
> To unsubscribe from the LinuxSA list:
>   mail linuxsa-request@linuxsa.org.au with "unsubscribe"
as the subject

-- 
LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author] [stats]
Return to the LinuxSA Mailing List Information Page