coding

Wednesday, April 25, 2007

python operator: ==, is

>>> x, y = [], []
>>> print x == y, x is y
True False

>>> class T(object): pass
>>> x, y = T(), T()
>>> print x == y, x is y
False False

>>> filter(lambda x: 'env' in x, dir(os))
['environ', 'getenv', 'putenv', 'unsetenv']
>>>
Posted by jiyong at 9:51 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2008 (1)
    • ►  June (1)
  • ▼  2007 (13)
    • ►  June (1)
    • ►  May (2)
    • ▼  April (4)
      • 黄帝文化精神与统一多民族国家的历史
      • 中国多民族统一国家形成的历史背景和地域特征
      • python operator: ==, is
      • ctags/smbfs
    • ►  March (2)
    • ►  January (4)
  • ►  2006 (9)
    • ►  December (4)
    • ►  November (1)
    • ►  October (4)

About Me

jiyong
View my complete profile

faqs.org

  • faqs.org
  • xport - ubuntu
  • 杂货铺
  • boost
  • 王咏刚 contextfree.net
  • 王咏刚 blog.csdn
  • 中国协议分析网
  • kendiv的专栏
  • absurd的专栏
  • C++的罗浮宫
  • China Unix
  • csdn
  • Python
  • China Linux Forum
  • 恋花蝶的博客
  • WangKui's Blog