The isinstance() is used so that you can pass a single string name of a set but it will still treat it as a list of one item. This replicated what a lot of the Maya.cmds module does when you call something with either one string or a list of strings.
Reusing code is all about making the repetitive parts take variables that can be checked at the time they are called. In a class structure you might refer to this as "state" or properties. A bike can have different colors, sizes, and number of wheels, yet they all have the ability to move and can use the same methods regardless of the other properties. Though you may have a method on the class or another function that returns a value based on the number of wheels on the bike which can be checked at call time. There are books on "refactoring" which is what this concept is called; restructuring your code for different reasons. Clarity, code reduction, purpose, performance, reuse ability,... On Apr 18, 2013 3:23 AM, "Daz" <[email protected]> wrote: > Heya > > Ok so I went over Justin script another 20x and I sort of get it... pretty > nice one. > > Thanks all. > > -- > 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 post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
