Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #56911

Re: how to add object from dict

Subject Re: how to add object from dict
From Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org>
Date 2013-10-17 03:38 +0330
References <1381961694.21908.13.camel@debian> <7wwqlcixup.fsf@benfinney.id.au>
Newsgroups comp.lang.python
Message-ID <mailman.1127.1381968554.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, 2013-10-17 at 10:45 +1100, Ben Finney wrote:
> Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> writes:
> 
> > and another file,(projectsFind.py) i have the following code:
> > #################################################################3
> >         for key, val in
> > self.projectsInstance.addOnFieldsInstance.items():
> >             instance = getattr(self,"%s" % val)
> >             print val
> >             #QtCore.QObject.connect(instance,
> > QtCore.SIGNAL(_fromUtf8("stateChanged (int)")),
> >                                 #lambda:
> > self.projectsInstance.setFilterDict_Find("TWCH",self,"addonfields",instance.CheckState(),instance))
> > ######################################################################3
> 
> The above code has been mangled, and the indentation isn't correct. I
> don't want to guess what it was originally; better that you find a user
> agent which won't wrap your code lines.
> 
> The code is also difficult to read because it's got a lot of
> camelCaseNames and it's hard to see what the intent is. (I'd advise
> improving the code to conform to PEP 8, which will make your code easier
> to discuss with the Python community.)
> 
> Lastly, it's not complete: we can't run it to see what you're seeing.
> 
> Please re-work (or create) a short, self-contained, complete example
> that shows the behaviour <URL:http://sscce.org/>.
> 
> -- 
>  \     “Wrinkles should merely indicate where smiles have been.” —Mark |
>   `\                                    Twain, _Following the Equator_ |
> _o__)                                                                  |
> Ben Finney
> 
Thank you for your useful link , i paste my code into :
http://www.heypasteit.com/clip/1008

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: how to add object from dict Mohsen Pahlevanzadeh <mohsen@pahlevanzadeh.org> - 2013-10-17 03:38 +0330

csiph-web