types.ClassType
We can provide a custom metaclass by setting
__metaclass__
in a class definition to any callable that takes the same arguments astype
.
When the Python interpreter executes a class statement […], it calls type with the following arguments:
a descriptor is an object attribute with “binding behavior”, one whose attribute access has been overridden by methods in the descriptor protocol.
Descriptors that only define get are called non-data descriptors (they are typically used for methods but other uses are possible).
If an object defines both
__get__
and__set__
, it is considered a data descriptor.
overriding
__getattribute__
prevents automatic descriptor calls
If an instance’s dictionary has an entry with the same name as a data descriptor, the data descriptor takes precedence. If an instance’s dictionary has an entry with the same name as a non-data descriptor, the dictionary entry takes precedence.
In about two minutes, discussion on PEP 405 came and went. Carl Meyer mentioned that a reference implementation is available and is working pretty well.
Django 1.5 will begin to experimentally support Python 3. Python 2.6 will be the minimum requirement.
very handy for preventing back button issues.
from django.views.decorators.cache import cache_control