[Python-de] Bessere Doku für collections.Counter

Christopher Arndt chris at chrisarndt.de
Mi Jan 28 22:09:31 CET 2015


Am 28.01.2015 um 21:22 schrieb Andreas Jung:
> Was soll an der Doku verkehrt sein? 

Ich weiß auch nicht, was daran falsch ist, aber zumindest dieses Beispiel

    >>> c = Counter('gallahad')  # a new counter from an iterable

kann, wenn man sich nicht bewusst macht, dass Strings auch Iterables
sind, flasche Vorstellungen über das Ergebnis provozieren. Dass da
dieses rauskommt:

    >>> c.keys()
    dict_keys(['a', 'l', 'd', 'h', 'g'])

hätte man evtl. auch zeigen sollen.


Chris

-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 979 bytes
Beschreibung: OpenPGP digital signature
URL         : <http://mail.python.org/pipermail/python-de/attachments/20150128/2c72575f/attachment.sig>


Mehr Informationen über die Mailingliste python-de