Hello,
I usually turn off PEP 8 inspections in pycharm, but I gave it a try and
turned inspections on to see what complains I get.
I didn“t get much so far, but one that made me think if I am programming
right is "instance attribute defined outside __init__"
Basically I am doing a UI in pyside, and as learned reading programming
articles and also in this forum, I am trying to chop my code in as many
methods as needed to keep things clean and easy to track.
So I have a method called create_mainLayout() where I organize the big
layout blocks. I write something like this:
def create_mainLayout(self):
self.L_vLao = QtGui.QVBoxLayout()
bla bla bla
And here is where I get the PEP 8 complain mentioned: "instance attribute
defined outside __init__"
The reason why I do this is because then I have another method that picks up
this self.L_vLao to get into more detail.
So if i want to use a variable created in another method, I have no choice but
using self.
I thought creating self.something inside methods was okey.
Is my code badly designed?
Thank you,
R
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/5e4ad9fa-ebfb-4868-ad92-1391d1efca29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.