magical expanding hash

Paul Rubin http
Tue Jan 17 14:57:27 EST 2006


"braver" <deliverable at gmail.com> writes:
> Nice.  What about pushing to leaves which are arrays, or incrementing
> leaves which are numbers?  If the array leaf didn't exist, or a number
> wasn't set yet, << must create an empty array and push the element from
> the RHS into it, and += must init the leaf to 0 and add the RHS to it.

Are you trying to simulate Ruby syntax or just implement those functions?
Implementing the functions is easy enough.  If you want Ruby syntax,
use Ruby.



More information about the Python-list mailing list