"config" in IPython console

30 views
Skip to first unread message

Moritz Lürig

unread,
Jan 29, 2021, 3:29:32 PM1/29/21
to spyder
I just noticed that "config", a name that I often use for some of my program variables, returns some output in the IPython that seems to be related to Spyder:

config
Available objects for config:
     AliasManager
     DisplayFormatter
     HistoryManager
     IPCompleter
     InlineBackend
     LoggingMagics
     MagicsManager
     OSMagics
     PrefilterManager
     ScriptMagics
     SpyderKernelApp
     SpyderShell
     StoreMagics

what does this do and is there a good reason to not override "config" in the namespace for my variables?
related question: is there an option in Spyder to check for namespace conflicts?

Kiko

unread,
Jan 29, 2021, 4:14:14 PM1/29/21
to spyd...@googlegroups.com
2021-01-27 12:23 GMT+01:00, Moritz Lürig <moritz...@gmail.com>:
> I just noticed that "config", a name that I often use for some of my
> program variables, returns some output in the IPython that seems to be
> related to Spyder:
>
> *config*
> *Available objects for config:*
> * AliasManager*
> * DisplayFormatter*
> * HistoryManager*
> * IPCompleter*
> * InlineBackend*
> * LoggingMagics*
> * MagicsManager*
> * OSMagics*
> * PrefilterManager*
> * ScriptMagics*
> * SpyderKernelApp*
> * SpyderShell*
> * StoreMagics*
>
> what does this do and is there a good reason to not override "config" in
> the namespace for my variables?
> related question: is there an option in Spyder to check for namespace
> conflicts?

It is IPython related, not a Spyder thing.

'config' is an IPython magic command
(https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-config).
You can access it using '%config' (this is the expected way). At the
beginning you can use 'config' (without %) as a shortcut but you can
override 'config' and use the magic command using the % symbol. So, it
is safe to override 'config' (or 'run' or 'alias' or other magic
commands).

>
> --
> You received this message because you are subscribed to the Google Groups
> "spyder" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to spyderlib+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/spyderlib/6f81da9e-db17-40aa-a8ea-8985b722ab42n%40googlegroups.com.
>

Moritz Lürig

unread,
Jan 30, 2021, 6:28:54 AM1/30/21
to spyder
thanks for clarifying!
Reply all
Reply to author
Forward
0 new messages