This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events
Type: enhancement Stage: resolved
Components: asyncio, Library (Lib) Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: asvetlov Nosy List: asvetlov, giampaolo.rodola, gvanrossum, serhiy.storchaka, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2017-11-29 09:46 by asvetlov, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4612 merged asvetlov, 2017-11-29 09:50
Messages (11)
msg307214 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-11-29 09:46
Dropped lines are never executed by supported Python versions.
The code exists for sake of keeping the same code base for stdlib asyncio and third-party library with the same name.
Since Python 3.4 asyncio is a part of stdlib, asyncio on PyPI is not supported/updated for 2.5 years.
Removing is safe.

The change keeps backward compatibility with old libraries written for `yield from` syntax, both awaiting old-styled coroutines and yielding from new styles async functions are supported.

async def f():
    ...
yield from f()

@asyncio.coroutine
def g():
    ...
await g()

Thus no regressions/deprecations, just removing non-public never executed implementation details.
msg307215 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-29 10:17
I support getting rid of outdated code.

But what is relation between asyncio in the stdlib and the version outside of the stdlib? Shouldn't the code support old Python versions for easier synchronization? I remember in the past this prevented modernizing it.

The support of 3.4 is important, since this is a version shipped with Ubuntu 16.04 LTS. This will be a main version for enterprise at least yet a year.
msg307216 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-29 10:28
If it is good to drop 3.4 support in the stdlib asyncio, then there is other outdated code.

There is a 3.3 specific workaround in unix_events.py.

There is a 3.4 code or comments in futures.py, sslproto.py, unix_events.py. Maybe comments are related to optional code which can now be used unconditionally.

Note that not all 3.4 code is marked with "Python 3.4". It can be marked with "Python < 3.5".
msg307222 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-11-29 11:33
Separate PyPI package is for Python 3.3 only.
Python 3.4 is shipped with asyncio in standard batteries.

https://github.com/python/asyncio development is stopped, no new PyPI release is expected.

Thank you for pointing on 3.4 specific code in other files.

Victor Stinner did some cleanup in last weeks, I've picked up his initiative.

Will review other files as well.
Please let me create a new issue to keep changes small and modular.
msg307223 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-29 12:35
I would prefer to do all trivial changes with one commit.

There may be also non-trivial changes.
msg307224 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-11-29 12:52
Ok, will do everything in single PR
msg307227 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-11-29 12:59
Fixed unix_events.py but see no legacy code in futures.py and sslproto.py.
msg307241 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-11-29 16:23
New changeset cc83920ad267c992bc421987829da04d88ae816b by Andrew Svetlov in branch 'master':
bpo-32166: Drop Python 3.4 code from asyncio (#4612)
https://github.com/python/cpython/commit/cc83920ad267c992bc421987829da04d88ae816b
msg307297 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-30 11:54
Thank you Andrew! This have made the code cleaner.
msg307301 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2017-11-30 12:39
You are welcome!
Thanks for review
msg307305 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-30 13:04
> Thank you Andrew! This have made the code cleaner.

Yeah! I really love to see old these old crappy legacy stuff to go away. The asyncio code behave shorter, simpler and with less "#ifdef" ;-)

I understand that the Python language and stdlib became better the last 2-3 years ;-)
History
Date User Action Args
2022-04-11 14:58:55adminsetgithub: 76347
2017-11-30 13:04:29vstinnersetmessages: + msg307305
2017-11-30 12:39:25asvetlovsetmessages: + msg307301
2017-11-30 11:54:39serhiy.storchakasetmessages: + msg307297
2017-11-30 11:35:35asvetlovsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-11-29 16:23:45asvetlovsetmessages: + msg307241
2017-11-29 12:59:29asvetlovsetmessages: + msg307227
2017-11-29 12:58:29asvetlovsetmessages: - msg307226
2017-11-29 12:57:42asvetlovsetmessages: + msg307226
title: Drop python 3.4 code from asyncio.coroutines -> Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events
2017-11-29 12:55:03asvetlovlinkissue32169 superseder
2017-11-29 12:52:09asvetlovsetmessages: + msg307224
2017-11-29 12:35:31serhiy.storchakasetmessages: + msg307223
2017-11-29 12:24:41asvetlovsetversions: - Python 3.6
2017-11-29 11:33:40asvetlovsetmessages: + msg307222
2017-11-29 10:28:47serhiy.storchakasetmessages: + msg307216
2017-11-29 10:17:12serhiy.storchakasetnosy: + gvanrossum, vstinner, giampaolo.rodola, serhiy.storchaka
type: enhancement
messages: + msg307215
2017-11-29 09:50:22asvetlovsetkeywords: + patch
stage: patch review
pull_requests: + pull_request4548
2017-11-29 09:46:45asvetlovcreate