Operator Precedence: One Thing Python Got Right

Grant Edwards grant.b.edwards at gmail.com
Mon Jun 27 10:32:23 EDT 2016


On 2016-06-27, BartC <bc at freeuk.com> wrote:
> On 27/06/2016 15:04, Grant Edwards wrote:
>> On 2016-06-27, Steven D'Aprano <steve at pearwood.info> wrote:
>>
>>> Do you write much Python code that you expect to also be valid C code?
>>
>> Depends on what you mean by "much", but yes, it's certainly
>> something I do.  I often develop and test algorithms in Python and
>> then cut/paste much of the Python code into C programs.  The more
>> validated code I can use verbatim, the less likely I'll bork
>> something up by having to translate it from Python to C.
>
> I bet your code isn't very 'Pythonic' then!

No, not when the end goal is to move it into C.  Numerical stuff works
pretty well.  Handling byte streams (e.g. creating/decoding file and
protocol headers) isn't too bad.  For text processing, it doesn't work
very well.

-- 
Grant Edwards               grant.b.edwards        Yow! There's enough money
                                  at               here to buy 5000 cans of
                              gmail.com            Noodle-Roni!



More information about the Python-list mailing list