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
68249531
Commit
68249531
authored
Nov 04, 2003
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'parity' method to ZTUtils Iterators.
parent
398eb2df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/ZTUtils/Iterator.py
lib/python/ZTUtils/Iterator.py
+7
-2
No files found.
doc/CHANGES.txt
View file @
68249531
...
@@ -8,6 +8,8 @@ Zope Changes
...
@@ -8,6 +8,8 @@ Zope Changes
Features added
Features added
- Add 'parity' method to ZTUtils Iterators.
- Allow untrusted code to mutate ZPublisher record objects.
- Allow untrusted code to mutate ZPublisher record objects.
- Added a "mime-types" configuration value which names a file
- Added a "mime-types" configuration value which names a file
...
...
lib/python/ZTUtils/Iterator.py
View file @
68249531
...
@@ -18,8 +18,8 @@ The Iterator() function accepts either a sequence or a Python
...
@@ -18,8 +18,8 @@ The Iterator() function accepts either a sequence or a Python
iterator. The next() method fetches the next item, and returns
iterator. The next() method fetches the next item, and returns
true if it succeeds.
true if it succeeds.
$Id: Iterator.py,v 1.1
0 2003/10/21 12:21:52 andreasjung
Exp $'''
$Id: Iterator.py,v 1.1
1 2003/11/04 19:27:16 evan
Exp $'''
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
class
Iterator
:
class
Iterator
:
'''Simple Iterator class'''
'''Simple Iterator class'''
...
@@ -63,6 +63,11 @@ class Iterator:
...
@@ -63,6 +63,11 @@ class Iterator:
def
odd
(
self
):
return
self
.
index
%
2
def
odd
(
self
):
return
self
.
index
%
2
def
parity
(
self
):
if
self
.
index
%
2
:
return
'odd'
return
'even'
def
letter
(
self
,
base
=
ord
(
'a'
),
radix
=
26
):
def
letter
(
self
,
base
=
ord
(
'a'
),
radix
=
26
):
index
=
self
.
index
index
=
self
.
index
s
=
''
s
=
''
...
...
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