Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71740 > unrolled thread

Re: Loading modules from files through C++

Started byChris Angelico <rosuav@gmail.com>
First post2014-05-19 11:40 +1000
Last post2014-05-19 11:40 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Loading modules from files through C++ Chris Angelico <rosuav@gmail.com> - 2014-05-19 11:40 +1000

#71740 — Re: Loading modules from files through C++

FromChris Angelico <rosuav@gmail.com>
Date2014-05-19 11:40 +1000
SubjectRe: Loading modules from files through C++
Message-ID<mailman.10117.1400463653.18130.python-list@python.org>
On Mon, May 19, 2014 at 5:41 AM, Roland Plüss <roland@rptd.ch> wrote:
> This exec source_code in module.__dict__ , should this not also be doable
> with PyEval_EvalCode?

General principle: The more code you write in Python and the less in
C/C++, the happier and more productive you will be.

Drop into Python as soon as you can, and do all the work from there.
You won't have to worry about RAM (de)allocation, Unicode (especially
if you use Python 3 rather than 2), integer overflow, etc, etc, etc.
Only write lower-level code for the bits that actually demand it; and
as Stefan has pointed out, Cython is a great help there.

(Which reminds me. I still need some "excuse project" to justify my
learning Cython. It's good-looking tech but everything I can imagine
writing seems to already exist.)

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web