LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author] [stats]
  From: Andrew Reid <andrew.reid@plug.cx>
  To  : Andrew Pullin <andrew@hotspurbgc.com.au>
  Date: 07 Nov 2001 13:26:42 -0930

Re: Unsetting variables in Python

On Wed, 2001-11-07 at 12:40, Andrew Pullin wrote:

>     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.

For this particular application, I suppose that I could have just
assigned NULL to the variable.

unset()-ish functions would be used for ``if-defined'' clauses -- a
variable can be declared as NULL.

   - 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


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