How do I create dynamically, and manage, new instances of common data types in Python?
<p>I want to make a program which will ask the user for a number (let's say 3) and create three 3x3 lists, or 3 sets of 3 members or some other complex data type (times 3) Python already knows of. </p>

<p>Many programs create new objects without strict programming declaration of their instances. For example in Cinema4D (3D graphics software) i can push a button and create as many cubes I want. But I don't know the programming mechanics of this automatic instance creation without a written code declaration like:  </p>

<pre><code>cubeobj cube_1  
cube_1.name("Cube.1") ...
</code></pre>

<p>In C++ something like that would require the operator <code>new</code> and the function <code>malloc()</code>. Are there any equivalents for them in Python?</p>

<p>I've searched among many Python books and didn't find anything, what kind of Python topic would discuss something like that?</p>

<p>OK, I think I've come up with a solution.
Instead of trying to find a way to create new lists I will just append as many new indexes I need on a predefined empty list and treat that linear list as many unrelated lists using <code>for</code> loops and modulos related to my input number.</p>

<p>I still don't know a generic programming method for automatic class instancing though ...</p>

python class object types