Been reading up on #Python lately. I know that classes in Python "doesn't support" private values, but could this functionality not be implemented with closures?
Edit: typo
Edit: typo
This entry was edited (8 months ago)
Meghana :bongoCat: likes this.
Want to brush up on my #Python #MySQL and #JavaScript for a technical interview I may or may not get shortly. If anyone has any recommendations for additional resources that might be helpful, I'd be happy to look at them.
like this
For SQL, I found sqlbolt.com/ a bit ago. Has exercises at the bottom of each page, could be useful as a catch up, found it nice myself.
SQLBolt - Learn SQL - Introduction to SQL
SQLBolt provides a set of interactive lessons and exercises to help you learn SQLsqlbolt.com
Jonathan Lamothe likes this.
Jonathan Lamothe
Content warning: boring nerd stuff (example code)
Wouldn't this effectively make
count
into a private variable (granted, one that *couldn't* be inherited)?There's probably a better way of writing it too.
Zerody likes this.
Gabriel Pettier
•Content warning: boring nerd stuff (example code)
edit: though even in java or c++, you can do horrible stuff to access stuff that were declared "private", it's also a bad idea, but since people use libraries that sometime made stupid decisions, they will sometimes do it, because they can't find another way.
Gabriel Pettier
•Jonathan Lamothe
Gabriel Pettier
•Jonathan Lamothe
At the very least, it's fair to say that there is no official way.
Gabriel Pettier likes this.
Maurice LéDuck
•Jonathan Lamothe
dn
•Jonathan Lamothe
That said, it was more of a hypothetical question.