python 3 problem: how to convert an extension method into a class Method

Chris Angelico rosuav at gmail.com
Wed Feb 27 11:49:04 CET 2013


On Wed, Feb 27, 2013 at 9:36 PM, Robin Becker <robin at reportlab.com> wrote:
> However, in my case the method takes
>
>
>
>                       py  C
> utf8 bytes            50  20 usec
> unicode               39  15
>
> here py refers to a native python method and C  to the extension method
> after adding to the class. Both are called via an instance of the class.

Which raises the obvious question: Does it even matter? Will the
saving of a few microseconds really make a difference? Python's best
feature is its clarity of code, not its blazing performance; its
performance goal is "fast enough", and for many MANY purposes, you
won't be able to tell the difference between that and "awesome". Don't
sacrifice your code's clarity to the little tin god of efficiency
until you're sure you actually get something back.

ChrisA



More information about the Python-list mailing list