suggest a convention for python string quoting #19661

pull LarryRuane wants to merge 1 commits into bitcoin:master from LarryRuane:doc-python-quoting changing 1 files +4 −1
  1. LarryRuane commented at 5:59 PM on August 4, 2020: contributor

    This convention is a useful way to distinguish strings that can be changed for clarity, for example, logging messages, and strings that can't be changed, for example, arguments to bitcoind or referencing dictionary keys. There are many current counterexamples of this convention in our functional tests, but it may be nice to have a convention going forward.

    This README recommends adhering to the PEP-8 conventions, but that document says only "This PEP does not make a recommendation [on which kind of quote to use]."

  2. suggest a convention for python string quoting fa32e20b70
  3. DrahtBot added the label Docs on Aug 4, 2020
  4. DrahtBot added the label Tests on Aug 4, 2020
  5. troygiorshev commented at 7:59 PM on August 4, 2020: contributor

    I'm -0 on this.

    However, if it is decided on, can we follow the Google Python Style Guide and add:

    • It is okay to use the other quote character on a string to avoid the need to \\ escape within the string. (e.g. "Help! I'm scared of the linter!")
    • Always use the three double-quote """ format for docstrings (per PEP 257)
  6. jonatack commented at 8:10 PM on August 4, 2020: member

    -0 as well

  7. DrahtBot commented at 11:18 PM on August 4, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #19504 (Bump minimum python version to 3.6 by ajtowns)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  8. MarcoFalke commented at 7:14 AM on August 5, 2020: member

    Too controversial for a simple style change. Closing for now.

  9. MarcoFalke closed this on Aug 5, 2020

  10. jonatack commented at 7:28 AM on August 5, 2020: member

    Some questions from people about the -0 notations above. They are from the Apache voting system: https://www.apache.org/foundation/voting.html#expressing-votes-1-0-1-and-fractions

  11. laanwj commented at 10:59 AM on August 5, 2020: member

    Agree the ~0 as well. While I think it's a clever idea, this is not a sufficiently common convention (that I know) so the energy we'll have to spend as reviewers and maintainers educating people about it is too much for the slight win in code comphrehension.

  12. DrahtBot locked this on Feb 15, 2022

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-22 18:14 UTC

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