Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Why dosn't this work

Name: Anonymous 2008-11-15 22:20


>>> class A():
    def kill(self):
        del self

>>> a = A()
>>> a.kill()
>>> a
<__main__.A instance at 0x01F23170>


???

Name: Anonymous 2008-11-15 22:21

def kill del

ZOMG POINTFREE FIOC

Name: Anonymous 2008-11-15 22:26

It only deletes the reference to `self'.

Name: Anonymous 2008-11-15 22:32

then how can I make a class instance delete itself?

Name: Anonymous 2008-11-15 22:32

same as
class A()
    def kill(batman):
        del batman

Name: Anonymous 2008-11-15 22:33

Read the documentation.

Name: Anonymous 2008-11-15 23:22

>>4
Nuke it from orbit. It's the only way to be sure.

Name: Anonymous 2008-11-16 0:44

>>4
You can't. It's NP-complete.

Name: Anonymous 2008-11-16 2:05

>>4
You can't make an apple eat itself.

Name: Anonymous 2008-11-16 3:03

>>9
[code]sudo rm -rf /[/sudo]

Name: Anonymous 2008-11-16 3:15

>>4
You don't. Welcome to garbage collected languages.

Name: Anonymous 2008-11-16 7:16

Because "del self" just removes the variable "self" from the local variable dictionary.

Name: Anonymous 2008-11-16 9:11

>>10
HAHA OH WOW

Nice fucked up short term memory you got there, chump.

Name: Anonymous 2008-11-16 9:16

Name: Anonymous 2008-11-16 9:18

>>12,14
See >>3

Name: Anonymous 2008-11-16 12:31

>>11
More like ``reference counted'' languages.

Name: Anonymous 2009-03-06 6:41

sudo this is ubuntu.

Name: Trollbot9000 2009-07-01 9:55

Kill from time to parse than REALLYLONGTAGNAME.

Name: Anonymous 2010-11-15 5:12

Name: Anonymous 2010-12-10 14:39

Name: Anonymous 2011-01-31 20:41

<-- check em dubz

Don't change these.
Name: Email:
Entire Thread Thread List