[pyar] String.count - WTF?

Martin Cerdeira martincerdeira en gmail.com
Jue Mayo 31 22:19:41 ART 2012


Pregunta cortita y al pie.

Estoy portando algunas cosas de python a otro lenguaje y, haciendo
ingenieria inversa vi esto, y me parecio "anti natural" o, poco
intuitivo[0]:

>>> "hola".count("")
5

Como, seguramente hay una explicación que vuelva lo "antinatural" en
un "ahhh!! era por eso!!!", pregunto: ma per que??

Salud!!

-------------------------------------
Martín Cerdeira - Software Developer
At the end of the day, ship the fucking thing! It’s great to rewrite
your code and make it cleaner and by the third time it’ll actually be
pretty. But that’s not the point—you’re not here to write code; you’re
here to ship products. - Jamie Zawinski



More information about the pyar mailing list