Skip to content
This repository was archived by the owner on Jun 7, 2022. It is now read-only.

Python3 conversion #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Kirill888
Copy link

Hi I was wondering if you have plans to move over to Python3 for this project?

In Ubuntu 18.04 default python is now 3, so I thought I'll try converting this to 3 as well. It seems to work fine.

This is mostly automatic conversion using 2to3 with some extra edits on top of that. The only weird problem was with inheritance from namedtuple, basically A->namedtuple works fine, but
B->A->namedtuple is somehow broken. Rather than figuring it out, I just made AptRequest derive from object and set output member manually.

Just thought I'll share this via pull request, feel free to reject this if you need to stay in python2 for a while.

2to3 with some manual cleanup
Basically you are supposed to use __new__ instead of __init__ or some such, just
"don't derive from namedtuple" is easier, even if this means losing immutability
for `output` parameter.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant