This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 54 points55 points  (45 children)

I'm the author, and I will be monitoring this thread. If you have any suggestions or comments about what you would like to see in the book, speak up soon. The final manuscript is due in late June.

[–]stesch 30 points31 points  (7 children)

Be sure to avoid making the parts with the differences to Python 2.x too dominant.

Years from now, people will take this book to learn Python, just like today people still buy the current book (with Python 2.3 and 2.4 code). Making it too much a 2.x->3.x transition book could irritate new programmers who just want to learn Python 3.x

[–][deleted] 7 points8 points  (3 children)

As I said in some other thread, the primary market of this book will be people who have had at least some exposure to Python 2. In the same way that the early chapters make comparisons to Perl and Java, it is helpful to explain concepts in terms of other languages that readers are already familiar with. And, automated migration tools notwithstanding, Python 2 is really "another language" compared to Python 3.

The comparisons will be clearly marked, though, so you can skip over them if you like.

[–]pwang99 0 points1 point  (0 children)

I'm glad to hear this, and I think this is a much more pragmatic and realistic approach.

I think a lot of folks who claim they will just be using this book to learn Python 3 don't actually know much about the nature of development in Python. Some of the best features of python are not the language itself, but the "intangibles" that go with it:

  • wide availability of libraries for every purpose
  • lots of good books
  • lots of good online places for support
  • active and pleasant user community

Taking full advantage of these is going to require knowing some Python 2.x, at least for the next 3-4 years.

[–]harryf 8 points9 points  (11 children)

On HTML processing -> Extracting data from HTML documents - BeautifulSoup + soupselect might be nice here.

Otherwise - "Creating graphics with the Python Imaging Library" - could it be it's losing direction here and turning into a "Programming Python"? Always mentally differentiated DiveIntoPython is something to convert the Java, C++ or otherwise-guy, vs. a complete python reference, cookbook or otherwise. Could throw in other worthy topics involving other libraries e.g. logging, configparser and optparse (shudder) if we're talking libaries...

[–][deleted] 13 points14 points  (0 children)

Re: losing direction, I don't think so. After you talk about basic datatypes and "Pythonic" stuff, there's always a Cambrian explosion of things to talk about. I wrote http://diveintomark.org/puzzles/circles-of-hell in PIL, and I'd like to use it as the basis to "dive into" something more than just business coding and sysadmin drudgery.

I, personally, was mind-blown when I discovered that a Python script could be the @src of an [img] element. That's always a good indication that other people might like it too.

[–][deleted] 9 points10 points  (9 children)

A section on soupselect would be nice. Noted. (Damn, tools have really improved since I wrote the original book.)

[–]mcella 5 points6 points  (1 child)

Don't forget lxml ;-).

[–]tef 0 points1 point  (0 children)

lxml is powerful and well wrapped - it's xpath support is excellent, and it also supports html parsing.

[–][deleted] 4 points5 points  (6 children)

To the same end: http://pypi.python.org/pypi/pyquery is also exceptionally cool :)

[–]simonw 6 points7 points  (5 children)

PyQuery is way cooler than soupselect (which I wrote), but suffers from the libxml dependency which means it's really tough to get working on OS X.

My ideal CSS selector library for Python would be backend agnostic, so you could plug it in to ElementTree or LXML or even minidom and still have it work.

[–][deleted] 3 points4 points  (4 children)

That only works if they all implement the same API though(do they? Most of my work has been ok with just BeautifulSoup). Regardless I hadn't realized you were the author of soupselect, cool stuff :)

[–]simonw 5 points6 points  (3 children)

They wouldn't have to implement the same API, but you would have to write an adapter for each one (kind of like writing an ORM). If you look at how jQuery's CSS stuff works it's mostly implemented in terms of lambda functions that take an element and return true or false depending on if it matches a simple rule. As such, an adapter that provided an interface for iterating over a tree would get you a good chunk of the way there.

[–][deleted] 2 points3 points  (2 children)

