Commit ba2485f9 authored by Guido van Rossum's avatar Guido van Rossum

Fix the Python property class in a comment right.

parent b75ba918
...@@ -911,21 +911,22 @@ PyWrapper_New(PyObject *d, PyObject *self) ...@@ -911,21 +911,22 @@ PyWrapper_New(PyObject *d, PyObject *self)
self.__doc__ = doc self.__doc__ = doc
def __get__(self, inst, type=None): def __get__(self, inst, type=None):
if self.__get is NULL: if self.__get is None:
raise AttributeError, "unreadable attribute" raise AttributeError, "unreadable attribute"
if inst is None: if inst is None:
return self return self
return self.__get(inst) return self.__get(inst)
def __set__(self, inst, value): def __set__(self, inst, value):
if value is None:
if self.__del is None:
raise AttributeError, "can't delete attribute"
return self.__del(inst)
else:
if self.__set is None: if self.__set is None:
raise AttributeError, "can't set attribute" raise AttributeError, "can't set attribute"
return self.__set(inst, value) return self.__set(inst, value)
def __delete__(self, inst):
if self.__del is None:
raise AttributeError, "can't delete attribute"
return self.__del(inst)
*/ */
typedef struct { typedef struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment