py: Add optional support for descriptors' __get__ and __set__ methods.

Disabled by default.  Enabled on unix and windows ports.
This commit is contained in:
stijn
2015-02-14 18:43:54 +01:00
committed by Damien George
parent c260836beb
commit 28fa84b445
7 changed files with 99 additions and 23 deletions

View File

@@ -393,8 +393,9 @@ dispatch_loop:
DISPATCH();
}
#else
// This caching code works with MICROPY_PY_BUILTINS_PROPERTY enabled because
// if the attr exists in self->members then it can't be a property. A
// This caching code works with MICROPY_PY_BUILTINS_PROPERTY and/or
// MICROPY_PY_DESCRIPTORS enabled because if the attr exists in
// self->members then it can't be a property or have descriptors. A
// consequence of this is that we can't use MP_MAP_LOOKUP_ADD_IF_NOT_FOUND
// in the fast-path below, because that store could override a property.
ENTRY(MP_BC_STORE_ATTR): {