On Sat, Oct 29, 2016 at 2:51 PM Alok Gandhi <[email protected]> wrote:
> What's the "dounder init method"? Did I miss some code somewhere? > > I think Cesar is referring to the 'double-underscore' aka 'dunder ' aka > 'magic methods' aka 'special methods'- def __init__() > Oh right. It's like those illusion pictures, where they don't click until you stare at it the right way. Now I get it :-) > > On Sat, Oct 29, 2016 at 9:30 AM, Justin Israel <[email protected]> > wrote: > > > > On Sat, Oct 29, 2016 at 1:41 PM Cesar Saez <[email protected]> wrote: > > There's a fundamental problem with this in my view, the dounder init > method of a class gets executed _after_ the instance (aka self) get > created, doing checks there means you basically create an object that can > potentially be invalid by passing the wrong thing and that's a problem. > > You could use a classmethod instead or even a dounder new, but I would go > the other way around by using a simple function instead! Classes are a very > powerful tool but it's a bit overkill on this case (imho anyway). > > > What's the "dounder init method"? Did I miss some code somewhere? > > Cheers! > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAPamJi9JY90vPHxJxaNJpU2C3D6zPix1TUv%2BcfXmMTN1gTW-5g%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPamJi9JY90vPHxJxaNJpU2C3D6zPix1TUv%2BcfXmMTN1gTW-5g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2OEPUi6hr2M%2BZwug672GKyjiC9hJUHoi75G3yHwSUqhw%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2OEPUi6hr2M%2BZwug672GKyjiC9hJUHoi75G3yHwSUqhw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > > For more options, visit https://groups.google.com/d/optout. > > > > > -- > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMTWREaRPUXwBn%3DnY_0dqe5AaMEy_PJOO5PFstdWRCtFTw%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMTWREaRPUXwBn%3DnY_0dqe5AaMEy_PJOO5PFstdWRCtFTw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA31Bg4nfjvsRTmvrdLmnwJGRrfGfQfo0vtuz%3DJAjU3ZOw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
