python长整数l取消了吗_Python 3.x中的长整数的L后缀

Python 2.x中,在长整数后面有一个L后缀.由于Python 3将所有整数视为长整数,因此已将其删除.从

What’s New In Python 3.0开始:

The repr() of a long integer doesn’t include the trailing L anymore, so code that unconditionally strips that character will chop off the last digit instead. (Use str() instead.)

从这里我得到repr()不会显示L后缀,但str()将具有L后缀.但在Python 3.3.3中,没有一个显示L后缀.

Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:19:30) [MSC v.1600 64 bit (AMD64)] on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> repr(2 ** 64)

'18446744073709551616'

>>> str(2 ** 64)

'18446744073709551616'

根据文档,str()的输出不应该是18446744073709551616L吗?我在What’s New In Python 3.1,What’s New In Python 3.2和What’s New In Python 3.3中找不到任何说明L后缀从str()中删除的内容. 3.2说:

The str() of a float or complex number is now the same as its repr().

但它没有说整数.

从str()中删除了哪个版本的Python L后缀?还是我错过了一些明显的东西?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值