This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Drop Shadow behind ui.view()
blmacbeth last edited by
@Phuket2 I wish I have a cool trick up my sleeve! But to comment on your response about not calling
super: it is best practice to call
superwhen subclassing. This is because it allows you to refactor your code with less changes made afterwards.
For example: let's say I someday make a kick-ass version of
ui.Viewlook like children's toys. So, you want to incorporate the new view classes into your old code. The way you have, you would need to change every instance of
ui.View.__init__(...). By calling
superyou no longer have to do all that tedious work. It makes life slightly easier.
I'm not saying that what your doing is wrong; I have plenty of classes that do the same thing. But o have started using
superbecause of the refactoring issue.
Now, this could all be a load of bullshit I am feeding you, so go look it up yourself and let me know if I'm correct! 😛
Phuket2 last edited by
@blmacbeth , hmmm, I am a little on the drunk side now 🎉😎 almost 11:30pm here now. So maybe I should wait until tomorrow to look it up 😱
But I started getting a problem when inheriting from multiple classes. Gets confusing about which base class is being called ( it did for me anyway). That's when I started using the implicit calls to base class's init methods instead. But I see your point though. I haven't managed to write anything significant enough in Python were it's been a problem to refactor 😭
Still trying though
JonB last edited by
re needing to call View.init, see
If you do not implement your own init, you do not need to call super init.
If you have an init, you do need to call the View.init
dgelessus last edited by
From what I've heard, you need to use
super()for some aspects of multiple inheritance to work properly. I know almost nothing about the details of multiple inheritance on Python though, so I can't tell you why exactly that is and what would break otherwise. Mostly because multiple inheritance is not needed very often.