万恶的源泉:

Fireboo的疑问(当然 lambda 本身写的就有问题):

>>> filter( lambda x: x > 2, [ 1, [ 1, 2, 3 ], 2, 3 ] )
[[1, 2, 3], 3]

?:

>>> 1 < [ 1 ]
True
>>> int < list
True
>>> dict < int < list
True
>>> int < map
False

后来几经周折,和 Fireboo 讨论了下,是

1.不同对象比較(除了 number 之外)。是依照 type names 比較,

2.当同样类型对象不支持适当比較的时候。採用 address 比較

3.list 与 list。 tuple 与 tuple 採用字典序比較

>>> x = 1
>>> y = [ 1 ]
>>> type( x )
<type 'int'>
>>> type( y )
<type 'list'>
>>> x < y
True
>>> type( int )
<type 'type'>
>>> type( list )
<type 'type'>
>>> id( int )
505552912
>>> id( list )
505555336
>>> int < list
True
>>> type( map )
<type 'builtin_function_or_method'>
>>> type( list )
<type 'type'>
>>> map < list
True

最新文章

  1. java基础总结——基础语法2(语句)
  2. FPGA重要设计思想
  3. Guava----Function
  4. [转]恢复 git reset -hard 的误操作
  5. Stack and Heap 堆和栈的区别
  6. request.setCharacterEncoding 和常用内置对象 跳转
  7. R语言实战读书笔记2—创建数据集(上)
  8. Generate Parentheses java实现
  9. Lombok 安装
  10. iOS8新增加的frameworks, 在目前基于7以上开发的情况下, 使用下列sdk要注意设置成optional
  11. 【转】CString类型互转 int
  12. iOS新的旅程之Swift语言的学习
  13. web开发路径问题
  14. hive表的存储格式; ORC格式的使用
  15. day 21 - 2 练习
  16. Linq高级查询,分页查询及查询分页结合
  17. 五、MongoDB的索引
  18. localStorage的存储、获取、删除操作
  19. 八.jQuery源码解析之get()
  20. python在windows环境安装MySQLdb

热门文章

  1. webstorm 设置ES6语法支持以及添加vuejs开发配置
  2. 我能考虑到的数组(老)方法就这些了(es5)
  3. LINUX:Contos7.0 / 7.2 LAMP+R 下载安装Php篇
  4. HDU 4747 Mex【线段树上二分+扫描线】
  5. 集训第五周动态规划 G题 回文串
  6. UVA 253 Cube painting(枚举 模拟)
  7. Qt笔记——添加菜单图片/添加资源文件
  8. intellij idea 忽略文件不提交
  9. jsp学习之如何在web层创建Servlet
  10. [BZOJ1264][AHOI2006]基因匹配Match(DP + 树状数组)