classification
Title: poplib.py list interface
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: postponed
Dependencies: Superseder:
Assigned To: Nosy List: exarkun, facundobatista, hdiwan650
Priority: normal Keywords:

Created on 2006-09-29 18:51 by hdiwan650, last changed 2008-06-23 22:46 by facundobatista. This issue is now closed.

Files
File name Uploaded Description Edit
poplib.pat hdiwan650, 2006-10-04 22:38 poplib.pat revised to reflect kuran's comments
Messages (6)
msg54913 - (view) Author: Hasan Diwan (hdiwan650) Date: 2006-09-29 18:51
Adds a list-like interface to poplib.py, poplib_as_list.
msg54914 - (view) Author: Hasan Diwan (hdiwan650) Date: 2006-10-04 20:29
Logged In: YES 
user_id=1185570

I changed it a little bit, added my name at the top of the
file as the maintainer. 
msg54915 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2006-10-04 21:13
Logged In: YES 
user_id=366566

Some review comments:

  * poplib_as_list should have a class docstring explaining
its purpose.  The name is fairly suggestive, but some prose
would be better.

  * Why duplicate the arguments to POP3_SSL and POP3 in
poplib_as_list.__init__?  Wouldn't it be better if it took
an already-constructed POP3 or POP3_SSL instance?

  * Does subclassing list really buy much here?  None of the
overridden methods upcall, and many list methods aren't
implemented here at all: what if someone calls pop on a
poplib_as_list instance?  Ditto for a bunch of other
operations that one might expect to work on a list.

  * __getslice__ is buggy - the return statement is indented
too far.  __getitem__ and __delitem__ will also pass a slice
instance on the underlying pop method when extended slices
are used.

  * segue from the previous comment - unit tests?  Python
has pretty low overall coverage, but all new code at least
can benefit from being committed initially with a
comprehensive test suite.

  * The docstrings on all of the methods that have them are
pretty good, although the __getattribute__ docstring is more
of an implementation note.

  * Should the library reference be updated as well?

Overall, I'm not sure how useful this feature is.  A generic
wrapper class would probably be beneficial to more people.
msg54916 - (view) Author: Hasan Diwan (hdiwan650) Date: 2006-10-04 22:38
Logged In: YES 
user_id=1185570

I'm going to address your points top to bottom:
1. Fixed, you're right it should and does now.
2. The idea of a list wrapper is to serve as a convenient
interface to the most commonly used methods of a poplib
instance while hiding the underlying class(es).
3. Subclassing list was a mistake, I was merely trying to
provide an idea for the interface. Summarily removed.
4. __getslice__ fixed.
5. Unit tests will take a little longer because we need to
make a dummy poplib instances to test with.
6. __getattribute__ docstring dropped.
7. I don't know, should it?
msg68583 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-06-22 21:53
Hasan, are you still interested in this or wants to drop this request?
Passing almost two years without comments it's no good if you'll be the
package maintainer.

Thanks!
msg68656 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-06-23 22:46
2008/6/22 Hasan Diwan <hasan.diwan@gmail.com>:

> Yea, I guess that since nothing has happened to it in the past 2 years
> (as you said), it's probably a good idea to close it.

Ok, closing it. Feel free to reopen if interested.

Thanks!
History
Date User Action Args
2008-06-23 22:46:23facundobatistasetstatus: open -> closed
resolution: postponed
messages: + msg68656
2008-06-22 21:53:01facundobatistasetnosy: + facundobatista
messages: + msg68583
2006-09-29 18:51:44hdiwan650create