Better ways to do things under Python 3 #12735

issue mcdallas opened this issue on March 20, 2018
  1. mcdallas commented at 2:28 PM on March 20, 2018: none

    Following the drop of Python 2 support in the next release (#11881) and specifically this comment, I am listing some new Python 3 features that can replace some old ones.

    New in 3.4

    New in 3.5

    New in 3.6

  2. jnewbery commented at 3:37 PM on March 20, 2018: member

    Thanks @mcdallas - feel free to open PRs if you think changing individual python modules to use those new features is a genuine improvement (rather than just changing to the new thing because it's the new thing).

    I don't think we need an issue to track this - just PRs for the individual changes.

  3. mcdallas commented at 3:45 PM on March 20, 2018: none

    @jnewbery I can send some PRs, just want to make sure what is the minimum version you are looking to support? For example ubuntu 16.04 ships with Python 3.5.2 which doesn't support f-strings.

  4. jnewbery commented at 3:48 PM on March 20, 2018: member

    I think we need to support 3.4 at a minimum. See #9485 (comment).

  5. fanquake assigned fanquake on Mar 20, 2018
  6. fanquake unassigned fanquake on Mar 20, 2018
  7. fanquake added the label Brainstorming on Mar 20, 2018
  8. MarcoFalke commented at 11:05 AM on March 21, 2018: member

    Agree on what @jnewbery said.

    New in 3.4

    I think we'd need to support python 3.4 until at least April 2019 (EOL for trusty), so the only thing we could make use of is the pathlib module. Generally, just refactoring for the sake of refactoring is discouraged. Though, I wouldn't object changing to the pathlib module when you have to touch the file for other reasons or when using the pathlib module gives large simplifications.

    New in 3.5

    Using a method that is faster is fine, when it comes "for free". However, since we'd have to support python 3.5 for a while, I don't think we can do that anytime soon. Also, wherever this is used, the bottleneck is not in this method call, so probably not worth trying to optimize.

  9. MarcoFalke commented at 11:06 AM on March 21, 2018: member

    Closing.

    Pull requests welcome, but no need to keep an issue open about purely refactoring related code changes.

  10. MarcoFalke closed this on Mar 21, 2018

  11. DrahtBot locked this on Sep 8, 2021

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-14 21:15 UTC

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