We'll be collecting interesting newsgroup responses, assorted hints, and various documentation in this file.
At least for this first offering of the project, there are a number of Pyth features that we'll leave unimplemented and untested (unless, of course, you feel like it):
for x, y in ...Just handle the case of one control variable.
x += 3will always be simple variables or references to variable attributes in which the type of the value selected from is known. For example, you may see
x += 3 a.x += 3 # If a has a static type other than Any f(42).x += 3 # If the return type of f is other than Anybut not
b.x += 3 # Where b has static type Any A[i] += 3 L[0:3] += [19,42]
__len__()
and __get__(i)
are defined, and these are all you need to implement for.
runtime-extras.c
, like this:
PythDescriptor __typ_Dict, __typ_List, __typ_String, __typ_Tuple, __typ_Any, __typ_Unit, __typ_Int;That will satisfy the linker and allow you to compile simple programs that don't use methods of the native classes. Be sure to remember to remove these definitions when you do implement NativeClassDeclGen!
Exception in thread "main" java.lang.IncompatibleClassChangeError ...which can happen when you compile your .java files against version N of our software and run it against version M > N.
To fix it, just do a 'gmake clean' and then plain 'gmake' to recompile your .java files.
pythc -S mytest.pyThis produces a file
mytest.s
. Now assemble that file into
a runnable executable:
pythc -o mytest mytest.sFinally run GDB on the result. While you can do this on the command line with
gdb mytestI do not recommend this approach. Use Emacs instead (
M-x gdb
,
and then enter mytest
when prompted). The commands in Emacs
are essentially the same as for gjdb. You can set breakpoints on lines
(C-x (gdb) b __pyth_main(but not, .e.g., .L42 or other local labels). You can print registers:
(gdb) p $ebpYou can step the program or go up or down stack frames (on the instructional accounts, the same function keys work as for GJDB: F3 for up, F4 for down, F5 for step one instruction (step), F6 for step one instruction skipping calls (next), F7 for step out to end of function (finish), F8 for continue.
class A: x = 3 class B(A): pass A.x = 4In Python, when we access B.x, we also get 4. Do we need to handle this case by keeping a list of all the subtypes of some class in order to modify its exemplars?
class A: x = 3 r = A() print r.x # Python prints 3 A.x = 4 print r.x # Python prints 4 r.x = 5 A.x = 4 print r.x # Python prints 5Do we need to worry about this case? This will require we memorize which attributes we have assigned so far.
E1 < E2 < E3which looks exactly like
(E1 < E2) < E3but has different semantics in Python?
temp = E2 E1 < temp and temp < E3as in Python.
Page was last modified on Fri May 6 13:20:04 2005.