Hi;
I have this import statement:

from particulars import storePrimaryStandAlone, addStore, ourStores

particulars.py has this code:

def addStore():
  return 'jewelry'

def ourStores():
  return ['products', 'prescriptions']

def storePrimaryStandAlone():
  return 'prescriptions'

But I get this error:

/var/www/html/angrynates.com/cart/createTables2.py
  263 </html>
  264 '''
  265
  266 createTables2()
  267
createTables2 = <function createTables2>
 /var/www/html/angrynates.com/cart/createTables2.py in createTables2()
  105     these.append(basic)
  106   i = 0
  107   specialtyStore = addStore()
  108   addStore = []
  109   addStore.append(specialtyStore)
specialtyStore undefined, global addStore = <function addStore>

UnboundLocalError: local variable 'addStore' referenced before assignment
      args = ("local variable 'addStore' referenced before assignment",)

What's strange is that it imports ourStores just fine. but even if I copy
ourStores to addStore the latter doesn't get imported! Why? Now, I've worked
around this problem by just importing all of particulars, but why did my
import fail?
TIA,
Victor
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to