There are a couple of issues here.

I'd like to see python-mode eventually grow better support for Python 3
and Python 2 at the same time.  Probably Python 3 support should be a
derived major-mode so things that are unique to it can be handled
separately from Python 2 support.  It would then be nice if python-mode
could auto-detect which to use when possible (this will sometimes be
difficult), or provide an easy way for the user to specify or switch to
python3-mode (e.g. via an auto-mode-alist or some such).  Definitely
python-mode.el should at least keep a local variable that tells you
whether the current buffer is Python 2 or Python 3.

* Now, when you have such a variable, functions like py-execute-file can
switch on that to decide what Python code to exec.  For Python 3, I'd
actually run something like this snippet:

with open(r'%s') as python_mode_exec_hack:
    exec(python_mode_exec_hack.read())

This will ensure the file gets closed properly without having to resort
to a try/except.

Don't worry about the packaging; once Andreas and the rest of python-
m...@python.org feels like the new version is ready to be released,
we'll do an upstream release and I'll get sponsored to upload the new
version to Debian.  Then we'll sync that to Ubuntu.  I'm happy to take
care of that once it's ready.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/310354

Title:
  3.0 execute into python session

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-mode/+bug/310354/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to