Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 22nd, 2012, 04:17 PM
Slhd Slhd is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Posts: 5 Slhd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 27 m 56 sec
Reputation Power: 0
Symbol error???


I have deveoped a Python program of about 10,000 lines of code divided in 12 modules. It is an object oriented program that uses Turtle graphics and Tkinter user interface. I use Python version 2.7 on a Mac.

Now I have a serious problem. The program code is in princip as follows:
Code:
#  Module Train_util
...
def check_the_name(...
     ...
     return OK, err_text, err_reason
...

#  Module B
import Train_util
tu = Train_util
...
class X() :
    ...
    def method_Y( ...
         ...
         OK, err_text, err_reason = tu.check_the_name( ...
         ...

Theese lines of code have worked correctly at least 100 times when testing. But suddenly after a simple change of the code some lines below the code above, the method check_the_name is not recognized. The error print out is:
Code:

    OK, err_text, err_reason = tu.check_the_name( ...
AttributeError: 'module' object has no attribute 'check_the_name'

It seems to me that the name of method, "check_the_name", has been lost in a symbol table. Are there any restriction of the size of a symbol table? I have not seen anything about this.

Can you recommend a work around this problem. I have tried to alter the name (was "check_name" before). Divided the big module B (about 2000 lines) into two seperate modules. Nothing helped.

Note: I have had a similar problem in the intial phase of the project. Python did not recognize some global data. By reducing the amont of global data and put other data in an global object, gl, I got around the problem.


Reply With Quote
  #2  
Old September 22nd, 2012, 08:35 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,383 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 13 h 44 m 42 sec
Reputation Power: 383
As far as I know, and I have attended python conferences listening to developer talks, python doesn't impose arbitrary limits.

I encourage unit tests and functional tests.
See the attachment to post 4:
http://forums.devshed.com/python-programming-11/dma-and-python-930972.html


See post 3 for doctest example, or use the google search
site:forums.devshed.com/python-programming-11 b49p23tivg doctest
for more examples.


I think your code is incorrect. And I don't know why. I could be wrong.
__________________
[code]Code tags[/code] are essential for python code!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Symbol error???

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap