Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## [0.12.0](https://github.com/tfpf/pysorteddict/compare/v0.11.0...v0.12.0)

<ul class="change-new">
<li><a href="https://github.com/tfpf/pysorteddict/pull/210">#210</a> Define
<code>SortedDictItems.__reversed__</code>. Define <code>SortedDictItemsRevIter</code> as a reverse iterator over the
values of a sorted dictionary. Define <code>SortedDictItemsRevIter.__next__</code>. Define
<code>SortedDictKeys.__reversed__</code> and <code>SortedDict.__reversed__</code>. Define
<code>SortedDictKeysRevIter</code> as a reverse iterator over the keys of a sorted dictionary. Define
<code>SortedDictKeysRevIter.__next__</code>. Define <code>SortedDictValues.__reversed__</code>. Define
<code>SortedDictValuesRevIter</code> as a reverse iterator over the values of a sorted dictionary. Define
<code>SortedDictValuesRevIter.__next__</code>.</li>
</ul>

<ul class="change-fix">
<li><a href="https://github.com/tfpf/pysorteddict/pull/205">#205</a> Add homepage build dependencies to project
metadata.</li>
</ul>

<ul class="change-break">
<li><a href="https://github.com/tfpf/pysorteddict/pull/211">#211</a> Rename <code>SortedDictItemsIter</code> to
<code>SortedDictItemsFwdIter</code>, <code>SortedDictKeysIter</code> to <code>SortedDictKeysFwdIter</code> and
<code>SortedDictValuesIter</code> to <code>SortedDictValuesFwdIter</code>.</li>
</ul>

## [0.11.0](https://github.com/tfpf/pysorteddict/compare/v0.10.0...v0.11.0)

<ul class="change-new">
Expand Down
61 changes: 59 additions & 2 deletions docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<summary>Documentation of older versions is available on GitHub.</summary>

▸ [0.11.0](https://github.com/tfpf/pysorteddict/blob/v0.11.0/docs/documentation.md)
▸ [0.10.0](https://github.com/tfpf/pysorteddict/blob/v0.10.0/docs/documentation.md)
▸ [0.9.0](https://github.com/tfpf/pysorteddict/blob/v0.9.0/docs/documentation.md)
▸ [0.8.2](https://github.com/tfpf/pysorteddict/blob/v0.8.2/docs/documentation.md)
Expand Down Expand Up @@ -452,7 +453,8 @@ Uncommenting the commented line runs any required destructors and makes this err

#### `iter(d)`

Return an iterator over the keys in the sorted dictionary `d`. This is an efficient shorthand for `iter(d.keys())`.
Return a forward iterator over the keys in the sorted dictionary `d`. This is an efficient shorthand for
`iter(d.keys())`. Typical usage is to iterate directly over `d` instead of using this method.

```python
from pysorteddict import *
Expand All @@ -470,6 +472,27 @@ baz
foo
```

#### `reversed(d)`

Return a reverse iterator over the keys in the sorted dictionary `d`. This is an efficient shorthand for
`reversed(d.keys())`.

```python
from pysorteddict import *
d = SortedDict()
d["foo"] = ()
d["bar"] = [100]
d["baz"] = 3.14
for key in reversed(d):
print(key)
```

```text
foo
baz
bar
```

### Other Methods

#### `d.clear()`
Expand Down Expand Up @@ -819,7 +842,8 @@ bar eggs {}

#### `iter(v)`

Return an iterator over the sorted dictionary view `v`.
Return a forward iterator over the sorted dictionary view `v`. Typical usage is to iterate directly over `v` instead of
using this method.

<details class="notice">

Expand Down Expand Up @@ -849,3 +873,36 @@ SortedDict({'a_bar': 'eggs', 'a_baz': 'eggs', 'bar': 'spam', 'baz': 'spam'})
Some modifications are prohibited, however. See [`del d[key]`](#del-dkey) and [`d.clear()`](#dclear) for details.

</details>

#### `reversed(v)`

Return a reverse iterator over the sorted dictionary view `v`.

<details class="notice">

<summary>This method returns a mostly mutation-safe iterator.</summary>

A sorted dictionary can be modified while iterating over any of its views. (Whether this is good practice is a separate
question.)

```python
from pysorteddict import *
d = SortedDict()
d["foo"] = ()
d["bar"] = [100]
d["baz"] = 3.14
for key in reversed(d.keys()):
d[key] = "spam"
d["z_" + key] = "eggs"
if "foo" in d:
del d["foo"]
print(d)
```

```text
segmentation fault (core dumped)
```

Some modifications are prohibited, however. See [`del d[key]`](#del-dkey) and [`d.clear()`](#dclear) for details.

</details>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docs = ["furo~=2024.8", "myst-parser~=4.0"]

[project]
name = "pysorteddict"
version = "0.11.0"
version = "0.12.0"
authors = [
{name = "Vishal Pankaj Chandratreya"},
]
Expand Down