What is the command to determine an object's type?
MDK
mdk at mdk.com
Tue Feb 5 16:33:30 EST 2002
More information about the Python-list mailing list
Tue Feb 5 16:33:30 EST 2002
- Previous message (by thread): What is the command to determine an object's type?
- Next message (by thread): What is the command to determine an object's type?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Mark McEahern" <marklists at mceahern.com> wrote in message news:mailman.1012942149.18474.python-list at python.org... > > MDK wrote: > > How can I tell if an object is a string, a list, or a dictionary in a > > program using if and ifelse so that I can perform a differnent action > > depending on the object's type? > > I posted code that will do the trick and then realized, I should probably > add this... > > It goes without saying, of course, that you may want to investigate the > Strategy design pattern. Eliminating that sort of conditional type checking > is Strategy's strong suit. > > Cheers, > > // mark > > The code that you posted made perfect sense; thanks for that. However, I am not clear about what you are talking about in regards to "...the Strategy design pattern." I would like to investigate it but I do not know what it is I am investigating. Can you clarify a little more for me? Thanks.
- Previous message (by thread): What is the command to determine an object's type?
- Next message (by thread): What is the command to determine an object's type?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list