On Nov 10, 1:09 pm, "lallous" wrote:
> Hello
>
> I have 3 questions, hope someone can help:
>
> 1)
> How can I create an instance class in Python, currently I do:
>
> class empty:
> pass
>
> Then anytime I want that class (which I treat like a dictionary):
>
> o = empty()
> o.myattr = 1
> etc...
lallous lgwm.org> writes:
> Is there is a one line syntax to instantiate an instance?
You can't instantiate an instance; it's already instantiated.
>
> Any other ways than this:
> o = new.classobj('object', (), {})
class x: pass
> How can I, similarly, create an object "o" in C api:
Use PyOb
> How can I create an instance class in Python, currently I do:
>
> class empty:
> pass
>
> Then anytime I want that class (which I treat like a dictionary):
>
> o = empty()
> o.myattr = 1
> etc
>
> Is there is a one line syntax to instantiate an instance?
>
> Any other ways than this:
>
Hello
I have 3 questions, hope someone can help:
1)
How can I create an instance class in Python, currently I do:
class empty:
pass
Then anytime I want that class (which I treat like a dictionary):
o = empty()
o.myattr = 1
etc
Is there is a one line syntax to instantiate an instance?
A