This is a strange side effect of how the auto-quote function is implemented in IPython. In particular, each line entered on the IPython terminal maps to this regular expression pattern :
import re
line_split = re.compile("""
^(\s*) # any leading space
([,;/%]|!!?|\?\??)? # escape character or characters
\s*(%{0,2}[\w\.\*]*) # function/method, possibly with leading %
# to correctly treat things like '?%magic'
(.*?$|$) # rest of line
""", re.VERBOSE)
In the case of input, ', = what iss this'this leads to the following assignments :
pre, esc, ifun, the_rest = line_split.match(', = what iss this').groups()
print(repr(pre))
print(repr(esc))
print(repr(ifun))
print(repr(the_rest))
esc , AutoHandler if-else:
if esc == ESC_QUOTE:
# Auto-quote splitting on whitespace
newcmd = '%s("%s")' % (ifun,'", "'.join(the_rest.split()) )
,
In [19]: ifun=''
In [20]: the_rest='= what iss this'
In [21]: newcmd = '%s("%s")' % (ifun,'", "'.join(the_rest.split()) )
In [22]: newcmd
Out[22]: '("=", "what", "iss", "this")'
, ,
, ("=", "what", "iss", "this").