-
Notifications
You must be signed in to change notification settings - Fork 28
Get rid of "Get or set" methods #2
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
Comments
What's a good approach for using properties with 2D matrix like things? I think various syntaxes could be accommodated. pixels[x][y] = color or pixels[x,y] = color |
Both have their problems. In the first case, you have to create an intermediate object with its own getters and setters. In the second case, you have to create the tuple. That makes them slow and gives one more opportunity for memory fragmentation. |
Also, it should be pixels[y][x], as it's arranged by rows first and columns second. |
The Python |
Works for me. Makes sense to follow suit with |
I wonder if you would also want to have slices there for doing filled rectangles? |
By the way, I would really recommend leaving the |
#11 did some of this for the Could do something like this, which would just be a simple refactoring of the current code: disp.text = "hello"
disp.number = 42 or maybe try and add something that acts more like disp.print("hello")
disp.print(42) |
I like the latter option much more. |
+1 print
…On Mon, Jun 18, 2018 at 8:58 AM Radomir Dopieralski < ***@***.***> wrote:
I like the latter option much more.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADNqTg16k70Rud4-La3bks6SZrW8BdKks5t984cgaJpZM4Q6Gp->
.
|
I think with #12 , this should be done. OK to close? |
Yup! Up to you.
…On Thu, Jun 21, 2018 at 4:03 PM Carter Nelson ***@***.***> wrote:
I think with #12
<#12> ,
this should be done. OK to close? #
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADNqeII0QhPZSlxejE28ImbUeMVSZ3nks5t_CYlgaJpZM4Q6Gp->
.
|
Get or set methods are a weird programming pattern inherited from MicroPython. It should be replaced with properties instead.
The text was updated successfully, but these errors were encountered: