3 ms·
> I'm a Python ignoramus, but I think they're the same, except for Perl's being more concise. Isn't everything always more concise in Perl? No matter what lang
by antod 11y ago
> I'm a Python ignoramus, but I think they're the same, except for Perl's being more concise.
Isn't everything always more concise in Perl? No matter what language it's compared to :)
> How would you do a 3-level hash though in Python ?
You might/should be able to wrangle that with some customisation of the default_factory or a defaultdict subclass, but yeah the arbitrary depth wouldn't be as 'plug n play' as with Perl.
> What you call "value to use depends on the operation" is called casting. Depending on the context, a variable can be different values. For example a variable that has been defined but nothing else is treated as 0 if you try to add a number to it. It's an empty string if you use it in a string operation.
Yeah Python's strong typing (usually) balks at automatic casting. You'd need to choose what the default is.
- kbenson 11y ago> Isn't everything always more concise in Perl? No matter what language it's compared to :) Ha, you need more exposure to things like APL :)