File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ Object introspection
44In computer programming, introspection is the ability to determine the
55type of an object at runtime. It is one of Python's strengths.
66Everything in Python is an object and we can examine those objects.
7- Python ships with a few Built -in functions and modules to help us.
7+ Python ships with a few built -in functions and modules to help us.
88
9- 1.\ ``dir() `` BIF
10- ^^^^^^^^^^^^^^^^^
9+ 1.\ ``dir ``
10+ ^^^^^^^^^^^
1111
12- In this section we will learn about ``dir() `` and how it facilitates us
12+ In this section we will learn about ``dir `` and how it facilitates us
1313in introspection.
1414
1515It is one of the most important functions for introspection. It returns
@@ -34,8 +34,8 @@ can be handy when you are not able to recall a method name. If we run
3434``dir() `` without any argument then it returns all names in the current
3535scope.
3636
37- 2.\ ``type() `` and ``id() ``
38- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
37+ 2.\ ``type `` and ``id ``
38+ ^^^^^^^^^^^^^^^^^^^^^^^
3939
4040The ``type `` function returns the type of an object. For example:
4141
@@ -50,7 +50,7 @@ The ``type`` function returns the type of an object. For example:
5050 print (type ({}))
5151 # Output: <type 'dict'>
5252
53- print (type (bool ))
53+ print (type (dict ))
5454 # Output: <type 'type'>
5555
5656 print (type (3 ))
You can’t perform that action at this time.
0 commit comments