4
4
5
5
<summary >Documentation of older versions is available on GitHub.</summary >
6
6
7
+ ▸ [ 0.8.2] ( https://github.com/tfpf/pysorteddict/blob/v0.8.2/docs/documentation.md )
7
8
▸ [ 0.8.1] ( https://github.com/tfpf/pysorteddict/blob/v0.8.1/docs/documentation.md )
8
9
▸ [ 0.8.0] ( https://github.com/tfpf/pysorteddict/blob/v0.8.0/docs/documentation.md )
9
10
▸ [ 0.7.3] ( https://github.com/tfpf/pysorteddict/blob/v0.7.3/docs/documentation.md )
@@ -443,6 +444,26 @@ Uncommenting the commented line runs any required destructors and makes this err
443
444
444
445
</details >
445
446
447
+ #### ` iter(d) `
448
+
449
+ Return an iterator over the keys in the sorted dictionary ` d ` . This is an efficient shorthand for ` iter(d.keys()) ` .
450
+
451
+ ``` python
452
+ from pysorteddict import *
453
+ d = SortedDict()
454
+ d[" foo" ] = ()
455
+ d[" bar" ] = [100 ]
456
+ d[" baz" ] = 3.14
457
+ for key in d:
458
+ print (key)
459
+ ```
460
+
461
+ ``` text
462
+ bar
463
+ baz
464
+ foo
465
+ ```
466
+
446
467
### Other Methods
447
468
448
469
#### ` d.clear() `
@@ -559,33 +580,24 @@ Return a human-readable representation of the sorted dictionary view `v`.
559
580
560
581
Return the length of the sorted dictionary view ` v ` .
561
582
562
- <details class =" warning " >
563
-
564
- <summary >This method may raise exceptions.</summary >
565
-
566
- If ` v ` is of type ` SortedDictKeys ` , the behaviour is equivalent to that of [ ` len(d) ` ] ( #lend ) where ` d ` is the
567
- underlying sorted dictionary.
568
-
569
- </details >
583
+ The behaviour is equivalent to that of [ ` len(d) ` ] ( #lend ) where ` d ` is the underlying sorted dictionary.
570
584
571
585
#### ` ob in v `
572
586
573
587
Return whether ` ob ` is present in the sorted dictionary view ` v ` .
574
588
575
- <details class =" warning " >
576
-
577
- <summary >This method may raise exceptions.</summary >
578
-
579
589
If ` v ` is of type ` SortedDictKeys ` , the behaviour is equivalent to that of [ ` ob in d ` ] ( #key-in-d ) where ` d ` is the
580
590
underlying sorted dictionary.
581
591
582
- </details >
583
-
584
592
#### ` v[pos] ` or ` v[start:stop:step] `
585
593
586
594
Return the element at position ` pos ` or a ` list ` of elements in the slice denoted by ` start ` , ` stop ` and ` step ` in the
587
595
sorted dictionary view ` v ` .
588
596
597
+ The behaviour is equivalent to that of ` l[pos] ` or ` l[start:stop:step] ` respectively where ` l ` is a ` list ` of the
598
+ elements in ` v ` in the same order. In the second form, ` start ` , ` stop ` and ` step ` can be omitted, just
599
+ like when slicing a ` list ` .
600
+
589
601
``` python
590
602
from pysorteddict import *
591
603
d = SortedDict()
@@ -612,15 +624,6 @@ bar eggs spam
612
624
['spam', 'foo', 'eggs', 'baz', 'bar']
613
625
```
614
626
615
- <details class =" warning " >
616
-
617
- <summary >This method may raise exceptions.</summary >
618
-
619
- The behaviour is equivalent to that of ` l[pos] ` or ` l[start:stop:step] ` respectively where ` l ` is a ` list ` containing
620
- the same elements as ` v ` .
621
-
622
- </details >
623
-
624
627
#### ` iter(v) `
625
628
626
629
Return an iterator over the sorted dictionary view ` v ` .
0 commit comments