parsing engineering symbols

Fredrik Lundh fredrik at pythonware.com
Thu Dec 22 03:59:03 EST 2005


Peter Hansen wrote:

> > Did you put the SI_prefixes  outside the def so you could wrap the
> > whole thing in a module and reuse it in other blocks?
>
> Do "import dis" and then try "dis.dis(myfloat)" on Fredrik's version and
> on your suggested variation...  (Hint, it's likely more an instinct for
> decent performance instead of an instinct for decent portability

I frankly don't see what "portability" has to do with this.  Why would the
location of a reusable static data structure matter ?  Python code work
the same way in scripts and modules...

</F>






More information about the Python-list mailing list