[Python-Dev] Usability of the limited API
Paul Moore
p.f.moore at gmail.com
Thu May 28 16:49:07 CEST 2015
On 28 May 2015 at 15:28, Steve Dower <Steve.Dower at microsoft.com> wrote:
> I don't have the issue number handy, but it should be near the top of the
> recently modified list.
I recall seeing that issue. I'm fine with that - getting the two in
sync is obviously worth doing (and clearly in hand). I'm personally
not sure whether automating the exposure of symbols is the correct
approach, as I'm not sure people typically even consider the stable
API when adding functions. Is the default (what you get if somebody
just blindly adds a symbol with no thought for the stable API) to
expose it or not? If the default is that it's not exposed, then
automation seems reasonable, otherwise I'm not so sure.
The bigger issue for me is that it looks like the stable API doesn't
include functions that allow you to just run a script/file.
At a minimum, PyRun_SimpleString should be available. I'd also like to
see a variant of PyRun_SimpleFile that let you pass a filename (either
a .py file, or a zipfile, or a directory name - basically what you can
pass to the Python interpreter directly). You can sort of do it via
"import runpy; runpy.run_path(filename)", but you get into all sorts
of fun with requoting filenames, etc.
With the fact that we're distributing an embeddable interpreter for
Windows, I'd like to be able to promote it as a bundling option,
easier to use than things like py2exe/cx_Freeze.
Paul
More information about the Python-Dev
mailing list