Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hx2A opened this issue Dec 22, 2022 · 4 comments
Closed

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

hx2A opened this issue Dec 22, 2022 · 4 comments
Labels
good first issue Good for newcomers

Comments

@hx2A
Copy link
Collaborator

hx2A commented Dec 22, 2022

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
Copy link

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
Copy link
Contributor

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
Copy link
Collaborator Author

hx2A commented Mar 8, 2023

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
Copy link
Collaborator Author

hx2A commented Mar 11, 2023

Fixed with #251. Thanks, @AsadNizami !

@hx2A hx2A closed this as completed Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants