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


Groups > comp.lang.python > #40646

Re: Creating an object that can track when its attributes are modified

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'append': 0.07; 'attributes': 0.07; 'builtin': 0.07; 'received:151': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; ':-)': 0.13; 'modification': 0.15; 'emanuele': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:object': 0.16; 'subject:when': 0.16; 'url:py': 0.16; "i'd": 0.22; 'header:User- Agent:1': 0.26; 'implemented': 0.27; 'opposed': 0.27; 'header:X -Complaints-To:1': 0.28; 'writes:': 0.29; 'classes': 0.30; 'to:addr:python-list': 0.33; 'list': 0.35; 'ben': 0.35; 'similar': 0.35; "won't": 0.35; 'something': 0.35; 'received:org': 0.36; 'really': 0.36; 'but': 0.36; 'url:org': 0.36; 'far': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'believe': 0.69; 'quando': 0.84; 'subject:its': 0.84; 'url:sqlalchemy': 0.84; 'url:trac': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Lele Gaifax <lele@metapensiero.it>
Subject Re: Creating an object that can track when its attributes are modified
Date Wed, 06 Mar 2013 17:56:05 +0100
Organization Nautilus Entertainments
References <b281a2a6-5822-45c7-bf69-c80c738ef92c@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host 151.62.76.222
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
Cancel-Lock sha1:QqBcuN0p2mlIPAOttGoc/UvBqMg=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2951.1362588987.2939.python-list@python.org> (permalink)
Lines 19
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1362588987 news.xs4all.nl 6967 [2001:888:2000:d::a6]:54505
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:40646

Show key headers only | View raw


Ben Sizer <kylotan@gmail.com> writes:

> I also believe that this won't catch modification to existing
> attributes as opposed to assignments: eg. if one of the attributes is
> a list and I append to it, this system won't notice. Is that something
> I can rectify easily?

It's really up to how far you wanna go: a similar use case is
implemented by SQLAlchemy__, which "instrument" builtin collection
classes to achieve the goal. But I'd not call that "easy" though :-)

ciao, lele.

__ http://www.sqlalchemy.org/trac/browser/lib/sqlalchemy/orm/collections.py
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

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


Thread

Creating an object that can track when its attributes are modified Ben Sizer <kylotan@gmail.com> - 2013-03-06 08:07 -0800
  Re: Creating an object that can track when its attributes are modified Chris Angelico <rosuav@gmail.com> - 2013-03-07 03:22 +1100
    Re: Creating an object that can track when its attributes are modified Ben Sizer <kylotan@gmail.com> - 2013-03-06 08:56 -0800
      Re: Creating an object that can track when its attributes are modified Chris Angelico <rosuav@gmail.com> - 2013-03-07 04:03 +1100
      Re: Creating an object that can track when its attributes are modified 88888 Dihedral <dihedral88888@googlemail.com> - 2013-03-06 13:07 -0800
      Re: Creating an object that can track when its attributes are modified 88888 Dihedral <dihedral88888@googlemail.com> - 2013-03-06 13:07 -0800
    Re: Creating an object that can track when its attributes are modified Ben Sizer <kylotan@gmail.com> - 2013-03-06 08:56 -0800
      Re: Creating an object that can track when its attributes are modified Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-07 00:07 +0000
        Re: Creating an object that can track when its attributes are modified Ben Sizer <kylotan@gmail.com> - 2013-03-06 16:26 -0800
          Re: Creating an object that can track when its attributes are modified Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-08 18:50 +0000
  Re: Creating an object that can track when its attributes are modified Lele Gaifax <lele@metapensiero.it> - 2013-03-06 17:56 +0100
  Re: Creating an object that can track when its attributes are modified Schneider <js@globe.de> - 2013-03-07 13:21 +0100

csiph-web