Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jacobolus
on March 26, 2011
|
parent
|
context
|
favorite
| on:
Lambda’s New Coat: 21st century syntactic Mexps
Sure. `==` should be used for such comparisons, not `is`, as the latter is semantically different. They have the same effect for "apricot" because Python interns strings up to length 20:
>>> "1"*20 is "1"*20 True >>> "1"*21 is "1"*21 False
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: