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


Groups > comp.lang.python > #7021

Re: Determine attributes of calling method

References <6708872e-bf6e-4f7c-b9ec-d00a71cddc4f@j23g2000yqc.googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2011-06-04 14:02 -0600
Subject Re: Determine attributes of calling method
Newsgroups comp.lang.python
Message-ID <mailman.2458.1307217779.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Jun 3, 2011 at 2:35 PM, Joe <joe.cwikla@gmail.com> wrote:
>    foo.__dict__['color']='blue'
>    fu.__dict__['color']='red'

You don't need to use __dict__ to set function attributes.  Just do:

foo.color = 'blue'

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


Thread

Determine attributes of calling method Joe <joe.cwikla@gmail.com> - 2011-06-03 13:35 -0700
  Re: Determine attributes of calling method Richard Thomas <chardster@gmail.com> - 2011-06-04 04:54 -0700
  Re: Determine attributes of calling method Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-04 14:02 -0600

csiph-web