Brad Miller <[EMAIL PROTECTED]> added the comment:

> I would suggest considering a custom displayhook approach. You can
> write a custom displayhook that will print range(..), {}.keys(),
> {}.values() etc in a student-friendly way.   I believe a module
> installing such display hook can be included in the standard library.
> In addition to iterable's display problem such a hook can limit the
> amount of output when displaying long lists, insert smart line breaks
> etc.  For a textbook, you can instruct the readers to download your
> code and import a custom module before trying the examples.  This is
> likely to make your textbook more future-proof because you will be
> able to update your displayhook code as python changes.

That is an interesting idea!  I just hacked together a quick prototype.  
I'll discuss this with my co-author.  Its a fine line between using 
'real'
Python and providing an appropriate level of help for the beginner.  We
have tried to minimize the number of additional modules and 
dependencies, so
if there was a hook like this as part of the standard library that would 
be
great.

Brad

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2610>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to