Skip to content

Commit d81dc1d

Browse files
committed
style(mman): move managed_mmaps() closer to 2 mmans
1 parent 8489c31 commit d81dc1d

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

smmap/mman.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,6 @@
2121
#}END utilities
2222

2323

24-
def managed_mmaps(check_entered=True):
25-
"""Makes a memory-map context-manager instance for the correct python-version.
26-
27-
:param bool check_entered:
28-
whether to scream if not used as context-manager (`with` block)
29-
:return:
30-
either :class:`SlidingWindowMapManager` or :class:`StaticWindowMapManager` (if PY2)
31-
32-
If you want to change other default parameters of these classes, use them directly.
33-
34-
.. Tip::
35-
Use it in a ``with ...:`` block, to free cached (and unused) resources.
36-
37-
"""
38-
mman = SlidingWindowMapManager if PY3 else StaticWindowMapManager
39-
40-
return mman(check_entered=check_entered)
41-
42-
4324
class WindowCursor(object):
4425

4526
"""
@@ -263,6 +244,25 @@ def fd(self):
263244
#} END interface
264245

265246

247+
def managed_mmaps(check_entered=True):
248+
"""Makes a memory-map context-manager instance for the correct python-version.
249+
250+
:param bool check_entered:
251+
whether to scream if not used as context-manager (`with` block)
252+
:return:
253+
either :class:`SlidingWindowMapManager` or :class:`StaticWindowMapManager` (if PY2)
254+
255+
If you want to change other default parameters of these classes, use them directly.
256+
257+
.. Tip::
258+
Use it in a ``with ...:`` block, to free cached (and unused) resources.
259+
260+
"""
261+
mman = SlidingWindowMapManager if PY3 else StaticWindowMapManager
262+
263+
return mman(check_entered=check_entered)
264+
265+
266266
class StaticWindowMapManager(object):
267267

268268
"""Provides a manager which will produce single size cursors that are allowed

0 commit comments

Comments
 (0)