Skip to content

bpo-39482: Add a fixer to handling abstract base classes#18245

Closed
corona10 wants to merge 2 commits intopython:masterfrom
corona10:bpo-39482
Closed

bpo-39482: Add a fixer to handling abstract base classes#18245
corona10 wants to merge 2 commits intopython:masterfrom
corona10:bpo-39482

Conversation

@corona10
Copy link
Member

@corona10 corona10 commented Jan 29, 2020

@corona10 corona10 requested a review from rhettinger as a code owner January 29, 2020 09:18
@corona10 corona10 changed the title bpo-39842: WIP add fix_collections_import.py bpo-39842: [WIP] add fix_collections_import.py Jan 29, 2020
@corona10 corona10 changed the title bpo-39842: [WIP] add fix_collections_import.py bpo-39482: [WIP] add fix_collections_import.py Jan 29, 2020
@codecov
Copy link

codecov bot commented Jan 29, 2020

Codecov Report

Merging #18245 into master will increase coverage by 1.07%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #18245       +/-   ##
===========================================
+ Coverage   82.12%   83.19%    +1.07%     
===========================================
  Files        1955     1571      -384     
  Lines      588711   414280   -174431     
  Branches    44382    44412       +30     
===========================================
- Hits       483452   344670   -138782     
+ Misses      95631    59968    -35663     
- Partials     9628     9642       +14     
Impacted Files Coverage Δ
Lib/distutils/tests/test_bdist_rpm.py 30.00% <0.00%> (-65.00%) ⬇️
Lib/distutils/command/bdist_rpm.py 7.63% <0.00%> (-56.88%) ⬇️
Lib/test/test_urllib2net.py 76.92% <0.00%> (-13.85%) ⬇️
Lib/test/test_smtpnet.py 78.57% <0.00%> (-7.15%) ⬇️
Lib/ftplib.py 63.85% <0.00%> (-6.06%) ⬇️
Lib/test/test_ftplib.py 87.11% <0.00%> (-4.72%) ⬇️
Tools/scripts/db2pickle.py 17.82% <0.00%> (-3.97%) ⬇️
Tools/scripts/pickle2db.py 16.98% <0.00%> (-3.78%) ⬇️
Lib/test/test_socket.py 71.94% <0.00%> (-3.77%) ⬇️
Lib/test/test_asyncio/test_base_events.py 91.84% <0.00%> (-3.30%) ⬇️
... and 442 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a65eba...6aac871. Read the comment docs.

@corona10 corona10 force-pushed the bpo-39482 branch 3 times, most recently from aec65cf to 7cec2fa Compare January 29, 2020 17:10
@corona10 corona10 changed the title bpo-39482: [WIP] add fix_collections_import.py bpo-39482: Add a fixer to handling abstract base classes Jan 29, 2020
@corona10
Copy link
Member Author

corona10 commented Jan 29, 2020

@tirkarthi @benjimin @vstinner @rhettinger

Dear core developers,
Please take a look and is it good to add news for 3.9?

@vstinner
Copy link
Member

This fixer drops compatibility with Python 2, right? Is it a good idea? I don't know.

I stopped to use 2to3 a few years ago, since this tool adds many useless changes (to support early Python 3.x versions) and it drops support for Python 2.

@corona10
Copy link
Member Author

This fixer drops compatibility with Python 2, right? Is it a good idea? I don't know.

Yes, that's true and also a pain point.
To use the abstract base class on Python 3.10+, this change is inevitable. 😢

I stopped to use 2to3 a few years ago,

I've often seen a use case using lib2to3 where the external network is blocked for security reason(e.g Privacy-related or sensitive financial systems), or someone just simply trying to convert with lib2to3 and use it.

In the latter case, they didn't expect much of the conversion quality of lib2to3. They just wanted to check how much the code is needed to change.

This change would be helpful for them.

@corona10
Copy link
Member Author

corona10 commented Apr 25, 2020

bpo-40360 is now talking about deprecating lib2to3. So thie PR might be not needed. :)

@corona10 corona10 closed this Apr 25, 2020
@corona10 corona10 deleted the bpo-39482 branch April 25, 2020 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants