Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[docs] Specify that unittest.mock.patch.dict does not make a deepcopy #144433

Open
Labels
docsDocumentation in the Doc dir
@romuald

Description

@romuald

Documentation

I always assumed thatunittest.mock.patch.dict made a recursive (deep) copy of the dict and restored it afterwards.
It turns out it is a "simple" copy()

We should maybe clarify that in the documentation

Example:

foo= {"bar": {"baz":1}}withpatch.dict(foo, {"unrelated":123}):foo["bar"]["baz"]=2# baz will stay at 2, assumed it was reset to the original 1

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp