Python implementation of PHP's array