Skip to content


Subversion checkout URL

You can clone with
Download ZIP


"print" magic does not work in Python 3 #2984

asmeurer opened this Issue · 8 comments

3 participants


From the mailing list.

In [10]: @register_line_magic
def print(line):

In [11]: %print 1

In [12]: print 1
  File "<ipython-input-12-08890221e919>", line 1
    print 1
SyntaxError: invalid syntax

But you can see that other magics work just fine without the %:

In [13]: timeit 1
100000000 loops, best of 3: 17 ns per loop

On an unrelated not, when I went to look up the mailing list link, I noticed that "mailing list" on the homepage links to the dev list. Is the user list defunct, or did you just accidentally drop the user list link?


In case it isn't clear, this is all in Python 3.


(To answer the unrelated note: We're downplaying the user mailing list, with the intention that people ask user questions on Stackoverflow or on the new Hipchat room. But it still exists, and we'll still respond there. My filters route -dev and -user to the same folder, so I usually don't even notice which list things are on)


Oh OK. So would you have preferred it if I had asked that question on StackOverflow?


OK. I get the feeling that more of the questions I am likely to ask are like that than not, if anything because I am quite willing to submit a pull request if it turns out something is a bug in IPython (and someone points me in the right direction).

Which leads me to my next question: is this something that you might want to include in IPython itself, perhaps as some option to autocall? I imagine it might be quite common among those of us who don't like autocall to still want print to work in Python 3 like it does in Python 2.


I'm going to close this, as it doesn't look like it's going anywhere. It's working as designed in that automagics are only used when they're not shadowed by a normal function.

@takluyver takluyver closed this
@minrk minrk added this to the no action milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.