Conversation
026dd80 to
3cbaff5
Compare
3cbaff5 to
914ab0d
Compare
| fget=_get_is_running, doc="""$class_Sketch_is_running""" | ||
| ) | ||
|
|
||
| @property |
There was a problem hiding this comment.
There was a problem hiding this comment.
I checked the codebase but couldn't understand the benefit of this approach, it seems to complicate the code for no reason.
py5generator is essentially a custom template engine that takes code templates and adds more code to them to make complete python files. The template engine needs to be able to read and parse the code in the templates and extract information from them to maintain the type signatures and compare them with the documentation files. The code that extracts information expects the code to be written in a certain way to be easily parsed.
There was a problem hiding this comment.
Any chance to give some context about why template engine needs it? I couldn't see how _get... + property wrapper approach provides anything extra over the approach in this PR.
| mock_methods = MockMethods(s) | ||
| s.loop = mock_methods.mock_loop | ||
| s.no_loop = mock_methods.mock_no_loop | ||
| s.is_looping = mock_methods.mock_is_looping |
There was a problem hiding this comment.
Not sure this is actually needed and how to handle the property. Will revisit.
There was a problem hiding this comment.
Not sure this is actually needed and how to handle the property. Will revisit.
Good catch. I think mocking this would be important for is_looping to work properly with live coding.

Will be updated after manual testing.
Adds
Sketch.is_loopingproperty and resolves #789 .