aio-libs / aio-libs/aiohttp

Proposal: rename `async def close()` to `async def aclose()` across aiohttp

Đang mở
#12,922 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
16.5k
Fork
2.4k
Merge trung bình
17 giờ 22 phút
Pull request đã merge (30 ngày)
212

Mô tả

### Describe the solution you'd like

`contextlib.aclosing()` expects the object to provide an `aclose()` coroutine, which it awaits automatically. This makes `aclose` the de-facto naming convention for asynchronous close methods.
For consistency with this convention, I propose renaming `async def close()` to `async def aclose()` on all aiohttp classes that currently expose an async `close()`. Backward compatibility should be preserved: the old `close()` should keep working but emit a `DeprecationWarning` when called.

### Related component

Server and Client

### Code of Conduct

- [x] I agree to follow the aio-libs Code of Conduct

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.