Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5f171ae9
Commit
5f171ae9
authored
Jan 17, 2008
by
Christian Heimes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated new property syntax. An elaborate example for subclassing and the getter was missing.
Added comment about VS 2008 and PGO builds.
parent
c83ea31a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
Doc/whatsnew/2.6.rst
Doc/whatsnew/2.6.rst
+22
-4
No files found.
Doc/whatsnew/2.6.rst
View file @
5f171ae9
...
@@ -652,10 +652,10 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
...
@@ -652,10 +652,10 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
.. Revision 57619
.. Revision 57619
* Properties now have t
wo attributes,
* Properties now have t
hree attributes, :attr:`getter`,
:attr:`setter` and :attr:`deleter`, that are useful shortcuts for
:attr:`setter` and :attr:`deleter`, that are useful shortcuts for
adding
a setter or deleter function to an existing property.
adding
or modifying a getter, setter or deleter function to an
You would use them like this::
existing property.
You would use them like this::
class C(object):
class C(object):
@property
@property
...
@@ -670,6 +670,15 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
...
@@ -670,6 +670,15 @@ Here are all of the changes that Python 2.6 makes to the core Python language.
def x(self):
def x(self):
del self._x
del self._x
class D(C):
@C.x.getter
def x(self):
return self._x * 2
@x.setter
def x(self, value):
self._x = value / 2
* C functions and methods that use
* C functions and methods that use
:cfunc:`PyComplex_AsCComplex` will now accept arguments that
:cfunc:`PyComplex_AsCComplex` will now accept arguments that
...
@@ -1336,6 +1345,7 @@ Port-Specific Changes: Windows
...
@@ -1336,6 +1345,7 @@ Port-Specific Changes: Windows
API. The :func:`getwch` function reads a keypress and returns a Unicode
API. The :func:`getwch` function reads a keypress and returns a Unicode
value, as does the :func:`getwche` function. The :func:`putwch` function
value, as does the :func:`getwche` function. The :func:`putwch` function
takes a Unicode character and writes it to the console.
takes a Unicode character and writes it to the console.
(Contributed by Christian Heimes.)
* :func:`os.path.expandvars` will now expand environment variables
* :func:`os.path.expandvars` will now expand environment variables
in the form "%var%", and "~user" will be expanded into the
in the form "%var%", and "~user" will be expanded into the
...
@@ -1350,7 +1360,15 @@ Port-Specific Changes: Windows
...
@@ -1350,7 +1360,15 @@ Port-Specific Changes: Windows
that expands environment variable references such as ``%NAME%``
that expands environment variable references such as ``%NAME%``
in an input string. The handle objects provided by this
in an input string. The handle objects provided by this
module now support the context protocol, so they can be used
module now support the context protocol, so they can be used
in :keyword:`with` statements.
in :keyword:`with` statements. (Contributed by Christian Heimes.)
* The new default compiler on Windows is Visual Studio 2008 (VS 9.0). The
build directories for Visual Studio 2003 (VS7.1) and 2005 (VS8.0)
were moved into the PC/ directory. The new PCbuild directory supports
cross compilation for X64, debug builds and Profile Guided Optimization
(PGO). PGO builds are roughly 10% faster than normal builds.
(Contributed by Christian Heimes with help from Amaury Forgeot d'Arc and
Martin von Loewis.)
.. ======================================================================
.. ======================================================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment