This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 vstinner
收信人 M..Z., amaury.forgeotdarc, flox, georg.brandl, ishimoto, pitrou, vstinner
日期 2012-08-02.20:16:44
SpamBayes Score -1.0
Marked as misclassified
Message-id <CAMpsgwZP3gLjW7+ZGaz_HS=Ba+eu9jun1v4u0rcu02Mk3vL2jw@mail.gmail.com>
In-reply-to <1343884809.78.0.113718573899.issue13119@psf.upfronthosting.co.za>
内容
> I wonder why "print(1, file=sys.stderr)" returns '1' instead of '1\n'.

I suppose that you mean "returns '1\n' instead of '1'". This is a
major change between Python 2 and Python 3. Use print(1, end=' ') if
you want the same behaviour. See:
http://docs.python.org/dev/whatsnew/3.0.html#print-is-a-function

You can also use the print() as a function in Python 2 using "from
__future__ import print_function":
http://docs.python.org/dev/whatsnew/2.6.html#pep-3105-print-as-a-function

I never liked "print expr," because it looks like a typo or an ugly
hack. It's easy to add a comma by mistake.
历史
日期 用户 动作 参数
2012-08-02 20:16:45vstinner修改recipients: + vstinner, georg.brandl, ishimoto, amaury.forgeotdarc, pitrou, flox, M..Z.
2012-08-02 20:16:45vstinner链接issue13119 messages
2012-08-02 20:16:44vstinner创建