summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-12-10 18:03:34 (GMT)
committerGuido van Rossum <guido@python.org>2001-12-10 18:03:34 (GMT)
commitba2485f9470c9ce6040a88336f998f5f7e73e8aa (patch)
tree7c3a9ced1f80378b49a3a8dd82030118ff8b7da3 /Objects
parentb75ba918d6f8e9744c7da4660721a0058a6968a5 (diff)
downloadcpython-ba2485f9470c9ce6040a88336f998f5f7e73e8aa.zip
cpython-ba2485f9470c9ce6040a88336f998f5f7e73e8aa.tar.gz
cpython-ba2485f9470c9ce6040a88336f998f5f7e73e8aa.tar.bz2
Fix the Python property class in a comment right.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/descrobject.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 8506302..4022e89 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -904,28 +904,29 @@ PyWrapper_New(PyObject *d, PyObject *self)
/*
class property(object):
- def __init__(self, fget=None, fset=None, fdel=None, doc=None):
- self.__get = fget
- self.__set = fset
- self.__del = fdel
- self.__doc__ = doc
-
- def __get__(self, inst, type=None):
- if self.__get is NULL:
- raise AttributeError, "unreadable attribute"
- if inst is None:
- return self
- return self.__get(inst)
-
- 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:
- raise AttributeError, "can't set attribute"
- return self.__set(inst, value)
+ def __init__(self, fget=None, fset=None, fdel=None, doc=None):
+ self.__get = fget
+ self.__set = fset
+ self.__del = fdel
+ self.__doc__ = doc
+
+ def __get__(self, inst, type=None):
+ if self.__get is None:
+ raise AttributeError, "unreadable attribute"
+ if inst is None:
+ return self
+ return self.__get(inst)
+
+ def __set__(self, inst, value):
+ if self.__set is None:
+ raise AttributeError, "can't set attribute"
+ 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 {
g_85ce4bf928'>bug_85ce4bf928 Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | * tests/socket.test: Accepted two new testcases by Stuart Casoffandreas_kupries2004-07-162-1/+11
| | | | | | | | | | <stwo@users.sourceforge.net> checking that -server and -async don't go together [Tcl SF Bug 796534].
* | * unix/tclUnixNotfy.c (NotifierThreadProc): Accepted Joeandreas_kupries2004-07-162-1/+9
| | | | | | | | | | Mistachkin's patch for [Tcl SF Bug 990500], properly closing the notifier thread when its exits.
* | * unix/tclUnixThrd.c (TclpFinalizeMutex): Accepted Joeandreas_kupries2004-07-152-0/+7
| | | | | | | | | | Mistachkin's patch for [Tcl SF Bug 99453], closing leakage of mutexes. They were not destroyed properly upon finalization.
* | Added new fix for the Tcl Bug #770053. Now we conditionaly performvasiljevic2004-07-152-3/+20
| | | | | | | | | | the TclFinalizeNotifier in order to correct broken ref-counting of the notifier thread.
* | * generic/tclIO.h (CHANNEL_INCLOSE): New flag. Set inandreas_kupries2004-07-154-5/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclIO.c (Tcl_UnregisterChannel): 'Tcl_Close' while the * generic/tclIO.c (Tcl_Close): close callbacks are run. Checked in 'Tcl_Close' and 'Tcl_Unregister' to prevent recursive call of 'close' in the close-callbacks. This is a possible error made by implementors of virtual filesystems based on 'tclvfs', thinking that they have to close the channel in the close handler for the filesystem. * generic/tclIO.c: * generic/tclIO.h: * Not reverting, but #ifdef'ing the changes from May 19, 2004 out of the core. This removes the ***POTENTIAL INCOMPATIBILITY*** for channel drivers it introduced. This has become possible due to Expect gaining a BlockModeProc and now handling blockingg and non-blocking modes correctly. Thus [SF Tcl Bug 943274] is still fixed if a recent enough version of Expect is used. * doc/CrtChannel.3: Added warning about usage of a channel without a BlockModeProc.
* | * generic/tclIOCmd.c (Tcl_PutsObjCmd): Added length check to theandreas_kupries2004-07-152-2/+9
| | | | | | | | | | | | old depreceated newline syntax, to ensure that only "nonewline" is accepted. [Tcl SF Bug 985869], reported by Joe Mistachkin <mistachkin@users.sourceforge.net>.
* | Stuffed memory leak incurred by re-initializing of TSD slotsvasiljevic2004-07-152-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | after the last call to TclFinalizeThreadData (done from within Tcl_FinalizeThread()). We basically just repeat the TclFinalizeThreadData() once more before tearing down TSD keys in TclFinalizeSynchronization(). There should be more elaborate mechanism in place for handling such issues, based on thread cleanup handlers registered on the OS level. Such change requires much more work and would also require TIP because some visible parts of Tcl API would have to be modified. In the meantime, this will do.
* | * generic/tclLiteral.c (TclReleaseLiteral): Removed unusedKevin B Kenny2004-07-152-2/+6
| | | | | | | | variable 'codePtr' to silence a message from VC++.
* | * generic/tclCompile.c (TclCompileScript):Miguel Sofer2004-07-153-20/+19
| | | | | | | | | | | | | | | | | | * generic/tclLiteral.c (TclReleaseLiteral): fix for [Bug 467523], which resurfaced with the latest changes. The previous strategy was to have special code in TclReleaseLiteral to handle the self-references generated by empty scripts. The new approach avoids the self-reference altogether, by having empty scripts return an unshared literal.
* | Removed initialization of TSD for the new thread in NewThreadProc sincevasiljevic2004-07-151-10/+1
| | | | | | | | this will result in TclInitNotifier never being called.
* | See file...vasiljevic2004-07-151-0/+5
| |
* | Removed unused variable in NewThreadProc()vasiljevic2004-07-151-2/+3
| |
* | Backout of changes to fix the Tcl Bug #770053.vasiljevic2004-07-151-5/+9
| | | | | | | | See SF bugreport for more info.
* | * generic/tclBasic.c (Tcl_EvalEx): leak fix by dgp, releaseMiguel Sofer2004-07-122-1/+7
| | | | | | | | objv[objectsUsed] on error.
* | * generic/tclParse.c (Tcl_SubstObj): leak fix by dgp, releaseMiguel Sofer2004-07-122-1/+7
| | | | | | | | result on error.
* | Another leak fix for [Bug 989093]dkf2004-07-112-1/+11
| |
* | Stop [dict unset] from leaking objects. [Bug 989093 in part]dkf2004-07-112-2/+9
| |
* | * generic/tclExecute.c (TEBC): fixed leak of expandNestList objsMiguel Sofer2004-07-112-1/+21
| | | | | | | | | | when there is an error while an expansion is in progress (code added at checkForCatch).
* | cd fix in vfsvincentdarley2004-07-11