In [336]: class foo:
def __init__(self):
print "in init"
def __call__(self):
print "in call"
In [337]: bar = foo()
in init
In [338]: bar()
in call
| Operation | Equivalent | Result |
|---|---|---|
| s.issubset(t) | s <= t | test whether every element in s is in t |
| s.issuperset(t) | s >= t | test whether every element in t is in s |
| s.union(t) | s | t | new set with elements from both s and t |
| s.intersection(t) | s & t | new set with elements common to s and t |
| s.difference(t) | s - t | new set with elements in s but not in t |
| s.symmetric_difference(t) | s ^ t | new set with elements in either s or t but not both |
| s.update(t) | s |= t | return set s with elements added from t |
| s.intersection_update(t) | s &= t | return set s keeping only elements also found in t |
| s.difference_update(t) | s -= t | return set s after removing elements found in t |
| s.symmetric_difference_update(t) | s ^= t | return set s with elements from s or t but not both |
| always1 | always2 | always3 | sometimes1 | sometimes2 |
|---|---|---|---|---|
| a | b | c | d | e |
| f | g | h | NULL | NULL |
| i | value1 | value2 | NULL | NULL |
| always1 | always2 | always3 | sometimes1 | sometimes2 |
|---|---|---|---|---|
| a | b | c | d | e |
| f | g | h | NULL | NULL |
| i | value1 | value2 | NULL | NULL |
| m | value1 | value2 | NULL | n |
I wasn't expecting this
In [116]: x . thingie == x.thingie
Out[116]: True
The question is now, is it a pep8 violation my linter misses?
— SaoilĂ (@saoili) June 19, 2015
@saoili I just scanned PEP-8 and do not see anything stated about whether there need to be spaces around the attribute period or not :)
— Brandon Rhodes (@brandon_rhodes) June 19, 2015
But I recommended that my colleague get rid of it anyway because it looked a bit odd.
@saoili I thought of your tweet today when I discovered that the following three are not the same:
1.real
1 .real
1..real
— Baptiste Mispelon (@bmispelon) June 24, 2015