beaker icon indicating copy to clipboard operation
beaker copied to clipboard

len() doesn't work in SessionObject proxy

Open mikeorr opened this issue 13 years ago • 1 comments

The SessionObject proxy used by pyramd_beaker does not proxy the __len__ method to the Session, so len(session) doesn't work.

>>> import beaker.session
>>> import pyramid.testing
>>> req = pyramid.testing.DummyRequest()
>>> so = beaker.session.SessionObject(req)
>>> len(so)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: object of type 'SessionObject' has no len()
>>> len(so._session())
2

mikeorr avatar Dec 04 '12 22:12 mikeorr