PASTEBIN
| #1 paste tool since 2002
create new paste
tools
api
archive
faq
PASTEBIN
create new paste
trending pastes
sign up
login
my alerts
my settings
my profile
Don't like ads?
PRO users
don't see any ads ;-)
Public Pastes
Untitled
2 sec ago
Untitled
2 sec ago
Untitled
5 sec ago
Untitled
8 sec ago
Untitled
PHP | 11 sec ago
Untitled
13 sec ago
Untitled
16 sec ago
Untitled
19 sec ago
hash() on objects
By:
michaelmior
on
Apr 10th, 2012
| syntax:
Python
| size: 0.14 KB | hits: 29 | expires: Never
download
|
raw
|
embed
|
report abuse
|
print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
class
Foo
(
object
)
:
def
__init__
(
self
,
x
)
:
self
.
x
=
x
# These two values are the same
print
(
hash
(
Foo
(
3
)
)
)
print
(
hash
(
Foo
(
4
)
)
)
create a
new version
of this paste
RAW Paste Data
class Foo(object): def __init__(self, x): self.x = x # These two values are the same print(hash(Foo(3))) print(hash(Foo(4)))