summaryrefslogtreecommitdiffstats
path: root/Source/cmGetPropertyCommand.h
Commit message (Expand)AuthorAgeFilesLines
* Add an "installed file" property scopeNils Gladitz2014-05-281-0/+1
* stringapi: Command namesBen Boeckel2014-03-081-1/+1
* Drop builtin command documentationBrad King2013-10-161-52/+0
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-3/+3
* Add 'const' qualifier to some cmCommand membersYury G. Kudryashov2012-02-291-4/+4
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
* ENH: Teach set/get_property about CACHE propertiesBrad King2009-03-101-0/+3
* BUG: Fix typo in get_property documentationBrad King2008-09-041-1/+1
* ENH: support unset of propertiesKen Martin2008-04-011-3/+6
* ENH: add return and break support to cmake, also change basic command invocat...Ken Martin2008-01-231-1/+2
* ENH: Changed signature of GET_PROPERTY command to be more powerful and extend...Brad King2008-01-171-13/+49
* ENH: add ability to get documentaiton of a property from a scriptKen Martin2007-10-241-2/+8
* ENH: make commands lower case by defaultKen Martin2007-10-101-2/+2
* STYLE: rename chain to inherit in the docsAlexander Neundorf2007-06-261-1/+1
* ENH: added cmGetPropertyCommandKen Martin2007-06-251-0/+73
tation into +SGML or, later, XML, but performing a good conversion is a major task +and no one pursued the task to completion. + +During the 2.6 development cycle, Georg Brandl put a substantial +effort into building a new toolchain called Sphinx +for processing the documentation. +The input format is reStructured Text, +a markup commonly used in the Python community that supports +custom extensions and directives. Sphinx concentrates +on its HTML output, producing attractively styled +and modern HTML. (XXX finish this -- mention new search feature) + +.. seealso:: + + `Docutils `__: The fundamental + reStructured Text parser and toolset. + + `Documenting Python `__: Describes how to write for + Python's documentation. + + PEP 343: The 'with' statement ============================= @@ -352,6 +408,24 @@ bound to a variable, and calls ``object.close`` at the end of the block. :: .. % ====================================================================== +.. _pep-0366: + +PEP 366: Explicit Relative Imports From a Main Module +============================================================ + +Python's :option:`-m` switch allows running a module as a script. +When you ran a module that was located inside a package, relative +imports didn't work correctly. + +The fix in Python 2.6 adds a :attr:`__package__` attribute to modules. +When present, relative imports will be relative to the value of this +attribute instead of the :attr:`__name__` attribute. PEP 302-style +importers can then set :attr:`__package__`. The :mod:`runpy` module +that implements the :option:`-m` switch now does this, so relative imports +can now be used in scripts running from inside a package. + +.. % ====================================================================== + .. _pep-3110: PEP 3110: Exception-Handling Changes @@ -414,7 +488,7 @@ XXX :pep:`3119` - Introducing Abstract Base Classes PEP written by Guido van Rossum and Talin. Implemented by XXX. - Backported to 2.6 by Benjamin Aranguren (with Alex Martelli). + Backported to 2.6 by Benjamin Aranguren, with Alex Martelli. Other Language Changes ====================== @@ -443,6 +517,25 @@ Here are all of the changes that Python 2.6 makes to the core Python language. .. % Revision 57619 +* Properties now have two attributes, + :attr:`setter` and :attr:`deleter`, that are useful shortcuts for + adding a setter or deleter function to an existing property. + You would use them like this:: + + class C(object): + @property + def x(self): + return self._x + + @x.setter + def x(self, value): + self._x = value + + @x.deleter + def x(self): + del self._x + + * C functions and methods that use :cfunc:`PyComplex_AsCComplex` will now accept arguments that have a :meth:`__complex__` method. In particular, the functions in the @@ -452,11 +545,26 @@ Here are all of the changes that Python 2.6 makes to the core Python language. .. % Patch #1675423 + A numerical nicety: when creating a complex number from two floats + on systems that support signed zeros (-0 and +0), the + :func:`complex()` constructor will now preserve the sign + of the zero. + + .. % Patch 1507 + * Changes to the :class:`Exception` interface as dictated by :pep:`352` continue to be made. For 2.6, the :attr:`message` attribute is being deprecated in favor of the :attr:`args` attribute. +* The :exc:`GeneratorExit` exception now subclasses + :exc:`BaseException` instead of :exc:`Exception`. This means + that an exception handler that does ``except Exception:`` + will not inadvertently catch :exc:`GeneratorExit`. + (Contributed by Chad Austin.) + + .. % Patch #1537 + * The :func:`compile` built-in function now accepts keyword arguments as well as positional parameters. (Contributed by Thomas Wouters.) @@ -653,6 +761,20 @@ complete list of changes, or look through the CVS logs for all the details. .. % Patch #1490190 +* The :mod:`new` module has been removed from Python 3.0. + Importing it therefore + triggers a warning message when Python is running in 3.0-warning + mode. + +* New functions in the :mod:`os` module include + ``fchmod(fd, mode)``, ``fchown(fd, uid, gid)``, + and ``lchmod(path, mode)``, on operating systems that support these + functions. :func:`fchmod` and :func:`fchown` let you change the mode + and ownership of an opened file, and :func:`lchmod` changes the mode + of a symlink. + + (Contributed by Georg Brandl and Christian Heimes.) + * The :func:`os.walk` function now has a ``followlinks`` parameter. If set to True, it will follow symlinks pointing to directories and visit the directory's contents. For backward compatibility, the @@ -703,6 +825,15 @@ complete list of changes, or look through the CVS logs for all the details. changed and :const:`UF_APPEND` to indicate that data can only be appended to the file. (Contributed by M. Levinson.) +* The :mod:`random` module's :class:`Random` objects can + now be pickled on a 32-bit system and unpickled on a 64-bit + system, and vice versa. Unfortunately, this change also means + that Python 2.6's :class:`Random` objects can't be unpickled correctly + on earlier versions of Python. + (Contributed by Shawn Ligocki.) + + .. % Issue 1727780 + * The :mod:`rgbimg` module has been removed. * The :mod:`sets` module has been deprecated; it's better to @@ -725,6 +856,17 @@ complete list of changes, or look through the CVS logs for all the details. .. % Patch #957003 +* A new variable in the :mod:`sys` module, + :attr:`float_info`, is a dictionary + containing information about the platform's floating-point support + derived from the :file:`float.h` file. Key/value pairs + in this dictionary include + ``"mant_dig"`` (number of digits in the mantissa), ``"epsilon"`` + (smallest difference between 1.0 and the next largest value + representable), and several others. (Contributed by Christian Heimes.) + + .. % Patch 1534 + * The :mod:`tarfile` module now supports POSIX.1-2001 (pax) and POSIX.1-1988 (ustar) format tarfiles, in addition to the GNU tar format that was already supported. The default format @@ -883,6 +1025,17 @@ Changes to Python's build process and to the C API include: .. % Patch 1551895 +* Several functions return information about the platform's + floating-point support. :cfunc:`PyFloat_GetMax` returns + the maximum representable floating point value, + and :cfunc:`PyFloat_GetMin` returns the minimum + positive value. :cfunc:`PyFloat_GetInfo` returns a dictionary + containing more information from the :file:`float.h` file, such as + ``"mant_dig"`` (number of digits in the mantissa), ``"epsilon"`` + (smallest difference between 1.0 and the next largest value + representable), and several others. + + .. % Issue 1534 .. % ====================================================================== diff --git a/Include/abstract.h b/Include/abstract.h index e344fba..468afe9 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -1070,7 +1070,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ #define PySequence_ITEM(o, i)\ - ( Py_Type(o)->tp_as_sequence->sq_item(o, i) ) + ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) /* Assume tp_as_sequence and sq_item exist and that i does not need to be corrected for a negative index */ diff --git a/Include/boolobject.h b/Include/boolobject.h index 33f8112..7cc2f1f 100644 --- a/Include/boolobject.h +++ b/Include/boolobject.h @@ -9,7 +9,7 @@ extern "C" { PyAPI_DATA(PyTypeObject) PyBool_Type; -#define PyBool_Check(x) (Py_Type(x) == &PyBool_Type) +#define PyBool_Check(x) (Py_TYPE(x) == &PyBool_Type) /* Py_False and Py_True are the only two bools in existence. Don't forget to apply Py_INCREF() when returning either!!! */ diff --git a/Include/bytesobject.h b/Include/bytesobject.h index e9c319c..49d1d38 100644 --- a/Include/bytesobject.h +++ b/Include/bytesobject.h @@ -33,7 +33,7 @@ PyAPI_DATA(PyTypeObject) PyBytesIter_Type; /* Type check macros */ #define PyBytes_Check(self) PyObject_TypeCheck(self, &PyBytes_Type) -#define PyBytes_CheckExact(self) (Py_Type(self) == &PyBytes_Type) +#define PyBytes_CheckExact(self) (Py_TYPE(self) == &PyBytes_Type) /* Direct API functions */ PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *); @@ -45,7 +45,7 @@ PyAPI_FUNC(int) PyBytes_Resize(PyObject *, Py_ssize_t); /* Macros, trading safety for speed */ #define PyBytes_AS_STRING(self) (assert(PyBytes_Check(self)),((PyBytesObject *)(self))->ob_bytes) -#define PyBytes_GET_SIZE(self) (assert(PyBytes_Check(self)),Py_Size(self)) +#define PyBytes_GET_SIZE(self) (assert(PyBytes_Check(self)),Py_SIZE(self)) #ifdef __cplusplus } diff --git a/Include/cStringIO.h b/Include/cStringIO.h index 50f8cbe..d22b9eb 100644 --- a/Include/cStringIO.h +++ b/Include/cStringIO.h @@ -60,9 +60,9 @@ static struct PycStringIO_CAPI { /* These can be used to test if you have one */ #define PycStringIO_InputCheck(O) \ - (Py_Type(O)==PycStringIO->InputType) + (Py_TYPE(O)==PycStringIO->InputType) #define PycStringIO_OutputCheck(O) \ - (Py_Type(O)==PycStringIO->OutputType) + (Py_TYPE(O)==PycStringIO->OutputType) #ifdef __cplusplus } diff --git a/Include/cellobject.h b/Include/cellobject.h index 1036420..c927ee5 100644 --- a/Include/cellobject.h +++ b/Include/cellobject.h @@ -13,7 +13,7 @@ typedef struct { PyAPI_DATA(PyTypeObject) PyCell_Type; -#define PyCell_Check(op) (Py_Type(op) == &PyCell_Type) +#define PyCell_Check(op) (Py_TYPE(op) == &PyCell_Type) PyAPI_FUNC(PyObject *) PyCell_New(PyObject *); PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *); diff --git a/Include/cobject.h b/Include/cobject.h index 0e0ed1b..499dfad 100644 --- a/Include/cob