Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b5ba8d74
Commit
b5ba8d74
authored
Feb 07, 2004
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lists work better when popping from the right.
parent
3ba85c2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Lib/mailbox.py
Lib/mailbox.py
+4
-3
No files found.
Lib/mailbox.py
View file @
b5ba8d74
...
...
@@ -199,6 +199,7 @@ class MHMailbox:
# This only works in Python 1.6 or later;
# before that str() added 'L':
self
.
boxes
=
map
(
str
,
list
)
self
.
boxes
.
reverse
()
self
.
factory
=
factory
def
__iter__
(
self
):
...
...
@@ -207,7 +208,7 @@ class MHMailbox:
def
next
(
self
):
if
not
self
.
boxes
:
return
None
fn
=
self
.
boxes
.
pop
(
0
)
fn
=
self
.
boxes
.
pop
()
fp
=
open
(
os
.
path
.
join
(
self
.
dirname
,
fn
))
msg
=
self
.
factory
(
fp
)
try
:
...
...
@@ -233,7 +234,7 @@ class Maildir:
curdir
=
os
.
path
.
join
(
self
.
dirname
,
'cur'
)
boxes
+=
[
os
.
path
.
join
(
curdir
,
f
)
for
f
in
os
.
listdir
(
curdir
)
if
f
[
0
]
!=
'.'
]
boxes
.
reverse
()
self
.
boxes
=
boxes
def
__iter__
(
self
):
...
...
@@ -242,7 +243,7 @@ class Maildir:
def
next
(
self
):
if
not
self
.
boxes
:
return
None
fn
=
self
.
boxes
.
pop
(
0
)
fn
=
self
.
boxes
.
pop
()
fp
=
open
(
fn
)
return
self
.
factory
(
fp
)
...
...
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