~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-3.5.2-docs-html/_sources/c-api/concrete.txt

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.. highlightlang:: c
 
2
 
 
3
 
 
4
.. _concrete:
 
5
 
 
6
**********************
 
7
Concrete Objects Layer
 
8
**********************
 
9
 
 
10
The functions in this chapter are specific to certain Python object types.
 
11
Passing them an object of the wrong type is not a good idea; if you receive an
 
12
object from a Python program and you are not sure that it has the right type,
 
13
you must perform a type check first; for example, to check that an object is a
 
14
dictionary, use :c:func:`PyDict_Check`.  The chapter is structured like the
 
15
"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
 
 
27
Fundamental Objects
 
28
===================
 
29
 
 
30
This section describes Python type objects and the singleton object ``None``.
 
31
 
 
32
.. toctree::
 
33
 
 
34
   type.rst
 
35
   none.rst
 
36
 
 
37
 
 
38
.. _numericobjects:
 
39
 
 
40
Numeric Objects
 
41
===============
 
42
 
 
43
.. index:: object: numeric
 
44
 
 
45
.. toctree::
 
46
 
 
47
   long.rst
 
48
   bool.rst
 
49
   float.rst
 
50
   complex.rst
 
51
 
 
52
 
 
53
.. _sequenceobjects:
 
54
 
 
55
Sequence Objects
 
56
================
 
57
 
 
58
.. index:: object: sequence
 
59
 
 
60
Generic operations on sequence objects were discussed in the previous chapter;
 
61
this section deals with the specific kinds of sequence objects that are
 
62
intrinsic to the Python language.
 
63
 
 
64
.. XXX sort out unicode, str, bytes and bytearray
 
65
 
 
66
.. toctree::
 
67
 
 
68
   bytes.rst
 
69
   bytearray.rst
 
70
   unicode.rst
 
71
   tuple.rst
 
72
   list.rst
 
73
 
 
74
 
 
75
.. _mapobjects:
 
76
 
 
77
Container Objects
 
78
=================
 
79
 
 
80
.. index:: object: mapping
 
81
 
 
82
.. toctree::
 
83
 
 
84
   dict.rst
 
85
   set.rst
 
86
 
 
87
 
 
88
.. _otherobjects:
 
89
 
 
90
Function Objects
 
91
================
 
92
 
 
93
.. toctree::
 
94
 
 
95
   function.rst
 
96
   method.rst
 
97
   cell.rst
 
98
   code.rst
 
99
 
 
100
 
 
101
Other Objects
 
102
=============
 
103
 
 
104
.. toctree::
 
105
 
 
106
   file.rst
 
107
   module.rst
 
108
   iterator.rst
 
109
   descriptor.rst
 
110
   slice.rst
 
111
   memoryview.rst
 
112
   weakref.rst
 
113
   capsule.rst
 
114
   gen.rst
 
115
   coro.rst
 
116
   datetime.rst
 
117