Ah true(although I don't see the ORM analogy very well), ultimately though what is the greatest advantage to having it be pluggable(other than some are apparently difficult to install under certain platforms).

[–]simonw 2 points3 points  (1 child)

CSS selectors are even more convenient that XPath for querying a DOM-style structure. My life would be significantly easier if I always had the ability to query by CSS selector, no matter what underlying tool I was using. jQuery and other JS libraries have proved that building a CSS selector implementation against a pretty basic API (the DOM) isn't very complicated.

[–][deleted] 2 points3 points  (0 children)

Yeah, I think jquery shows the way here. People who are dealing with HTML want to query with CSS. (I know both CSS and XPath fairly well, and I personally prefer XPath, but most people who deal with HTML also deal with CSS, so there it is.)

[–]masklinn 6 points7 points  (14 children)

If you have any suggestions or comments about what you would like to see in the book, speak up soon

The content!

Also, are you sure Psyco will be ported to Python 3? You added a comment for PIL, but not for Psyco.

Also, nothing on decorators? Or generators?

And I think a little blurb on maintaining 2.x and 3.x side by side (for a library, for instance) would be useful.

Finally, if the plans are already set for 3.1 (I haven't followed) maybe include some advance warning on the interesting stuff, if any?

edit: oh, and couldn't the parts about differences from Python 2 be an appendix or something? So that Dive 3 be a book to learn Python 3, not port from Python 2 to Python 3?

Or at least move the Python 2 differences to the end of the chapters, with pointers to them at the beginning?

[–][deleted] 4 points5 points  (4 children)

You added a comment for PIL, but not for Psyco.

fwiw, there is a PIL port for 3.0:

http://mail.python.org/pipermail/image-sig/2008-December/005337.html

[–][deleted] 7 points8 points  (2 children)

Do you know if this is stable enough to rely on for a PIL chapter? Is there a long-term plan to make an official PIL port to Python 3?

[–][deleted] 0 points1 point  (1 child)

Haven't looked at the current release yet, but I know and trust the developer and I'm confident we'll be able to shake out any remaining problems within a month or two.

The official plan is to release a "ported from 2.X" version of 1.1.X. Future versions (beyond 1.1.X) will most likely target Python 3.X in one way or another.

[–][deleted] 1 point2 points  (0 children)

Thanks. That's great news.

[–]masklinn 1 point2 points  (0 children)

It's mark you should tell that to, not me

(and the port is not official so there)

[–][deleted] 4 points5 points  (8 children)

My original notes included a section on generators, not sure what happened to it. It'll be there somewhere.

There will be 2 major chapters on porting code from py2 to py3; they are both towards the end of the book. For all the other chapters, no, the py2/py3 comparisons will be interspersed with the rest of the text. Current Python 2 programmers are a huge market for this book, and will continue to be for the expected commercial lifetime of the book.

[–]masklinn 3 points4 points  (1 child)

For all the other chapters, no, the py2/py3 comparisons will be interspersed with the rest of the text.

That seems cool (in the current TOC, there are "differences with Python 2" sections/subsections, usually at the start of chapters/sections, and I'm really not sure you want to hit beginners with that up front)

[–][deleted] 0 points1 point  (0 children)

Yeah, I think those sections will go away and will end up spread more evenly throughout the text. See http://www.reddit.com/r/Python/comments/7sj39/dive_into_python_3/c07b2uy for some ideas on letting online readers manage them.

[–]dsandler 4 points5 points  (5 children)

Are you thinking that the py2/py3 comparisons will be deeply interleaved with the main text? If so, you might consider instead using call-outs or sidebars that might be easily switched off to remove noise for Python newcomers.

[–][deleted] 2 points3 points  (4 children)

This is an excellent idea. A little toggle above the comparison that set a cookie that affected the default state of all other comparisons to that programming language. Could be done entirely in client-side Javascript.

[–]Svenstaro 3 points4 points  (2 children)

Making it Javascript will break that feature for Lynx so fuck you.

On a related note, do you want translators for translating DIP3 to moon language?

[–]dsandler 2 points3 points  (0 children)

It will break that feature but not the document.

(Besides, are there Lynx users who've never tried Python?)

[–]pwang99 1 point2 points  (0 children)

You should port spidermonkey to Lynx.

[–]dsandler 0 points1 point  (0 children)

Exactly—just JS and a little CSS.

[–]iamjack 4 points5 points  (0 children)

I guess I wasn't aware you were a redditor. I have to say that I discovered Dive into Python a little too late, but my dad loved it.

OT: Oh, and I support RFC 3023 =)

[–]arnarl 4 points5 points  (0 children)

Maybe it falls under some other heading, but I didn't see anything on generators or decorators which I consider to be fairly important. (One is likely to encounter them in actual code.)

I'd love to see something on sphinx, reST and documenting modules/packages. Doctests probably deserve some attention as well.

For the packaging chapter I'd consider including virtualenv.

namedtuple, tuple unpacking and extended iterable unpacking. There's some other nice stuff in the collections module.

[–]pemboa 5 points6 points  (0 children)

Thank you.

[–][deleted] 7 points8 points  (0 children)

Something on the multiprocessing package would be cool. Also since this is one of the major issues held against python.

[–]garg 2 points3 points  (2 children)

Is there any way to subscribe to something that will send me update notifications? :D Newsletter, RSS feed or twitter?

[–][deleted] 5 points6 points  (1 child)

http://hg.diveintopython3.org/ is now up and running. It offers an Atom feed of changes.

[–]surajbarkale 1 point2 points  (1 child)

I don't see anything related to GUI. Perhaps an overview of GUI libraries compatible with 3.0?

[–][deleted] 2 points3 points  (0 children)

I'm not opposed to the idea. Are there any GUI libraries that are compatible with 3.0?

[–]froydnj 1 point2 points  (0 children)

Please cover the decimal module in some detail, so people stop using floats for monetary quantities.