[docs] Typo in collections.Counter class example
georg at python.org
Sun Oct 6 12:37:42 CEST 2013
-----BEGIN PGP SIGNED MESSAGE-----
Am 05.06.2013 19:16, schrieb Михаил Голубев:
> It seems that I found micro bug in Python documentation describing
> collections.Counter class
> There is the following snippet of code
> c.most_common()[:-n:-1] # n least common elements
> Actually this expression returns not /n/ least common elements, but rather
> /n - 1,/ beacuse second boundary is not included (as usual with slices).
> You probably meant c.most_common()[-n:] orc.most_common()[:-n-1:-1] if
> reverse ordering is nesessary.
thanks for the report; this is now fixed and will appear online soon.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the docs