5

Open up iPython and type this:

/

Hit enter and wonder about the result:

()

You cannot assign it, my guess it has something to do with the shell functionality.

Edit:

You can assign it with:

 p = Out[xx]

But not directly:

 p = / 

will give:

SyntaxError

It is indeed an empty tuple.

styvane
  • 59,869
  • 19
  • 150
  • 156
Edgar Klerks
  • 1,517
  • 11
  • 21

1 Answers1

7

It is a convenience feature for callable objects/names. It's not an empty tuple, but parentheses completion. From iPython's help system (?):

  • Auto-parentheses and auto-quotes (adapted from Nathan Gray's LazyPython)

    1. Auto-parentheses

      Callable objects (i.e. functions, methods, etc) can be invoked like this (notice the commas between the arguments)::

      In [1]: callable_ob arg1, arg2, arg3

      and the input will be translated to this::

      callable_ob(arg1, arg2, arg3)

      This feature is off by default (in rare cases it can produce undesirable side-effects), but you can activate it at the command-line by starting IPython with --autocall 1, set it permanently in your configuration file, or turn on at runtime with %autocall 1.

      You can force auto-parentheses by using '/' as the first character of a line. For example::

      In [1]: /globals # becomes 'globals()'

Michael Foukarakis
  • 39,737
  • 6
  • 87
  • 123