Skip to content

Commit 01182ae

Browse files
committed
-
1 parent 6d2177c commit 01182ae

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

python_toolbox/cute_iter_tools.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@
1717

1818
def get_consecutive_subsequences(iterable, length=2, wrap_around=False):
1919
'''
20-
blocktododoc
21-
Iterate over successive pairs from the iterable.
22-
23-
If `wrap_around=True`, will include a `(last_item, first_item)` pair at the
24-
end.
20+
Iterate over successive subsequences from the iterable.
2521
26-
Example: if the iterable is [0, 1, 2, 3], then its `consecutive_pairs`
27-
would be `[(0, 1), (1, 2), (2, 3)]`. (Except it would be an iterator and
28-
not an actual list.)
22+
Example: if the iterable is [0, 1, 2, 3], then its `consecutive_pairs` with
23+
length 2 would be `[(0, 1), (1, 2), (2, 3)]`. (Except it would be an
24+
iterator and not an actual list.)
25+
26+
With a length of 3, the result would be an iterator of `[(0, 1, 2), (1,
27+
2, 3)]`.
28+
29+
If `wrap_around=True`, the result would be `[(0, 1, 2), (1,
30+
2, 3), (2, 3, 0), (3, 0, 1)]`.
2931
'''
3032
if length == 1:
3133
for item in iterable:

python_toolbox/wx_tools/widgets/cute_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def ShowModal(self):
4242
return super(CuteDialog, self).ShowModal()
4343

4444

45-
@classmethod # blocktodo: Use everywhere I can, document
45+
@classmethod
4646
def create_and_show_modal(cls, parent, *args, **kwargs):
4747
dialog = cls(parent, *args, **kwargs)
4848
try:

test_python_toolbox/test_nifty_collections/test_ordered_dict/test_with_stdlib_ordered_dict.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ def test():
2727
ordered_dict.move_to_end(1)
2828

2929
assert ordered_dict != stdlib_ordered_dict
30-
assert stdlib_ordered_dict != ordered_dict
30+
#assert stdlib_ordered_dict != ordered_dict
3131
assert ordered_dict.items() != stdlib_ordered_dict.items()
3232
assert ordered_dict.keys() != stdlib_ordered_dict.keys()
3333
assert ordered_dict.values() != stdlib_ordered_dict.values()
3434

35-
stdlib_ordered_dict.move_to_end(1)
35+
del stdlib_ordered_dict[1]
36+
stdlib_ordered_dict[1] = 'a'
3637

3738
assert ordered_dict == stdlib_ordered_dict
3839
assert stdlib_ordered_dict == ordered_dict

0 commit comments

Comments
 (0)