python - 为什么 python {:016X} .format() 说明符在 Brython 中不允许大于 2**52 的大小?
问题描述
我应该能够将一个高达 ( 2**64
)-1 的值转换为一个零填充的 16 位十六进制半字节字符串......那么为什么当我达到超过的大小时会出现以下错误2**52
?
>>> a = "{:016X}".format(2**52)
>>> a = "{:016X}".format(2**53)
Traceback (most recent call last):
File <string>, line 1, in <module>
TypeError: non-empty format string passed to object.__format__
这是否与 Brython 的限制有关,它将事物转换为 javascript?(因为我在这里的 Brython REPL 中得到了那个错误,但在本地正常的 Python3 REPL 中没有)
解决方案
看起来开发人员确认这是一个错误: https ://github.com/brython-dev/brython/issues/1624
推荐阅读
- java - 使用 JPA 和 ManyToMany 删除
- python - 检索传递给取消的协程/任务的参数
- python - 更新 Django REST 框架中的 SerializerMethodField
- php - 更改 Laravel 中翻译功能的默认行为
- list - 如何以特定值分块列表?[科特林]
- r - 多个汇总计数和跨可变行数的标志
- python - Gcloud 函数使用特定的 python 文件和特定的函数名称部署
- php - WordPress:在帖子页面上使用 the_title()
- networking - Consul 服务器重新加入集群失败,几秒钟后离开
- css - 我可以在 SASS 中重新映射类吗?