Description
The Python Software Foundation is dropping Python 2.7 support in 1.5 years (Jan 1, 2020) (ref). The major scientific python packages (numpy, pandas, matplotlib, scipy, etc.) are dropping Python 2.7 support in less than a year, though this is a little nuanced and depends on the package (ref).
The question here is should we commit to a plan for dropping Python 3 support, or should we wait until it's unavoidable?
Here's a list of pros and cons that I see for moving pvlib to python 3 only and a date for dropping python 3 support. This is specific to pvlib and python 3, rather than python 3 overall...
Pros:
- We can advertise pvlib on https://python3statement.org/
- Remove a small amount of compatibility code
- keyword only arguments could be useful for some complicated pvlib function signatures
- Matrix multiplication operator (3.5+)
- Better unpacking (useful for kwargs magic) (3.5+)
- We can (maybe) use f-strings in pvlib (3.6+)
- dict retains ordering, so no need to use OrderedDict in pvlib (3.6+)
- Maybe type annotations (3.7+) but I think the scientific python community is going to have to struggle with this for a bit
Cons:
- It's an unnecessary burden for people that are tied to 2.7
Proposed dates:
- 2019-06-01 (@wholmgren)
I think these pros are small but meaningful, especially once we can commit to 3.6+, while the cons are unknown because I don't have a good understanding of how many pvlib users are on 2.7 and what might be holding them back. My understanding is that download statistics from pypi and anaconda are not very reliable for this question, but I will still try to compile some soon.
Again, this is a discussion about pvlib moving to python 3 only -- it is not a discussion about the merits of python 3 overall. For example, while the new Python 3.7 breakpoint
function looks great, it's not going to be used within pvlib so it's irrelevant to the discussion.
Anyone watching that is tied to 2.7 should speak now, because I think there are a handful of contributors that would like to push us to python 3 only sooner than later!
So, please post a date you'd like to see pvlib commit to Python 3+ only and list any additional pros and cons. I will update the lists as people post.