Skip to content

Commit bf71529

Browse files
committedDec 7, 2023
Added MemoryIO
Signed-off-by: Andrea Zoppi <[email protected]>
1 parent 9090b42 commit bf71529

14 files changed

+2025
-6
lines changed
 

‎.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ exclude_lines =
2121
# Don't complain if tests don't hit defensive assertion code:
2222
raise AssertionError
2323
raise NotImplementedError
24+
@pytest\.mark\.skip
2425

2526
# Don't complain if non-runnable code isn't run:
2627
if 0:

‎MANIFEST.in

+6
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,10 @@ include pyproject.toml
1919
include setup.cfg
2020
include tox.ini
2121

22+
exclude build
23+
exclude dist
24+
exclude htmlcov
25+
exclude .tox
26+
exclude .pytest_cache
27+
2228
global-exclude *.py[cod] __pycache__ *.so *.dylib

‎docs/_autosummary/bytesparse.base.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
bytesparse.base
1+
bytesparse.base
22
===============
33

44
.. automodule:: bytesparse.base

‎docs/_autosummary/bytesparse.inplace.Memory.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
bytesparse.inplace.Memory
1+
bytesparse.inplace.Memory
22
=========================
33

44
.. currentmodule:: bytesparse.inplace

‎docs/_autosummary/bytesparse.inplace.bytesparse.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
bytesparse.inplace.bytesparse
1+
bytesparse.inplace.bytesparse
22
=============================
33

44
.. currentmodule:: bytesparse.inplace
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
bytesparse.io.MemoryIO
2+
======================
3+
4+
.. currentmodule:: bytesparse.io
5+
6+
.. autoclass:: MemoryIO
7+
:members:
8+
:inherited-members:
9+
:private-members:
10+
:special-members:
11+
12+
13+
14+
.. rubric:: Methods
15+
16+
.. autosummary::
17+
:nosignatures:
18+
19+
~MemoryIO.__init__
20+
~MemoryIO.close
21+
~MemoryIO.detach
22+
~MemoryIO.fileno
23+
~MemoryIO.flush
24+
~MemoryIO.getbuffer
25+
~MemoryIO.getvalue
26+
~MemoryIO.isatty
27+
~MemoryIO.peek
28+
~MemoryIO.read
29+
~MemoryIO.read1
30+
~MemoryIO.readable
31+
~MemoryIO.readinto
32+
~MemoryIO.readinto1
33+
~MemoryIO.readline
34+
~MemoryIO.readlines
35+
~MemoryIO.seek
36+
~MemoryIO.seekable
37+
~MemoryIO.skip_data
38+
~MemoryIO.skip_hole
39+
~MemoryIO.tell
40+
~MemoryIO.truncate
41+
~MemoryIO.writable
42+
~MemoryIO.write
43+
~MemoryIO.writelines
44+
45+
46+
47+
48+
49+
.. rubric:: Attributes
50+
51+
.. autosummary::
52+
53+
~MemoryIO.closed
54+
~MemoryIO.memory
55+
56+

‎docs/_autosummary/bytesparse.io.rst

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
bytesparse.io
2+
=============
3+
4+
.. automodule:: bytesparse.io
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
.. rubric:: Classes
17+
18+
.. autosummary::
19+
:toctree:
20+
:template: custom-class-template.rst
21+
:nosignatures:
22+
23+
MemoryIO
24+
25+
26+
27+
28+
29+
30+
31+
32+

‎docs/_autosummary/bytesparse.rst

+1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@
2828

2929
bytesparse.base
3030
bytesparse.inplace
31+
bytesparse.io
3132

‎setup.cfg

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ ignore =
55
*.so
66

77
[flake8]
8-
max-line-length = 120
98
exclude = */migrations/*
9+
max-line-length = 120
10+
per-file-ignores =
11+
src/bytesparse/__init__.py: F401
1012

1113
[tool:pytest]
1214
testpaths = tests

‎src/bytesparse/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,6 @@
114114

115115
__version__ = '0.0.7'
116116

117-
from .inplace import Memory # noqa F401
118-
from .inplace import bytesparse # noqa F401
117+
from .inplace import Memory
118+
from .inplace import bytesparse
119+
from .io import MemoryIO

‎src/bytesparse/base.py

+27
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,14 @@ def find(
17571757
17581758
Returns:
17591759
int: The index of the first item equal to `value`, or -1.
1760+
1761+
Warnings:
1762+
If the memory allows negative addresses, :meth:`index` is more
1763+
appropriate, because it raises :obj:`ValueError` if the item is
1764+
not found.
1765+
1766+
See Also:
1767+
:meth:`index`
17601768
"""
17611769
...
17621770

@@ -2411,6 +2419,9 @@ def index(
24112419
24122420
Raises:
24132421
:obj:`ValueError`: Item not found.
2422+
2423+
See Also:
2424+
:meth:`find`
24142425
"""
24152426
...
24162427

@@ -2741,6 +2752,14 @@ def rfind(
27412752
27422753
Returns:
27432754
int: The index of the last item equal to `value`, or -1.
2755+
2756+
Warnings:
2757+
If the memory allows negative addresses, :meth:`rindex` is more
2758+
appropriate, because it raises :obj:`ValueError` if the item is
2759+
not found.
2760+
2761+
See Also:
2762+
:meth:`rindex`
27442763
"""
27452764
...
27462765

@@ -2770,6 +2789,14 @@ def rindex(
27702789
27712790
Raises:
27722791
:obj:`ValueError`: Item not found.
2792+
2793+
Warnings:
2794+
If the memory allows negative addresses, :meth:`index` is more
2795+
appropriate, because it raises :obj:`ValueError` if the item is
2796+
not found.
2797+
2798+
See Also:
2799+
:meth:`rfind`
27732800
"""
27742801
...
27752802

0 commit comments

Comments
 (0)
Please sign in to comment.