Skip to content

Commit 5f92ea6

Browse files
committed
object introspection: More consistency
Do not parenthesize function names needlessly, and make the example a little bit nicer to follow by removing the need to know the `bool` type.
1 parent 795bef9 commit 5f92ea6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

object_introspection.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Object introspection
44
In computer programming, introspection is the ability to determine the
55
type of an object at runtime. It is one of Python's strengths.
66
Everything 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
1313
in introspection.
1414

1515
It 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
3535
scope.
3636

37-
2.\ ``type()`` and ``id()``
38-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
37+
2.\ ``type`` and ``id``
38+
^^^^^^^^^^^^^^^^^^^^^^^
3939

4040
The ``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))

0 commit comments

Comments
 (0)