# How to define a smart class using cython?

Hi,
I managed to rewrite my problem so I only have to represent numbers in the following way:
[(2,3),(3,3),(13,1)] like in list(factor(8*27*13)). Thus [(prime,exponent), (prime,exponent), ...].

With such a representation multiplying is easy, and I can skip to factor numbers (again). What I'm looking for is a fast cython approach with a class where I can define a function for multiplying, but also where I'm able to store and retrieve a large set of numbers efficiently (within the program). I looked for examples in the Cython Tutorial et cetera, but I could not find an approach which helped me. Maybe someone is willing and able to share his/her expertise? Thanks in advance! Roland

Could you give some more information, e.g., examples, about your problem and what your class should do?

It is always better to start with a Python class. Once you are sure about your data structure you can switch to cython and this is easy. Once you are in cython it becomes much harder to rewrite your class.