Buffer type checking cleanup/rewrite (now uses use_utility_code)
[cython.git] / ToDo.txt
1 -- The Original Pyrex Todo List --
2
3 DONE - Pointer-to-function types.
4
5 DONE - Nested declarators.
6
7 DONE - Varargs C func defs and calls.
8
9 DONE - * and ** args in Python func defs.
10
11 DONE - Default argument values.
12
13 DONE - Tracebacks.
14
15 DONE - Disallow creating char * from Python temporary anywhere
16        (not just on assignment).
17
18 DONE - Module and function and class doc strings.
19
20 DONE - Predeclare C functions.
21
22 DONE - Constant expressions.
23
24 DONE - Forward C struct declarations.
25
26 DONE - Prefix & operator.
27
28 DONE - Get rid of auto string->char coercion and
29        add a c'X' syntax for char literals.
30
31 DONE - Cascaded assignments (a = b = c).
32
33 DONE - 'include' statement for including other Pyrex files.
34
35 DONE - Add command line option for specifying name of generated C file.
36
37 DONE - Add 'else' clause to try-except.
38
39 DONE - Allow extension types to be declared "public" so they
40        can be accessed from another Pyrex module or a C file.
41
42 DONE - Don't try to generate objstruct definition for external
43        extension type declared without suite (treat as though
44        declared with empty suite).
45
46 DONE - Implement two-argument form of 'assert' statement.
47
48 Const types.
49
50 Tuple/list construction: Evaluate & store items one at a time?
51
52 Varargs argument traversal.
53
54 Use PyDict_SetItemString to build keyword arg dicts?
55 (Or wait until names are interned.)
56
57 Intern names.
58
59 print >>file
60
61 abs() and anything similar.
62
63 Semicolon-separated statement lists.
64
65 Optional semicolons after C declarations.
66
67 Multiple C declarations on one line?
68
69 Optimise return without value outside of try-finally.
70
71 exec statement.
72
73 from ... import statement.
74
75 Use iterator protocol for unpacking.
76
77 Save & restore exception being handled on function entry/exit.
78
79 In-place operators (+=, etc).
80
81 Constant declarations. Syntax?
82
83 DONE - Some way for C functions to signal Python errors?
84
85 Check for lack of return with value in non-void C functions?
86
87 Allow 'pass' in struct/union/enum definition.
88
89 Make C structs callable as constructors.
90
91 DONE - Provide way of specifying C names.
92
93 DONE - Public cdefs.
94
95 When calling user __dealloc__ func, save & restore exception.
96
97 DONE - Forward declaration of extension types.
98
99 Complex number parsetuple format?
100
101 DONE - long long type
102
103 DONE - long double type?
104
105 Windows __fooblarg function declaration things.
106
107 Generate type, var and func declarations in the same order that
108 they appear in the source file.
109
110 Provide a way of declaring a C function as returning a
111 borrowed Python reference.
112
113 Provide a way of specifying whether a Python object obtained
114 by casting a pointer should be treated as a new reference
115 or not.
116
117 Optimize integer for-loops.
118
119 Make sizeof() take types as well as variables.
120
121 Allow "unsigned" to be used alone as a type name.
122
123 Allow duplicate declarations, at least in extern-from.
124
125 Do something about installing proper version of pyrexc
126 script according to platform in setup.py.
127
128 DONE - Add "-o filename" command line option to unix/dos versions.
129
130 Recognise #line directives?
131
132 Catch floating point exceptions?
133
134 Check that forward-declared non-external extension types 
135 are defined.
136
137 Generate type test when casting from one Python type
138 to another.
139
140 Generate a Pyrex include file for public declarations
141 as well as a C one.
142
143 Syntax for defining indefinite-sized int & float types.
144
145 Allow ranges of exception values.
146
147 Support "complex double" and "complex float"?
148
149 Allow module-level Python variables to be declared extern.
150
151 Consider:
152 >cdef extern from "foo.h":
153 >    int dosomething() except -1 raise MyException
154
155 Properties for Python types.
156
157 DONE - Properties for extension types.
158
159 Find a way to make classmethod and staticmethod work better.
160
161 DONE - Document workarounds for classmethod and staticmethod.
162
163 Statically initialised C arrays & structs.
164
165 Reduce generation of unused vars and unreachable code?
166
167 Support for acquiring and releasing GIL.
168
169 Make docstrings of extension type special methods work.
170
171 Treat result of getting C attribute of extension type as non-ephemeral.
172
173 Make None a reserved identifier.
174
175 Teach it about builtin functions that correspond to
176 Python/C API calls.
177
178 Teach it about common builtin types.
179
180 Option for generating a main() function?
181
182 DONE - Allow an extension type to inherit from another type.
183
184 Do something about external C functions declared as returning
185 const * types?
186
187 Use PyString_FromStringAndSize for string literals?
188
189 DONE - C functions as methods of extension types.
190
191 What to do about __name__ etc. attributes of a module (they are
192 currently assumed to be built-in names).
193
194 Use PyDict_GetItem etc. on module & builtins dicts for speed.
195
196 Intern all string literals used as Python strings?
197 [Koshy <jkoshy@freebsd.org>]
198
199 Make extension types weak-referenceable.
200 [Matthias Baas <baas@ira.uka.de>]
201
202 Make 'pass' work in the body of an extern-from struct
203 or union.
204
205 Disallow a filename which results in an illegal identifier when
206 used as a module name.
207
208 Use ctypedef names.
209
210 Provide an easy way of exposing a set of enum values as Python names.
211 [John J Lee <jjl@pobox.com>]
212
213 Prevent user from returning a value from special methods that
214 return an error indicator only.
215
216 Use PyObject_TypeCheck instead of PyObject_IsInstance?
217
218 Allow * in cimport? [John J Lee <jjl@pobox.com>]
219
220 FAQ: Q. Pyrex says my extension type object has no attribute 'rhubarb', but
221      I know it does.
222
223      A. Have you declared the type at the point where you're using it?
224
225 Eliminate lvalue casts! (Illegal in C++, also disallowed by some C compilers)
226 [Matthias Baas <baas@ira.uka.de>]
227
228 Make Python class construction work more like it does in Python.
229
230 Give the right module name to Python classes.
231
232 Command line switch for full pathnames in backtraces?
233
234 Use PyString_FromStringAndSize on string literals containing
235 nulls.
236
237 Peephole optimisation? [Vladislav Bulatov <vrbulatov@list.ru>]
238
239 Avoid PyArg_ParseTuple call when a function takes no positional args.
240
241 Omit incref/decref of arguments that are not assigned to?
242
243 Can a faster way of instantiating extension types be found?
244
245 Disallow declaring a special method of an extension type with
246 'cdef' instead of 'def'.
247
248 Use PySequence_GetItem instead of PyObject_GetItem when index
249 is an integer.
250
251 If a __getitem__ method is declared with an int index, use the
252 sq_item slot instead of the mp_subscript slot.
253
254 Provide some way of controlling the argument list passed to
255 an extension type's base __new__ method?
256 [Alain Pointdexter <alainpoint@yahoo.fr>]
257
258 Rename __new__ in extension types to __alloc__.
259
260 Implement a true __new__ for extension types.
261
262 Way to provide constructors for extension types that are not
263 available to Python and can accept C types directly?
264
265 Support generators by turning them into extension types?
266
267 List comprehensions.
268
269 Variable declarations inside inner code blocks?
270
271 Initial values when declaring variables?
272
273 Do something about __stdcall.
274
275 Support class methods in extension types using METH_CLASS flag.
276
277 Disallow defaulting types to 'object' in C declarations?
278
279 C globals with static initialisers.
280
281 Find a way of providing C-only initialisers for extension types.
282
283 Metaclasses for extension types?
284
285 Make extension types use Py_TPFLAGS_HEAPTYPE so their __module__
286 will get set dynamically?