Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add InteractiveMacroConsole #4

Closed
Technologicat opened this issue Feb 9, 2020 · 1 comment
Closed

Add InteractiveMacroConsole #4

Technologicat opened this issue Feb 9, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Technologicat
Copy link
Owner

Technologicat commented Feb 9, 2020

unpythonic needs an advanced macro-enabled console for its hot-patching REPL, so it's possible to use all of unpythonic in the REPL.

Basically, it would be niceTM to have feature parity with imacropy.console in something that runs like a regular code.InteractiveConsole.

Specifically:

  • Any macro definitions imported during a REPL session should persist until the end of that session. Re-importing the same macro should overwrite the old binding.
  • Macros should be help-able for interactive use, as in help(mymacro).
@Technologicat
Copy link
Owner Author

Added imacropy.console.MacroConsole, which does exactly this.

NOTE!

  • The IPython extension module has been renamed; the module is now known as imacropy.iconsole, because the basic MacroConsole is more deserving of the module name imacropy.console.
  • help(some_macro) sees the wrong docstring, both in the IPython extension and in MacroConsole. As a workaround, use imacropy.doc(some_macro), which works correctly, just like IPython's some_macro? does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant