<分区> 分区>
我正在我的交互式 shell 中测试一些 Django 功能
这是我尝试探测这些对象,注意末尾的 Nones 列表
>>> [print(foo) for foo in CharacterSkillLink.objects.all() if foo.speciality]
Streetwise (Street Countdown) Roran
[None]
还有更正统的列表理解:
>>> [print(foo) for foo in range(1,10)]
1
2
3
4
5
6
7
8
9
[None, None, None, None, None, None, None, None, None]
九个无,全部排成一行。
为什么我会得到那个?
