| Store | Cart

[Python-Dev] Exception for setting attributes of built-in type

From: Benjamin Peterson <benj...@python.org>
Mon, 15 Jun 2009 14:09:00 -0500
2009/6/15 Nick Coghlan <ncoghlan at gmail.com>:
> Guido van Rossum wrote:>> In general, CPython isn't always consistent in raising AttributeError>> and TypeError when it comes to such policy issues: there are various>> places that raise TypeError in typeobject.c (and probably elsewhere)>> that simply forbid setting a specific attribute (another example is>> __name__).>> We're pretty inconsistent when it comes to looking up special methods as> well - those that are looked up through dedicated slots in abstract.c> usually raise TypeError, while those that are looked up via a PyType> method usually raise AttributeError.

What's a PyType method?



-- 
Regards,
Benjamin

Recent Messages in this Thread
Seo Sanghyeon Jun 14, 2009 07:09 pm
Terry Reedy Jun 14, 2009 10:40 pm
MRAB Jun 14, 2009 10:42 pm
Guido van Rossum Jun 14, 2009 11:19 pm
Nick Coghlan Jun 15, 2009 11:27 am
Benjamin Peterson Jun 15, 2009 07:09 pm
Nick Coghlan Jun 15, 2009 09:31 pm
Guido van Rossum Jun 15, 2009 02:48 pm
Dino Viehland Jun 15, 2009 03:54 pm
Michael Foord Jun 15, 2009 04:10 pm
Guido van Rossum Jun 15, 2009 05:10 pm
Michael Foord Jun 15, 2009 05:20 pm
Dino Viehland Jul 02, 2009 11:45 pm
Messages in this thread