Skip to content

Python Version#25

Open
vmuriart wants to merge 6 commits into
dlenski:masterfrom
vmuriart:py36
Open

Python Version#25
vmuriart wants to merge 6 commits into
dlenski:masterfrom
vmuriart:py36

Conversation

@vmuriart

Copy link
Copy Markdown

Removes compatibility to versions older than 3.6 and uses some of the new features.

I didn't implement them throughout the code since it would require a few sections of the code to be refactored in order to use them to their full extent. So this is more of a preview 😄

@dlenski dlenski left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! (As discussed in #18.)

I realized that there are probably some folks using wtf on ancient systems where there's no default Python 3.6+, or even no default Python 3.0+ (cough RHEL/CentOS 6 cough 💩).

I created a python27 branch (currently matching master), and we should add a bit of documentation explaining how to install this with Python 2.7 where needed.

Comment thread wtf.py
@vmuriart

Copy link
Copy Markdown
Author

Thanks! (As discussed in #18.)

I realized that there are probably some folks using wtf on ancient systems where there's no default Python 3.6+, or even no default Python 3.0+ (cough RHEL/CentOS 6 cough 💩).

I created a python27 branch (currently matching master), and we should add a bit of documentation explaining how to install this with Python 2.7 where needed.

what is the default version of Python in CentOS 6? Seems like it is 2.7, but i havent found anything concrete for it

@dlenski

dlenski commented Jun 17, 2021

Copy link
Copy Markdown
Owner

what is the default version of Python in CentOS 6? Seems like it is 2.7, but i havent found anything concrete for it

Yep, that's what it is on all the ancient CentOS 6 servers which I've ever had the misfortune of using 😂. (No wait, I think one of them only had 2.6 but 💩.)

Ubuntu 16.04/xenial is the other common-but-ancient distribution which doesn't have Python 3.6+ (it has Python 3.5). I believe that everything in here except f""-strings will work with Python 3.5.

@vmuriart

Copy link
Copy Markdown
Author

I was just about to say, that if we remove the f-strings, it can remain 3.5 compatible. And the only thing missing for 2.7 would be for them to install the backport of pathlib.
I can edit the PR to remove f-strings and add a try/except for the backport of pathlib if 2.7 users want to try to use a newer version of wtf

Comment thread wtf.py
@@ -1,10 +1,11 @@
#!/usr/bin/env python

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change python to python3 here. See #26.

@DimitriPapadopoulos

DimitriPapadopoulos commented Oct 7, 2022

Copy link
Copy Markdown

Perhaps change or remove this sentence from the README?

It should run correctly with either Python 2.7 or 3.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants