This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年08月12日 00:44 by brett.cannon, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (11) | |||
|---|---|---|---|
| msg168015 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年08月12日 00:44 | |
A classmethod called importlib.abc.SourceLoader.source_to_code(source_bytes, path) would return a code object. By default it would be equivalent to ``compile(source_bytes, source_path, 'exec', dont_inherit=True)``, but others could override this to e.g. convert the source to an AST, optimize the AST, and then call compile() to get the desired code object. |
|||
| msg175635 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年11月15日 19:57 | |
Might name this compile_source() instead. |
|||
| msg175658 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2012年11月15日 23:53 | |
Though I haven't been able to get to this, I do have a demo of sorts that I've been using elsewhere: https://bitbucket.org/ericsnowcurrently/pylt/src/default/pylt/_importing.py?at=default#cl-225 |
|||
| msg175760 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年11月17日 15:54 | |
We might want an keyword-only 'optimize' argument that maps to the compile() function's 'optimize' argument. |
|||
| msg175876 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年11月18日 15:03 | |
New changeset e30bcce5c634 by Brett Cannon in branch 'default': Issue #15627: Add the compile_source() method to http://hg.python.org/cpython/rev/e30bcce5c634 |
|||
| msg176521 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2012年11月28日 07:48 | |
Sorry, just now digging out of a massive backlog here. The originally proposed name of "source_to_code()" might be more appropriate than compile_source(). The relationship to compilation is not compulsory and the name/docstring/docs might imply that. If you're not opposed, Brett, I can make the change. Regardless, glad to see this in. :) |
|||
| msg176554 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年11月28日 17:06 | |
It might not be compulsory, but how else are you going to get a code object? Then again, get_code() kind of codifies the use of the word "code" for methods that return a code object. So if you want to do the work to change the name then go ahead. |
|||
| msg176970 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年12月05日 07:53 | |
New changeset 7caab48f171e by Eric Snow in branch 'default': Issue #15627: This is simply an update to the name of a new method recently added http://hg.python.org/cpython/rev/7caab48f171e |
|||
| msg185589 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2013年03月30日 20:01 | |
The first commit does something fishy with tests: http://hg.python.org/cpython/rev/e30bcce5c634#l3.1 |
|||
| msg185596 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2013年03月30日 22:37 | |
It cleans up the run_unittest() call. You can check the file and see that the "missing" classes are actually not in the module anymore. |
|||
| msg185641 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2013年03月31日 18:45 | |
Ah, okay. I can’t wait for the time when unittest.main() is used everywhere and we delete run_unittest :) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:34 | admin | set | github: 59832 |
| 2013年03月31日 18:45:58 | eric.araujo | set | messages: + msg185641 |
| 2013年03月30日 22:37:26 | brett.cannon | set | messages: + msg185596 |
| 2013年03月30日 20:01:42 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg185589 |
| 2012年12月05日 07:53:12 | python-dev | set | messages: + msg176970 |
| 2012年11月28日 17:06:15 | brett.cannon | set | messages: + msg176554 |
| 2012年11月28日 07:48:37 | eric.snow | set | messages: + msg176521 |
| 2012年11月18日 20:46:48 | Arfrever | set | stage: test needed -> resolved |
| 2012年11月18日 15:23:10 | brett.cannon | set | status: open -> closed dependencies: - Document the 'optimize' argument to compile() resolution: fixed |
| 2012年11月18日 15:03:46 | python-dev | set | nosy:
+ python-dev messages: + msg175876 |
| 2012年11月17日 15:54:57 | brett.cannon | set | dependencies:
+ Document the 'optimize' argument to compile() messages: + msg175760 |
| 2012年11月15日 23:53:03 | eric.snow | set | messages: + msg175658 |
| 2012年11月15日 19:57:27 | brett.cannon | set | messages: + msg175635 |
| 2012年09月14日 19:33:54 | Julian | set | nosy:
+ Julian |
| 2012年08月17日 16:20:01 | asvetlov | set | nosy:
+ asvetlov |
| 2012年08月13日 19:36:57 | brett.cannon | set | assignee: brett.cannon |
| 2012年08月12日 21:33:44 | meador.inge | set | nosy:
+ meador.inge |
| 2012年08月12日 18:16:20 | Arfrever | set | nosy:
+ Arfrever |
| 2012年08月12日 12:36:37 | yselivanov | set | nosy:
+ yselivanov |
| 2012年08月12日 00:44:36 | brett.cannon | create | |