Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #79740 > unrolled thread
| Started by | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| First post | 2014-10-27 11:40 +1100 |
| Last post | 2014-10-27 11:40 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: id == vs is Ben Finney <ben+python@benfinney.id.au> - 2014-10-27 11:40 +1100
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2014-10-27 11:40 +1100 |
| Subject | Re: id == vs is |
| Message-ID | <mailman.15213.1414370706.18130.python-list@python.org> |
Dan Stromberg <drsalists@gmail.com> writes: > Are the following two expressions the same? > > x is y > > Id(x) == id(y) It depends what you mean by “the same”. Do they give the same result? Sometimes yes, sometimes no. It depends on what the types of the values are. Do they express the same intent? Always no. The first queries object identity, the second queries object equality. -- \ “Ridicule is the only weapon which can be used against | `\ unintelligible propositions.” —Thomas Jefferson, 1816-07-30 | _o__) | Ben Finney
Back to top | Article view | comp.lang.python
csiph-web