Pur*_*ret 1 python python-interactive python-3.x
我在交互式shell中测试了一些Django功能
这是我尝试探测这些对象,请注意最后的Nones列表
>>> [print(foo) for foo in CharacterSkillLink.objects.all() if foo.speciality]
Streetwise (Street Countdown) Roran
[None]
Run Code Online (Sandbox Code Playgroud)
并且具有更正统的列表理解:
>>> [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]
Run Code Online (Sandbox Code Playgroud)
九个Nones,都是连续的.
我为什么要这样做?
归档时间: |
|
查看次数: |
125 次 |
最近记录: |