Differences between obj.attribute and getattr(obj, "attribute")

J

Johannes Schneider

Hi list,
can somebody explain me the difference between accessing attributes via
obj.attribute and getattr(obj, "attribute")?

Is there a special reason or advantage when using getattr?

bg,
Johannes

--
Johannes Schneider
Webentwicklung
(e-mail address removed)
Tel.: +49.228.42150.xxx

Galileo Press GmbH
Rheinwerkallee 4 - 53227 Bonn - Germany
Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax)
http://www.galileo-press.de/

Geschäftsführer: Tomas Wehren, Ralf Kaulisch, Rainer Kaltenecker
HRB 8363 Amtsgericht Bonn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Imports in Python 0

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top