rantingrick wrote:
>
>WHY did i need do this you may ask?
>I am creating geometry with OpenGL. When you create a face you must
>specify a winding order (clockwise or counter clockwise) this winding
>order controls which side of the face will be visible (since only one
>side of a face is rendered).
rantingrick wrote:
On Sep 18, 12:24 am, "OKB (not okblacke)"
wrote:
Perhaps you want to cut off the recursion at the first step, so
that the nested instance itself does not have a nested instance. If so,
add another parameter to __init__ that flags whether you are creating a
"top-le
En Fri, 18 Sep 2009 03:12:46 -0300, rantingrick
escribió:
I am creating geometry with OpenGL. When you create a face you must
specify a winding order (clockwise or counter clockwise) this winding
order controls which side of the face will be visible (since only one
side of a face is rendered)
EDIT:
copy.copy did work in a simple python interactive session, but it
caused infinite recursion in my real world code? Anyway what ever is
going on (probably lack of sleep!) the cure all was using an arg in
the initial function. So now i am good as gold ;-)
WHY did i need do this you may ask?
I
On Sep 17, 10:08 pm, rantingrick wrote:
> On Sep 17, 11:54 pm, Carl Banks wrote:
>
>
>
>
>
> > On Sep 17, 8:27 pm, rantingrick wrote:
>
> > > ok i have a class and in it's constructor i want to create a copy of
> > > it as an attribute, i have tried super, __new__, and noting seems to
> > > work
On Sep 18, 3:31 pm, alex23 wrote:
> On Sep 18, 3:08 pm, rantingrick wrote:
>
> > ok here is some code. this will cause an infinite recursion.
>
> > class A():
> > def __init__(self, *args):
> > self.nestedA = A(*args) #NO GOOD!
>
> How about:
>
> class A(object):
> def __init_
On Sep 18, 3:08 pm, rantingrick wrote:
> ok here is some code. this will cause an infinite recursion.
>
> class A():
> def __init__(self, *args):
> self.nestedA = A(*args) #NO GOOD!
How about:
class A(object):
def __init__(self, first=True, *args):
if first:
On Sep 18, 12:24 am, "OKB (not okblacke)"
wrote:
> Perhaps you want to cut off the recursion at the first step, so
> that the nested instance itself does not have a nested instance. If so,
> add another parameter to __init__ that flags whether you are creating a
> "top-level" instance.
!SOLVED!
Thanks for the help guys!
copy.copy did it!
Why does me makes life so hard on me? ;-)
--
http://mail.python.org/mailman/listinfo/python-list
rantingrick wrote:
> ok here is some code. this will cause an infinite recursion.
>
> class A():
> def __init__(self, *args):
> self.nestedA = A(*args) #NO GOOD!
>
> there must be a way to create an instance of an object within the
> same objects constructor?
This is an inhe
On Sep 18, 3:08 pm, rantingrick wrote:
> ok here is some code. this will cause an infinite recursion.
>
> class A():
> def __init__(self, *args):
> self.nestedA = A(*args) #NO GOOD!
>
> there must be a way to create an instance of an object within the same
> objects constructor?
But i
On Sep 17, 11:54 pm, Carl Banks wrote:
> On Sep 17, 8:27 pm, rantingrick wrote:
>
> > ok i have a class and in it's constructor i want to create a copy of
> > it as an attribute, i have tried super, __new__, and noting seems to
> > work, please help!
>
> > class A(base):
> > def __init__(self
On Sep 17, 8:27 pm, rantingrick wrote:
> ok i have a class and in it's constructor i want to create a copy of
> it as an attribute, i have tried super, __new__, and noting seems to
> work, please help!
>
> class A(base):
> def __init__(self):
> super(A, self).__init__()
> self.
On Sep 17, 11:14 pm, alex23 wrote:
> On Sep 18, 1:27 pm, rantingrick wrote:
>
> > ok i have a class and in it's constructor i want to create a copy of
> > it as an attribute, i have tried super, __new__, and noting seems to
> > work, please help!
>
> > class A(base):
> > def __init__(self):
>
On Sep 18, 1:27 pm, rantingrick wrote:
> ok i have a class and in it's constructor i want to create a copy of
> it as an attribute, i have tried super, __new__, and noting seems to
> work, please help!
>
> class A(base):
> def __init__(self):
> super(A, self).__init__()
> self.
ok i have a class and in it's constructor i want to create a copy of
it as an attribute, i have tried super, __new__, and noting seems to
work, please help!
class A(base):
def __init__(self):
super(A, self).__init__()
self.nested = ?
think of a nested list [ [] ] but with obje
16 matches
Mail list logo