A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-February/077174.html below:

[Python-Dev] can't set attributes of built-in/extension type

[Python-Dev] can't set attributes of built-in/extension type [Python-Dev] can't set attributes of built-in/extension typeGreg Ewing greg.ewing at canterbury.ac.nz
Sun Feb 24 08:35:51 CET 2008
Neal Becker wrote:
> (Or, help me understand, what is the difference between a type that I create
> using python C api and a python class?)

Classes that you create in Python have a __dict__ attribute
holding a dictionary for arbitrary attributes to go in.

Most types defined in C don't bother providing a __dict__,
since one doesn't normally need to add arbitrary
attributes to them, and the overhead would be almost
completely wasted.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4