V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Sinic  ›  全部回复第 1 页 / 共 1 页
回复总数  3
2015-09-07 10:24:21 +08:00
回复了 thought 创建的主题 Python python 关于计算的一个怪异问题
遇到这种情况,使用
>>> from decimal import Decimal
>>> Decimal ('1.45') - 1
Decimal ('0.45')
>>> (Decimal ('1.45') - 1 ) * 2
Decimal ('0.90')
2015-08-06 18:21:31 +08:00
回复了 pc10201 创建的主题 Python 如何绕过 django 的惰性查询(lazy query)机制?
你是不是用了queryset.iterator()?使用iterator()无法生成cache,遍历同一个queryset时会重复执行查询。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   826 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 21:49 · PVG 05:49 · LAX 14:49 · JFK 17:49
Developed with CodeLauncher
♥ Do have faith in what you're doing.