A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/332449.html below:

Create new instance of Python class in C

Create new instance of Python class in C Create new instance of Python class in Cdjw dwelch at vcd.hp.com
Fri Sep 9 12:16:37 EDT 2005
Sybren Stuvel wrote:
> Hi people,
> 
> I'm creating a program that can solve and create Sudoku puzzles. My
> creation function needs to make a lot of copies of a puzzle. Until
> now, I used copy.deepcopy(), but that's too slow. I want to implement
> such a copying function in C and use that instead. My idea about this
> is:
> 
> - Get the data from a puzzle (a list containing lists containing
>   strings) and make a copy of it. That's coded already.
> 
> - Create a new SodokuPuzzle instance and assign the data to it.
> 
> That last step can be done by passing the data to the constructor, so
> that's easy too once I know how to do that in C. My question is: how
> do I create a new instance in C of a class written in Python? I've
> searched Google, but found nothing of help.
> 
> Sybren
Personally, I would try Psyco first, and consider Pyrex next. Are you 
sure your algorithm can't be optimized first, before you start trying to 
write this in C?

-Don

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4