Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7374] Property accessor/getter called twice

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 22, 2009, 12:14 AM

Post #1 of 3 (109 views)
Permalink
[issue7374] Property accessor/getter called twice

New submission from Michal Liddle <michael [at] liddle>:

The following snippet demonstrates the problem:

-------------------------------------
class Test(object):
def get(self):
print "get"
def set(self, v):
print "set"
test = property(get, set)

t = Test()
t.test
t.test = 3
-----------------------------------

"get" is printed twice (expected once?), "set" is printed only once (as
expected)

----------
messages: 95595
nosy: mliddle
severity: normal
status: open
title: Property accessor/getter called twice
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7374>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 22, 2009, 12:41 AM

Post #2 of 3 (111 views)
Permalink
[issue7374] Property accessor/getter called twice [In reply to]

Raymond Hettinger <rhettinger [at] users> added the comment:

Tried your snippet with both py2.5 and py2.6. It works as expected (one
get and one set).

----------
nosy: +rhettinger
resolution: -> works for me
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7374>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 22, 2009, 5:01 AM

Post #3 of 3 (97 views)
Permalink
[issue7374] Property accessor/getter called twice [In reply to]

Michal Liddle <michael [at] liddle> added the comment:

Right you are. Looks like its actually an IPython specific behaviour
here (didn't think to check that in the first place, sorry).

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7374>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.