When was cpython started to use c version c99 and newer? I'm looking for a python version using ansi c and older

I’m doing a project that works on an older cpu that uses the 6502 instructions set. And apparently C can run on it as long as it ansi c and older. Which version of python uses only ansi c in it’s cpython interpreter?

C dialect

  • Python 3.11 and newer versions use C11 without optional features. The public C API should be compatible with C++.
  • Python 3.6 to 3.10 use C89 with several select C99 features:
    • Standard integer types in <stdint.h> and <inttypes.h>. We require the fixed width integer types.
    • static inline functions
    • designated initializers (especially nice for type declarations)
    • intermingled declarations
    • booleans
    • C+±style line comments
  • Python versions before 3.6 used ANSI/ISO standard C (the 1989 version of the standard). This meant (amongst many other things) that all declarations must be at the top of a block (not necessarily at the top of function).
1 Like

What about python2?

That falls under Python versions before 3.6.

When the PEP was first drafted in 2001, it simply said

Use ANSI/ISO standard C (the 1989 version of the standard).

1 Like

I know the 6502, a great 8 bit micro from around 1975(?).
Python will not fit in 64k address space.
Python needs at least a 32 bit processor.

1 Like

The requirement to initiate a virtual environment seems to be the thing that hinders it. If python can be compiled to the machine code. Than the memory limitations (in theory) are lifted.

As @Barry said, the 6502 has a 16-bit address space, which limits it to 64K.

You could use bank switching to let it access more memory than that, but the code would have to handle that itself. No support from the processor itself, and, oh, it’s going to be slow…

I’m wondering whether a 16-bit processor with a few MB could handle a sliimmed-down version like microPython (or a slimmed-down microPython?). It’s still going to be slow, though, just not as painfully slow as an 8-bit version.

I think @MRAB meant to tag the other Barry, @barry-scott but funnily enough, the 6502 was my first microprocessor. My brother had an Atari 800 and we had Basic, FORTH, and IIRC assembly cartridges, and we had Ohio Scientific micros back in my high school days where we used to dump out the instruction set and disk operating system [1]. 6502 was a fun machine to program!


  1. and just to mess with the bullies who also had to pass computer science, scramble the command set ↩︎

1 Like

My apologies, Barry. :slight_smile:

My first microprocessor wasn’t as fancy as the 6502. I had (and still have) an MK14 from Science of Cambridge. BASIC? Luxury!

Seems so, doing more research, I found that thought python can’t run on an 8bit cpu, it can emulate such systems.