Hello,
quick question. Do you declare the variables on top of the function like 
this:

def myFunc():
    """The description"""
    listA = []
    listB = []
    
    '''
    some code in the middle
    bla bla
    '''
    for i in range(10):
        listA.append(i)
        
    '''
    more code in the middle
    bla bla
    '''
    for j in range(5):
        listB.append(j)
     
or would you do it like this?

def myFunc():
    
    '''
    some code in the middle
    bla bla
    '''
    listA = []
    for i in range(10):
        listA.append(i)
        
    '''
    more code in the middle
    bla bla
    '''
    listB = []
    for j in range(5):
        listB.append(j)



In the second case, for me, it does make sense declaring the variable right 
before the loop, because then you read it like a paragraph.
in the fist case, declaring everything at the beginning looks cleaner, but 
makes you having to track where the variable comes from.
Is this a personal preference?If so, I am not sure which makes more sence.

thanks

-- 
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/477cb809-6a81-4e21-8168-b8f9c95fda81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to