py5coding / py5generator

Meta-programming project that creates the py5 library code.
https://py5coding.org/
GNU General Public License v3.0
52 stars 13 forks source link

py5 class objects should implement `__str__()` and `__repr__()` #209

Closed hx2A closed 1 year ago

hx2A commented 1 year ago

Why not provide better information than <py5.sketch.Sketch at 0x7f0d6be806a0> or <py5.mouseevent.Py5MouseEvent object at 0x0000018F3E0B96D0> when these are printed? It's a simple change.

shyam-sunder-19 commented 1 year ago

This is a great idea, I want to work on this, I believe I will get to know a lot about the codebase along the way.

AsadNizami commented 1 year ago

Does the py5generator class has some documentation? I can see a lot of resources for py5, but not for the generator. I am not able to understand how the codebase is being generated here.

hx2A commented 1 year ago

Does the py5generator class has some documentation? I can see a lot of resources for py5, but not for the generator. I am not able to understand how the codebase is being generated here.

The build process is documented on the website. I am working on more documentation for how py5 and py5generator works.

For this enhancement, you'd have to go find the classes in this directory:

https://github.com/py5coding/py5generator/tree/main/py5_resources/py5_module/py5

The files are shape.py, shader,py, sketch.py, etc. Find the class definitions and add the str and repr methods to each.

hx2A commented 1 year ago

Fixed with #251. Thanks, @AsadNizami !