Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
be45dbd3
Commit
be45dbd3
authored
Dec 15, 2010
by
Andreas Zeidler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
back-port c118896 from 2.13
parent
410714c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
src/Products/ZCatalog/Lazy.py
src/Products/ZCatalog/Lazy.py
+4
-8
No files found.
src/Products/ZCatalog/Lazy.py
View file @
be45dbd3
...
@@ -134,20 +134,16 @@ class LazyMap(Lazy):
...
@@ -134,20 +134,16 @@ class LazyMap(Lazy):
def
__init__
(
self
,
func
,
seq
,
length
=
None
):
def
__init__
(
self
,
func
,
seq
,
length
=
None
):
self
.
_seq
=
seq
self
.
_seq
=
seq
self
.
_data
=
{}
self
.
_func
=
func
self
.
_func
=
func
if
length
is
not
None
:
self
.
_len
=
length
if
length
is
not
None
:
self
.
_len
=
length
else
:
self
.
_len
=
len
(
seq
)
else
:
self
.
_len
=
len
(
seq
)
self
.
_marker
=
object
()
self
.
_data
=
[
self
.
_marker
]
*
self
.
_len
def
__getitem__
(
self
,
index
):
def
__getitem__
(
self
,
index
):
data
=
self
.
_data
data
=
self
.
_data
try
:
s
=
self
.
_seq
if
index
in
data
:
except
AttributeError
:
return
data
[
index
]
return
data
[
index
]
value
=
data
[
index
]
=
self
.
_func
(
self
.
_seq
[
index
])
value
=
data
[
index
]
if
value
is
self
.
_marker
:
value
=
data
[
index
]
=
self
.
_func
(
s
[
index
])
return
value
return
value
class
LazyFilter
(
Lazy
):
class
LazyFilter
(
Lazy
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment