#! /usr/bin/env python3
# -*- coding: utf-8 -*-

# 2015-04-25T21:15+08:00

d = {0: 'C',
     1: 'C++',
     2: 'Python'}
print(0 in d)

# dictionary.has_key(x or y) ==> (x or y) in dictionary
# Python interprets x or y first, which results in either x (if x is true in a
# boolean context) or y. Then it takes that singular value and checks whether
# it is a key in a_dictionary.
print((0 or 3) in d)
print(0 or 3)

# dictionary.has_key(x + y) ==> (x + y) in dictionary / x + y in dictionary
# The + operator takes precedence over the in operator, so this form technically
# doesn’t need parentheses around x + y, but 2to3 includes them anyway.
print(1 + 1 in d)

# x + dictionary.has_key(y) ==> x + (y in dictionary)

