Re: failing to create an instance of a class when compiled

2020-09-25 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

I'd bet issue in older versions.  If you read their changelog there's a lot of churn like that.  They seem to have gotten better, but it definitely used to be touch and go.  I blame the Python 3 transition, but who knows if there's actually truth to  that.

URL: https://forum.audiogames.net/post/574071/#p574071




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-25 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

Oh yeah, updated and according to tests it works now.No idea whether we were simply doing something wrong or there was an issue in older versions, it's been a hot minute since I tried.

URL: https://forum.audiogames.net/post/573992/#p573992




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-24 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

Super works fine in cython (Synthizer uses it everywhere), but crossing the cython->Python boundary in that context may be tricky.But: why not just pyinstaller?  better to have a thing than to have a thing where you're not going to get code theft or whatever and you're probably absolutely nowhere near the point that the additional perf gains are worth it.Errors almost never fail silently.  You should either get an outright crash or an exception or something going somewhere.  try adding assert statements everywhere.  The conclusion "It fails to create an instance of the class" doesn't logically extend from "there's nothing in the logs anywhere" and also is an empty statement.  Fails how?  "This specific variable is this specific value but should be this other value" or something will go much further here.Also, if you're not cythonizing more than the main script, you're not gaining anything with respect to code protection or performance either. You need it to cythonize the whole program or at least large chunks of the program, otherwise there's very little point.

URL: https://forum.audiogames.net/post/573788/#p573788




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-24 Thread AudioGames . net Forum — Developers room : cartertemm via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

can you define failing? does it simply stop responding? Have you modified Lucia's textinput class at all? Maybe some more code if you have it? Anything helps, sort of grasping at straws here.2 has a point.There are a couple caveats that I've yet to understand and at this point simply accept. cython seems to hate super for some reason, but given that your class doesn't inherit from anything I hardly think this could be the culprit.

URL: https://forum.audiogames.net/post/573786/#p573786




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-23 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

I'd recommend that you put your entire code on pastebin or something so we can get a look. I've worked quite alot with Cython already and almost never encountered it failing silently. The only moments where it does this is when writing actual C code which ends up causing access violations or similar low-level issues, but since you're working with high-level Python code, it shouldn't fail silently at all. Which Cython version are you using, which python/pygame version etc? More details and code please.

URL: https://forum.audiogames.net/post/573463/#p573463




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-22 Thread AudioGames . net Forum — Developers room : Ty via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

You're most likely missing an import. pygame, perhaps?It probably is because of something in your __init__ of TextInput which would most likely mean pygame.

URL: https://forum.audiogames.net/post/573034/#p573034




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-21 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

Yes. Should I also cythonize this script so both scripts are treated the same way? Or does that not matter?Edit that did nothing. I am completely mind fucked by this. My only other solution is instead of creating an instance inside the function, create one in the main script and pass it every time I want to access the function. It's another global but that's not the biggest concern at the moment. But if creating an instance inside doesn't work, how can I expect an instance outside to work?Ok I'm done, I'm just going to wait for more help cause I have no clue what the hell is wrong.

URL: https://forum.audiogames.net/post/572931/#p572931




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-21 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

Yes. Should I also cythonize this script so both scripts are treated the same way? Or does that not matter?Edit that did nothing. I am completely mind fucked by this. My only other solution is instead of creating an instance inside the function, create one in the main script and pass it every time I want to access the function. It's another global but that's not the biggest concern at the moment. But if creating an instance inside doesn't work, how can I expect an instance outside to work? IDK let's try anyway.

URL: https://forum.audiogames.net/post/572931/#p572931




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-21 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

Yes. Should I also cythonize this script so both scripts are treated the same way? Or does that not matter?Edit that did nothing. I am completely mind fucked by this. My only other solution is instead of creating an instance inside the function, create one in the main script and pass it every time I want to access the function. It's another global but that's not the biggest concern at the moment.

URL: https://forum.audiogames.net/post/572931/#p572931




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-21 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

Yes. Shoul I also cythonize this script so both scripts are treated the same way? Or dos that not matter?

URL: https://forum.audiogames.net/post/572931/#p572931




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: failing to create an instance of a class when compiled

2020-09-21 Thread AudioGames . net Forum — Developers room : ivan_soto via Audiogames-reflector


  


Re: failing to create an instance of a class when compiled

Sometimes cython can be an absolute bitch sometimes. Have you made sure no imports are left out? With cython you need to import...everything!

URL: https://forum.audiogames.net/post/572927/#p572927




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


failing to create an instance of a class when compiled

2020-09-21 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


failing to create an instance of a class when compiled

My code works perfectly when not compiled. But when I cythonize it and compile, anytime I attempt to start text input with my module, it fails to create an instance of the class. My errors log shows nothing, I only know of this because of lucia speak lines between each activity.There is a function to handle the text input in the same module as the text input class.class TextInput:
 def __init__(self):
  #vars and functions go here.
outside the class we have the function that creates the class instance.
def enter_text(prompt=None):
 screen= pygame.display.set_mode((1000, 200))
 if prompt!=None:
  pygame.display.set_caption(prompt)
 lucia.output.speak("window title")
 #this is where it fails
 textinput= TextInput()
 lucia.output.speak("instance")
 clock = pygame.time.Clock()
 lucia.output.speak("clock")This script is not cythonized, only the main script is.

URL: https://forum.audiogames.net/post/572926/#p572926




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector