Replies: 2 comments 2 replies
-
This is a good idea, and might potentially alleviate some confusion for someone someday. I'll use the Python warnings library to do it. This is an easy thing to add. |
Beta Was this translation helpful? Give feedback.
-
@villares so I coded these warning messages and tested it and discovered that It is possible this is a side effect of my fix for #89 & #82, so you might see something different when you test on your machine. I don't think it is a problem that they do get called, I think it is actually an improvement. Do you agree? And if so, that there is no need to add a warning message? |
Beta Was this translation helpful? Give feedback.
-
[UPDATE: This idea turned out to be unnecessary due to other fixes/behavioral changes in py5!]
py5 already has a number of very useful error messages, like when you are trying to import py5 but the sketch is being executed by the sketch runner for imported mode .
I wonder if it would be a good idea to have a console warning when you define any of the event functions (like
mouse_pressed()
orkey_pressed()
) but you forget to define adraw()
function (which provides the main loop, even when empty).I would not want this to raise an exception, to abort execution, as I have left unused event functions and used
setup()
only sketches as exploratory/debugging steps (commenting outdraw()
) during development. Just a message like "It seems like you might have defined one or more event functions.... Beware you need to definedraw()
for your sketch to be able to invoke them."Do you think this is overkill? I think I learned about this a long time a go, maybe in some "interaction" tutorial.
Beta Was this translation helpful? Give feedback.
All reactions