(Warning — for a novice introspection is overly powerful and complex in dynamic languages like python. We won’t get to the bottom any time soon.)
Everything (except literals and operators) you see in a python script is usually one of
– a variable name
– a reserved keyword like for/while, import, in,
– module name like re, string, os. I think these are actually dictionaries
– a type-friendly builtin function — you can put the identifier into type() and dir() — like round, type.
– a type-unfriendly builtin function — print, ..
* “str” is a very strange animal. It’s a function, but type(str) says it’s a typename
* “print” is a strange animal. You can’t examine it using dir(), type()
Python docs list all builtin functions, but a few won’t “type” as builtin function — str, print, type, tuple…
For this sort of investigation, you need a few instrumentation tools — str(), repr(), type(), dir(). I call these meta-functions. They operate on other functions, variables ….