New to Python: Do we have the concept of Hash in Python?

infidel saint.infidel at gmail.com
Thu Jun 1 11:01:06 EDT 2006


> Is there any built-in Hash implementation in Python? I am looking for a
> container that I can access to it's items by name. Something like this:
>
> Print container["memeberName"]

You obviously haven't read the tutorial, they're called "dictionaries"
in Python

> I am asking this because I learned that DB-API in Python doesn't offer
> access to cursor columns by name. The only option is access by index. I hope
> that I've got it wrong!

That's because the DB-API uses tuples to represent records.

> I learned Ruby perfectly supports that.

Yay for Ruby.




More information about the Python-list mailing list