blob: 30eb78db4b987825a8d2bf36bd1021198d5323ac [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001.. highlightlang:: c
2
3
4.. _concrete:
5
6**********************
7Concrete Objects Layer
8**********************
9
10The functions in this chapter are specific to certain Python object types.
11Passing them an object of the wrong type is not a good idea; if you receive an
12object from a Python program and you are not sure that it has the right type,
13you must perform a type check first; for example, to check that an object is a
Sandro Tosi98ed08f2012-01-14 16:42:02 +010014dictionary, use :c:func:`PyDict_Check`. The chapter is structured like the
Georg Brandl8ec7f652007-08-15 14:28:01 +000015"family tree" of Python object types.
16
17.. warning::
18
19 While the functions described in this chapter carefully check the type of the
20 objects which are passed in, many of them do not check for *NULL* being passed
21 instead of a valid object. Allowing *NULL* to be passed in can cause memory
22 access violations and immediate termination of the interpreter.
23
24
25.. _fundamental:
26
27Fundamental Objects
28===================
29
30This section describes Python type objects and the singleton object ``None``.
31
Georg Brandlf6842722008-01-19 22:08:21 +000032.. toctree::
Georg Brandl8ec7f652007-08-15 14:28:01 +000033
Georg Brandlf6842722008-01-19 22:08:21 +000034 type.rst
35 none.rst
Georg Brandl8ec7f652007-08-15 14:28:01 +000036
37
38.. _numericobjects:
39
40Numeric Objects
41===============
42
43.. index:: object: numeric
44
Georg Brandlf6842722008-01-19 22:08:21 +000045.. toctree::
Georg Brandl8ec7f652007-08-15 14:28:01 +000046
Georg Brandlf6842722008-01-19 22:08:21 +000047 int.rst
48 bool.rst
49 long.rst
50 float.rst
51 complex.rst
Georg Brandl8ec7f652007-08-15 14:28:01 +000052
53
54.. _sequenceobjects:
55
56Sequence Objects
57================
58
59.. index:: object: sequence
60
61Generic operations on sequence objects were discussed in the previous chapter;
62this section deals with the specific kinds of sequence objects that are
63intrinsic to the Python language.
64
Georg Brandlf6842722008-01-19 22:08:21 +000065.. toctree::
Georg Brandl8ec7f652007-08-15 14:28:01 +000066
Benjamin Peterson2b4b5ac2008-05-26 15:54:26 +000067 bytearray.rst
Georg Brandlf6842722008-01-19 22:08:21 +000068 string.rst
69 unicode.rst
70 buffer.rst
71 tuple.rst
72 list.rst
Georg Brandl8ec7f652007-08-15 14:28:01 +000073
74
75.. _mapobjects:
76
77Mapping Objects
78===============
79
80.. index:: object: mapping
81
Georg Brandlf6842722008-01-19 22:08:21 +000082.. toctree::
Georg Brandl8ec7f652007-08-15 14:28:01 +000083
Georg Brandlf6842722008-01-19 22:08:21 +000084 dict.rst
Georg Brandl8ec7f652007-08-15 14:28:01 +000085
86
87.. _otherobjects:
88
89Other Objects
90=============
91
Georg Brandlf6842722008-01-19 22:08:21 +000092.. toctree::
Georg Brandl8ec7f652007-08-15 14:28:01 +000093
Georg Brandlf6842722008-01-19 22:08:21 +000094 class.rst
95 function.rst
96 method.rst
97 file.rst
98 module.rst
99 iterator.rst
100 descriptor.rst
101 slice.rst
102 weakref.rst
Larry Hastings402b73f2010-03-25 00:54:54 +0000103 capsule.rst
Georg Brandlf6842722008-01-19 22:08:21 +0000104 cobject.rst
105 cell.rst
106 gen.rst
107 datetime.rst
108 set.rst
Jeffrey Yasskin1aa47002009-05-08 21:51:06 +0000109 code.rst