more advanced learning resources (code structure, fundamentals)

J

John [H2O]

Hello,

I've been programming in Python for a few years now. I have read most the
typical learning resources, such as 'Dive Into Python', 'A Byte of Python',
etc. In general I feel I have a good overview of the language. However, as I
advanced toward trying to create more OO styled programs, I feel I am
lacking some background on basic concepts.

I have read 'Coding' and 'Beautiful Code', and while these provide good
information on how to style and think about code, they haven't help me
design classes, think about where and when to use inheritance, decorators,
etc. The point is, most examples stop at demonstrating a single class, or
show a trivial decorator example. What I am after is something that will
help me design a program from scratch.

What are the key points to the classes? Is it okay to reference or pass
classes to instantiate a class? When would I want to use a decorator? How to
decide which should be a static method, and if I need them at all?

I know a lot of this would come from experience of working in a team, but
unfortunately, I'm mostly running solo. I am starting to look more and more
at source code too, which I find helpful, but the styles of programming vary
significantly. Perhaps someone could say which modules have nice 'exemplary'
code worth learning from?

So, if someone has a good book or online reference, please point me to it.
Other ideas too are most certainly welcome!

Best,
john
 
M

Mel

John [H2O] wrote:
[ ... ]
What are the key points to the classes? Is it okay to reference or pass
classes to instantiate a class?

Yes. The standard library does this in BaseHTTPServer (via its parent
SocketServer.) Maybe looks abstruse at the outset, but it's the natural way
to assign a fresh message handler to a new input message. Docs are via the
Python Global Module Index, source is in some directory like
/usr/lib/python2.6/SocketServer.py , .../BaseHTTPServer.py , etc.

Mel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top