[zope2-tracker] [Bug 1217123] [NEW] zope.cachedescriptors documentation promotes errors

Michael JasonSmith 1217123 at bugs.launchpad.net
Tue Aug 27 00:20:57 CEST 2013


Public bug reported:

The documentation for zope.cachedescriptors currently contains the
following import

>>> from zope.cachedescriptors import property

When trying out the (very useful) zope.cachedescriptors product for the
first time it is common that just one attribute will be converted to
"Lazy", with other attributes left with the standard "property"
decorator. However, the import in the documentation overwrites the
built-in "property" decorator, causing a confusing "TypeError":

>>> class Foo(object):
...     @property
...     def bar(self):
...         return 'wibble'
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "<console>", line 2, in Foo
TypeError: 'module' object is not callable

To help out novice developers (or expert developers that are tired,
harried, or distracted) the import of "property" should be avoided.

** Affects: zope2
     Importance: Undecided
         Status: New


** Tags: documentation property typeerror zope.cachedescriptors

** Patch added: "Untested patch to fix the documentation for zope.cachedescriptors."
   https://bugs.launchpad.net/bugs/1217123/+attachment/3789108/+files/fix-property-doc.txt

-- 
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.
https://bugs.launchpad.net/bugs/1217123

Title:
  zope.cachedescriptors documentation promotes errors

To manage notifications about this bug go to:
https://bugs.launchpad.net/zope2/+bug/1217123/+subscriptions


More information about the zope2-tracker mailing list