Message6966

Author jeff250
Recipients hyao, jeff250, smeatonj
Date 2012-03-27.07:07:28
SpamBayes Score 2.3346367e-06
Marked as misclassified No
Message-id <1332832048.62.0.0412720903745.issue1730@psf.upfronthosting.co.za>
In-reply-to
Content
As the documentation says, "partial objects are like function objects in that they... can have attributes."  So aside from the three read-only attributes, partial objects should not just take __doc__ but any other attribute.

In cpython,

>>> from functools import partial
>>> basetwo = partial(int, base=2)
>>> basetwo.x = 123
>>> basetwo.x
123

But in jython,

>>> from functools import partial
>>> basetwo = partial(int, base=2)
>>> basetwo.x = 123
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: '_functools.partial' object has no attribute 'x'
History
Date User Action Args
2012-03-27 07:07:28jeff250setmessageid: <1332832048.62.0.0412720903745.issue1730@psf.upfronthosting.co.za>
2012-03-27 07:07:28jeff250setrecipients: + jeff250, smeatonj, hyao
2012-03-27 07:07:28jeff250linkissue1730 messages
2012-03-27 07:07:28jeff250create