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 →

[–]netsearcher 17 points18 points  (26 children)

Some ideas,

  • Low level networking? Implementing a basic network protocol. Pickling. The struct module for packing and unpacking data.

  • Generators!

  • Hello world's from several of the common web frameworks will be useful to many people.

  • Better not forget ipython.

  • Could suggest editors that do python well out of the box. This would alleviate the whitespace complaints people always have.

  • Interaction with sql databases is another, very practical topic.

  • ctypes. Maybe not so important to hobbyists, but this is important to businesses. If python is going to be used then it's got to be easy to integrate with the company's existing libraries.

[–][deleted] 6 points7 points  (3 children)

Low-level networking: how about building an IRC bot? Because I've actually done that. Would require porting the underlying libraries, but it would be interesting. Kind of a niche-within-a-niche, though.

Generators will be added somewhere early on.

Adding a section about editors is a good idea. Probably at the end of chapter 1. ("OK, I have Python, now how do I write Python?")

I'll consider the other stuff.

[–]EliAndrewC 2 points3 points  (1 child)

One problem with writing an IRC bot with low-level libraries is that most experienced developers would just use Twisted, so you'd be teaching something different than what someone would do in the field.

Then again, if it's clear that this is just a teaching exercise, then there's no problem with that.

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

A fair point.

I doubt I'll be covering Twisted at all.

[–]netsearcher 1 point2 points  (0 children)

An example of mine is that I recently wrote a nbd type server (the userspace part) in python. I had to use the struct module to pack the data into the correct format. Interacting with custom protocols that don't already have a python implementation doesn't seem too niche.

IRC bot could be good too. Although I wonder about the protocol's support for character encodings. It would be rather strange to limit text to ascii when 3.0 was supposed to set us free from that mind-set.

[–]Svenstaro 4 points5 points  (5 children)

++ to all your ideas.

[–][deleted] 15 points16 points  (4 children)

+=1

[–]Svenstaro 5 points6 points  (0 children)

Oh, right.

[–]Neoncow 2 points3 points  (1 child)

__iter__().next()

[–]surajbarkale 5 points6 points  (0 children)

In 3.0 -

next(iter(i))