3 ms·
How does python even work without dictionaries? This is one of those rare times I find the word `fundamental` to be a bit understated. I mean, a class is just f
by sophacles 4y ago
How does python even work without dictionaries? This is one of those rare times I find the word `fundamental` to be a bit understated. I mean, a class is just fancy syntactic sugar around a dict.
- freedomben 4y agoI don't see how you could support dictionaries with only 4k of memory. They're awesomely convenient but not very space efficient. Normally that doesn't matter because there's plenty of memory, but in this case it makes a lot of sense. But yeah so much of the standard library relies on dictionaries, so it wouldn't feel very pythonic.
- throwaway892238 4y agohooray!
- packetlost 4y agoWhen you're dealing with low-level compiler tool-chains like this, it's more accurate to say they translate a subset of python syntax (or the AST) into a lower level language (either machine code, or an ASM), so the dependence on dictionaries as a implementation detail of classes/objects (or really anything else that relies on dict) isn't really there (some things may break, but that's because they rely on a particular CPython implementation detail). Well, outside of dicts themselves. Having worked with a similar system, it's really better to think of it like embedded C and write code imperatively (and no dict, just arrays/lists).