unread-decorator:Python 模块允许 unread() 从任何流中 read() 的数据

时间:2024-07-27 21:10:11
【文件属性】:

文件名称:unread-decorator:Python 模块允许 unread() 从任何流中 read() 的数据

文件大小:11KB

文件格式:ZIP

更新时间:2024-07-27 21:10:11

Python

类型检查装饰器 卢茨·普雷切尔特,2014 两个 Python 对象装饰器。 用于类文件对象的 Python 装饰器add_unread()添加一个操作unread()以将数据推回输入流。 一个用于迭代器和迭代器的 Python 装饰器, add_unnext()返回一个迭代器,该迭代器具有一个额外的操作unnext()用于将项目推回到仍要迭代的部分。 1 add_unread 的用法 from unread_decorator import add_unread f = add_unread ( open ( filename , mode , buffering )) # assume f contains "one\ntwo\nthree" f = add_unread ( f ) # decorate data = f . readline () # 'one\n' d


【文件预览】:
unread-decorator-master
----setup.py(3KB)
----.gitignore(315B)
----unread_decorator.py(4KB)
----LICENSE(1KB)
----testdata()
--------simplestring.txt(14B)
--------longbytes.txt(65KB)
--------longstring.txt(65KB)
--------unicodestring.txt(14B)
--------bytestring.txt(14B)
----test_unread_decorator.py(6KB)
----README.md(4KB)
----test_unnext_decorator.py(3KB)
----README.rst(2KB)

网友评论