Skip to content

bpo-30197: Enhance functions swap_attr() and swap_item() in test.support.#1341

Merged
vstinner merged 2 commits into
python:masterfrom
serhiy-storchaka:test-support-swap-attr-item
Apr 28, 2017
Merged

bpo-30197: Enhance functions swap_attr() and swap_item() in test.support.#1341
vstinner merged 2 commits into
python:masterfrom
serhiy-storchaka:test-support-swap-attr-item

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

They now work when delete replaced attribute or item inside the with
statement. The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

…ort.

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.
@mention-bot

Copy link
Copy Markdown

@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @brettcannon, @benjaminp and @ncoghlan to be potential reviewers.

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM appart the docstring.

@@ -2124,15 +2124,16 @@ def swap_attr(obj, attr, new_val):
real_val = getattr(obj, attr)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should update the docstring.

@vstinner
vstinner merged commit d1a1def into python:master Apr 28, 2017
@serhiy-storchaka
serhiy-storchaka deleted the test-support-swap-attr-item branch April 28, 2017 16:25
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 28, 2017
…t.support. (python#1341)

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

(cherry picked from commit d1a1def)
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 28, 2017
…t.support. (pythonGH-1341)

* bpo-30197: Enhance functions swap_attr() and swap_item() in test.support.

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

* Update docstrings..
(cherry picked from commit d1a1def)
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 28, 2017
…t.support. (python#1341)

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

(cherry picked from commit d1a1def)
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 28, 2017
…t.support. (pythonGH-1341)

* bpo-30197: Enhance functions swap_attr() and swap_item() in test.support.

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

* Update docstrings..
(cherry picked from commit d1a1def)
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 28, 2017
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Apr 28, 2017
…t.support. (pythonGH-1341)

* bpo-30197: Enhance functions swap_attr() and swap_item() in test.support.

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

* Update docstrings..
(cherry picked from commit d1a1def)
serhiy-storchaka added a commit that referenced this pull request Apr 28, 2017
…t.support. (GH-1341) (#1345)

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

(cherry picked from commit d1a1def)
serhiy-storchaka added a commit that referenced this pull request Apr 28, 2017
…t.support. (#1341) (#1346)

They now work when delete replaced attribute or item inside the with
statement.  The old value of the attribute or item (or None if it doesn't
exist) now will be assigned to the target of the "as" clause, if there is
one.

(cherry picked from commit d1a1def)
serhiy-storchaka added a commit that referenced this pull request Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants