USING PYCForge

Conversion and input limits

Reliable conversion starts with the supported Python forms and input sizes. The most useful limits are listed here.

What happens during conversion

PyCForge reads the submitted Python without running it. It does not import installed packages or open filenames mentioned by that Python. It produces C source; compiling and running that source are separate steps you perform with your own tools.

Practical limits

ItemLimitWhen it matters
Integer values and resultsSigned 64-bit rangePython integers can grow beyond this range; generated C integers cannot.
Source textDefault 1,000,000 bytes and 100,000 linesReduce large input files when conversion reports a source limit.
Included source filesUp to 64Every file must include a supported function.
Fixed container elements1โ€“64Keep each list, tuple, dictionary, or supported set within this size.
Record fields1โ€“64Use the simple record form in the reference.
Nested source constructsUp to 128 levelsSimplify deeply nested expressions, branches, or loops.
File-read sizeDefault 1 MiB; maximum configurable 16 MiBAn oversized file returns status 4 when the generated C runs.
Constant string expansionBounded by the conversion's source-size and work limitsA short expression such as a huge string repetition may still be too large.

Runtime strings passed from C must be valid UTF-8 without embedded NUL characters. Keep pointers valid for all uses, with byte lengths below INT64_MAX. Search over large strings may be slow, especially for repeated partial matches.

When a limit is exceeded

PyCForge reports a diagnostic and produces no new C result. Read the message, reduce the relevant input, and convert again. A previous successful output still describes the previous source. Cancelling a conversion also leaves you without a new result.

Check the inputs used by your C program

Conversion success does not test all possible inputs. Keep arithmetic results within range, check file status values, and compare your C function's results with Python on representative inputs. Conversion checklist gives a practical sequence.