News for hackers. Stuff that matters.
Re:Metaclasses in Python by emehrkay on Thursday December 15, 2011 @12:49PM (#3357110)
Can it be done for built-in types?
Re:Metaclasses in Python by oinksoft on Thursday December 15, 2011 @12:59PM (#3357151)
No, it can't, at least not in CPython. You can import __builtin__ and clobber str, for instance, but that will not affect the behavior of existing strings, nor will it influence the behavior of string literals.

It's something that can be done in Ruby and JavaScript, but I believe it was never allowed in Python in the name of performance (you incur overhead when every number is Fixnum with the same lookup rules as any other instance, for example), and also safety.

Re:Metaclasses in Python by maaku on Thursday December 15, 2011 @12:58PM (#3357147)
No, unfortunately. That's one thing both Ruby and JS have over Python.
Re:Metaclasses in Python by storborg on Thursday December 15, 2011 @01:37PM (#3357322)
Some Python programmers might argue that's one thing Python has over Ruby and JS.
Re:Metaclasses in Python by dorkitude on Thursday December 15, 2011 @03:21PM (#3357747)
Yup (see my response)