Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
extasia
11 months ago
|
parent
|
context
|
favorite
| on:
Performance Analysis of Python's Dict() and {}
I've also had this thought, but found that inspecting the type shows its by default a dictionary, and that it only is interpreted as a set if you treat it as such (eg add comma-seperated elements when instantiating)
assert type({}) == type(dict())) assert type({1,2,3} == type(set())
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
assert type({}) == type(dict())) assert type({1,2,3} == type(set())