FAQ

Dennis Lee Bieber wrote:
laotseu fed this fish to the penguins on Wednesday 08 January 2003
08:51 pm:


Ok, I got it a few minutes later :

class Truc:
def test(self):
print "old test"

a = Truc()

def test2(self):
print "new test"

a.__class__.test = test2
a.test()
new test
Of course, that has just changed the class definition. Did you really
want that?
In that case, yes, but I may not have made it clear (it was the answer
to the last question in my previous post).

(snip code)

Laotseu

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 8 of 8 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedJan 8, '03 at 8:34p
activeJan 10, '03 at 5:41a
posts8
users5
websitepython.org

People

Translate

site design / logo © 2022 Grokbase