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


Groups > comp.lang.python > #56909 > unrolled thread

Re: how to add object from dict

Started byBen Finney <ben+python@benfinney.id.au>
First post2013-10-17 10:45 +1100
Last post2013-10-17 10:45 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: how to add object from dict Ben Finney <ben+python@benfinney.id.au> - 2013-10-17 10:45 +1100

#56909 — Re: how to add object from dict

FromBen Finney <ben+python@benfinney.id.au>
Date2013-10-17 10:45 +1100
SubjectRe: how to add object from dict
Message-ID<mailman.1125.1381967149.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web