【文件属性】:
文件名称:async_property:异步属性的Python装饰器
文件大小:32KB
文件格式:ZIP
更新时间:2021-05-14 13:05:17
Python
async_property
异步属性的Python装饰器。
的Python:3.6+
免费软件:MIT许可证
说明文件: :
包: :
源代码: :
安装
要安装async_property,请在您的终端中运行以下命令:
$ pip install async-property
或者,如果您有pipenv:
$ pipenv install async-property
用法
您可以使用@async_property ,你会与刚@property ,但异步函数。
class Foo :
@ async_property
async def remote_value ( self ):
return await get_remote_value ()
现在,属性remote_value返回一个等待的协程。
instance =
【文件预览】:
async_property-master
----MANIFEST.in(242B)
----README.rst(4KB)
----CONTRIBUTING.rst(4KB)
----.github()
--------ISSUE_TEMPLATE.md(325B)
----HISTORY.rst(524B)
----Pipfile.lock(20KB)
----async_property()
--------base.py(1KB)
--------cached.py(4KB)
--------__init__.py(323B)
--------loader.py(1KB)
--------proxy.py(13KB)
----.travis.yml(966B)
----tox.ini(424B)
----LICENSE(1KB)
----setup.cfg(418B)
----setup.py(1KB)
----Pipfile(273B)
----Makefile(2KB)
----docs()
--------make.bat(776B)
--------readme.rst(27B)
--------contributing.rst(33B)
--------conf.py(5KB)
--------installation.rst(1KB)
--------history.rst(28B)
--------index.rst(284B)
--------Makefile(615B)
----.editorconfig(292B)
----tests()
--------test_inheritance.py(958B)
--------test_loader.py(1KB)
--------test_asyncio_lock.py(2KB)
--------test_async_cached_property.py(3KB)
--------__init__.py(0B)
--------test_async_property.py(1KB)
----.gitignore(1KB)
----.coveragerc(89B)