Python Written in C?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Jul 21 13:21:48 EDT 2008


On Mon, 21 Jul 2008 18:12:54 +0200, mk wrote:

> Seriously, though, would there be any advantage in re-implementing 
> Python in e.g. C++?
> 
> Not that current implementation is bad, anything but, but if you're not 
> careful, the fact that lists are implemented as C arrays can bite your 
> rear from time to time (it recently bit mine while using lxml). Suppose 
> C++ re-implementation used some other data structure (like linked list, 
> possibly with twists like having an array containing pointers to 1st 
> linked list elements to speed lookups up), which would be a bit slower 
> on average perhaps, but it would behave better re deletion?

An operation that most people avoid because of the penalty of "shifting
down" all elements after the deleted one.  Pythonistas tend to build new
lists without unwanted elements instead.  I can't even remember when I
deleted something from a list in the past.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list