test: Fix extra_args in wallet_import_rescan.py #16920

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:1909-testUseCorrectPythonSyntax changing 1 files +1 −1
  1. MarcoFalke commented at 7:41 PM on September 19, 2019: member

    Bug introduced by me (:man_facepalming:) in fa25668e1c8982548f1c6f94780709c625811469

    For reference:

    >>> a = [[]]*2
    >>> a[0] += ['ONE']
    >>> a
    [['ONE'], ['ONE']]
    
    
    >>> a = [[] for _ in range(2)]
    >>> a[0] += ['ONE']
    >>> a
    [['ONE'], []]
    
    
  2. test: Fix extra_args in wallet_import_rescan.py fa2e038691
  3. fanquake added the label Tests on Sep 19, 2019
  4. theStack commented at 10:23 PM on September 19, 2019: member

    utACK fa2e038

    Another way to show what's going on here, the first variant obviously creates two list elements pointing to the same object:

    >>> a = [[]]*2
    >>> id(a[0]) == id(a[1])
    True
    >>> a = [[] for _ in range(2)]
    >>> id(a[0]) == id(a[1])
    False
    
  5. MarcoFalke referenced this in commit f8b0b190aa on Sep 20, 2019
  6. MarcoFalke merged this on Sep 20, 2019
  7. MarcoFalke closed this on Sep 20, 2019

  8. MarcoFalke deleted the branch on Sep 20, 2019
  9. jasonbcox referenced this in commit 881ae3dd22 on Oct 22, 2020
  10. DrahtBot locked this on Dec 16, 2021
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me