Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
7f2bc83d
Commit
7f2bc83d
authored
8 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
docs/btree: Use markup adhering to the latest conventions.
parent
e92602ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/library/btree.rst
+18
-18
18 additions, 18 deletions
docs/library/btree.rst
with
18 additions
and
18 deletions
docs/library/btree.rst
+
18
−
18
View file @
7f2bc83d
...
@@ -82,18 +82,18 @@ Functions
...
@@ -82,18 +82,18 @@ Functions
other parameters are optional and keyword-only, and allow to tweak advanced
other parameters are optional and keyword-only, and allow to tweak advanced
parameters of the database operation (most users will not need them):
parameters of the database operation (most users will not need them):
*
`
flags
`
- Currently unused.
*
*
flags
*
- Currently unused.
*
`
cachesize
`
- Suggested maximum memory cache size in bytes. For a
*
*
cachesize
*
- Suggested maximum memory cache size in bytes. For a
board with enough memory using larger values may improve performance.
board with enough memory using larger values may improve performance.
The value is only a recommendation, the module may use more memory if
The value is only a recommendation, the module may use more memory if
values set too low.
values set too low.
*
`
pagesize
`
- Page size used for the nodes in BTree. Acceptable range
*
*
pagesize
*
- Page size used for the nodes in BTree. Acceptable range
is 512-65536. If 0, underlying I/O block size will be used (the best
is 512-65536. If 0, underlying I/O block size will be used (the best
compromise between memory usage and performance).
compromise between memory usage and performance).
*
`
minkeypage
`
- Minimum number of keys to store per page. Default value
*
*
minkeypage
*
- Minimum number of keys to store per page. Default value
of 0 equivalent to 2.
of 0 equivalent to 2.
Returns a
`
BTree
`
object, which implements a dictionary protocol (set
Returns a BTree object, which implements a dictionary protocol (set
of methods), and some additional methods described below.
of methods), and some additional methods described below.
Methods
Methods
...
@@ -112,10 +112,10 @@ Methods
...
@@ -112,10 +112,10 @@ Methods
Flush any data in cache to the underlying stream.
Flush any data in cache to the underlying stream.
.. method:: btree.__getitem__(key)
.. method:: btree.__getitem__(key)
.. method::
btree.get(key, default=None)
btree.get(key, default=None)
.. method::
btree.__setitem__(key, val)
btree.__setitem__(key, val)
.. method::
btree.__detitem__(key)
btree.__detitem__(key)
.. method::
btree.__contains__(key)
btree.__contains__(key)
Standard dictionary methods.
Standard dictionary methods.
...
@@ -125,20 +125,20 @@ Methods
...
@@ -125,20 +125,20 @@ Methods
to get access to all keys in order.
to get access to all keys in order.
.. method:: btree.keys([start_key, [end_key, [flags]]])
.. method:: btree.keys([start_key, [end_key, [flags]]])
.. method::
btree.values([start_key, [end_key, [flags]]])
btree.values([start_key, [end_key, [flags]]])
.. method::
btree.items([start_key, [end_key, [flags]]])
btree.items([start_key, [end_key, [flags]]])
These methods are similar to standard dictionary methods, but also can
These methods are similar to standard dictionary methods, but also can
take optional parameters to iterate over a key sub-range, instead of
take optional parameters to iterate over a key sub-range, instead of
the entire database. Note that for all 3 methods,
`
start_key
`
and
the entire database. Note that for all 3 methods,
*
start_key
*
and
`
end_key
`
arguments represent key values. For example,
`
`values()`
`
*
end_key
*
arguments represent key values. For example, `values()`
method will iterate over values corresponding to they key range
method will iterate over values corresponding to they key range
given. None values for
`
start_key
`
means "from the first key", no
given. None values for
*
start_key
*
means "from the first key", no
`
end_key
`
or its value of None means "until the end of database".
*
end_key
*
or its value of None means "until the end of database".
By default, range is inclusive of
`
start_key
`
and exclusive of
By default, range is inclusive of
*
start_key
*
and exclusive of
`
end_key
`
, you can include
`
end_key
`
in iteration by passing
`
flags
`
*
end_key
*
, you can include
*
end_key
*
in iteration by passing
*
flags
*
of `btree.INCL`. You can iterate in descending key direction
of `btree.INCL`. You can iterate in descending key direction
by passing
`
flags
`
of `btree.DESC`. The flags values can be ORed
by passing
*
flags
*
of `btree.DESC`. The flags values can be ORed
together.
together.
Constants
Constants
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment