Issue 29776: Modernize properties - Python tracker (original) (raw)

Issue29776

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/73962

classification

Title: Modernize properties
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.7

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ethan.furman, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-03-09 17:10 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 585 merged serhiy.storchaka,2017-03-09 17:12
Messages (5)
msg289309 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-09 17:10
Following PR updates Python sources to use new shiny syntax for properties. It replaces the old code def _foo(self): ... def _set_foo(self, value): ... foo = property(_foo, _set_foo) with the new code @property def foo(self): ... @foo.setter def foo(self, value): ... New syntax was added in Python 2.4.
msg289315 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2017-03-09 17:32
Have you made sure nothing calls the replaced functions manually? Such as: ... self._set_foo(9) ...
msg289316 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-09 17:38
I replaced only private getters and setters. All tests passed.
msg289325 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-09 20:09
I have checked and none from replaced function is used. But just for the case I reverted changes for Lib/xml/dom/. Here used more complex logic for generating other properties.
msg290165 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-03-24 22:09
New changeset bdf6b910f9ea75609caee498a975af03b6d23f67 by Serhiy Storchaka in branch 'master': bpo-29776: Use decorator syntax for properties. (#585) https://github.com/python/cpython/commit/bdf6b910f9ea75609caee498a975af03b6d23f67
History
Date User Action Args
2022-04-11 14:58:44 admin set github: 73962
2017-03-24 22:09:17 serhiy.storchaka set messages: +
2017-03-19 06:41:14 serhiy.storchaka set status: open -> closedresolution: fixedstage: patch review -> resolved
2017-03-09 20:09:28 serhiy.storchaka set messages: +
2017-03-09 17:38:57 serhiy.storchaka set messages: +
2017-03-09 17:32:29 ethan.furman set nosy: + ethan.furmanmessages: +
2017-03-09 17:12:28 serhiy.storchaka set pull_requests: + <pull%5Frequest482>
2017-03-09 17:10:02 serhiy.storchaka create