Suggestions

Post suggestions for new articles as comments to this page:

Add a suggestion!

If you can, format your suggestion as an article stub, so the editors can just cut and paste when creating the actual article page. Complete articles are of course even better. For some tips on formatting, see the example on this page.

If you have other suggestions, feel free to post them here as well.

Note: Suggestions for the Tutor FAQ should be posted to this page.

Note: Comments on the Python documentation should be posted to the relevant bug tracker. See the Comments and Questions section on this page for details.

Note: The comment section below is not properly formatted. Don’t worry about how things look on this page; the formatting will be fixed if the page is published.

 

Comment:

The "Python's Design" questions should probably be broken out into a FAQ of their own.

Posted by amk

I've started tagging such entries with "CATEGORY: design" /F

Comment:

An article about escaping and "unescaping" HTML/XML would be nice, I think. Stuff to look at: cgi.escape, xml.sax.saxutils, HTML and XML parsers, htmlentitydefs, my re.sub examples, etc.

Posted by Fredrik (2006-10-29)

Comment (moved from 'How do I share global variables across modules?'):

For clarity, the sentence "Note that using a module is also the basis for implementing the Singleton design pattern, for the same reason." should link to a FAQ "How to implement the Singleton design pattern".

Posted by Ikipou (2006-11-05)

Comment:

Q: How do I calculate what quoted strings and numbers mean?

A: eval(source, {'builtins': {}}) works, without also accidentally accepting OS commands as input.

Note: Eval might surprise you if you mistype this idiom as: eval(source, {}).

Note: This idiom makes sense of ordinary Python literals (such as 010, 0x8, 8.125e+0, and "\x45ight"). This idiom also correctly interprets simple literal expressions, such as 64**0.5.

Posted by Pat LaVarre (2006-11-10)

I'm afraid "eval" is never a good choice if you cannot trust the source; it's trivial to do various denial-of-service attacks. See this page for an example. A FAQ entry that discusses safe approaches (type constructors, decoders, compiler/tokenizer-based approaches etc is a good idea, though. /F

Comment:

FAQ: How do I ask to exit from a doctest. --- A: raise KeyboardInterrupt --- doctest exits on KeyboardInterrupt like python -i exits on SystemExit. doctest catches SystemExit like python -i catches KeyboardInterrupt.

Posted by Pat LaVarre (2006-11-10)

I don't think this qualifies as a *frequently* asked question, really. Maybe you could resubmit this as a documentation improvement suggestion? /F

Comment:

What are decorators? What are they good for? What are metaclasses? What are they good for?

Posted by Ian Sparks (2006-11-13)

Comment:

Q: Where can I find/meet other Python developers? A: - See the list of Python User Groups (http://wiki.python.org/moin/LocalUserGroups). - Join the Python Mailing list (http://www.python.org/community/lists) and ask. - Ask at the Computing Centre of your local University. - Go to a Python conference (http://www.python.org/community/workshops). - Organize a Python meetup (http://python.meetup.com/) or even a Python User Group (PUG) in your town. - Get a job as a Python Programmer (http://www.python.org/community/jobs).

Posted by Christopher Arndt (2006-11-15)

Comment:

Where can I find a source code template to start my program? Is there a tool (question/answer) to prototype a source code? Is there a tool (question/answer) to prototype a python project?

Posted by karl (2006-11-16)

Comment:

reposted from c.l.python:

> UnicodeDecodeError, UnicodeEncodeError:
> 
> I was about to ask mildly the other day whether a c.l.py poster had
> RTFFAQ when I thought "Hmmm long while since I'd RTFFAQ myself, better
> have a peep". Shock/horror; couldn't find "UnicodeEncodeError" -- why
> not? See below:
> 
> FAQ: What does 'UnicodeError: ASCII [decoding,encoding] error: ordinal
> not in range(128)' mean?
> 
> Python:
> 
> Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on win32
> | >>> str(u'\xff')
> UnicodeError: ASCII encoding error: ordinal not in range(128)
> 
> Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)]
> on win32
> | >>> str(u'\xff')
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xff' in
> position 0:
> ordinal not in range(128)

Posted by John Machin (2006-11-16)

Comment:

CATEGORY: Design Q: Why there aren't any repeat/until or do/while block (condition at the end of the loop) in Python? Because it is a) inconsistent with Python's way of "block ending only by identation end" (an until statement would be effectively an end-block statement) and more importantly b) this pattern is very easily done with while: keep_looping = True while keep_looping: ...something that change keep_looping to a false value... or while True: ... if exit_condition: break

Posted by Eduardo O Padoan (2006-11-16)

Comment:

What are "properties" and how do I use them?

Posted by Euan (2006-11-24)

Comment:

Add a page about running external processes: os.system, os.popen, subprocess, etc.

Posted by Fredrik (2006-12-05)

Comment:

## How do I compile a Windows extension with the MinGW compiler? Distutils defaults to attempting to compile extensions with the compiler that the python executable was built with. You need to explicitly tell it to use a different one. Normally you would install an extension like this: python setup.py install You instead need to do this: python setup.py build --compiler=mingw32 python setup.py install If you want to make MinGW your default compiler, create the file c:\Python2x\Lib\distutils\distutils.cfg with the following content: [build] compiler=mingw32 > Note, this is working from memory with recent MinGW, I do not have a windows > machine to test this on at the moment. There are a lot of confusing web pages > that talk about creating a libpython2x.a which MinGW uses to figure out how to > link against the DLL. Either Python 2.4 added the .a file, or MinGW figured > out how to just deal with it.

Posted by Chris Lambacher (2006-12-07)

Comment:

On comp.lang.python "mixins" are often named. I would like a FAQ about what (generically) a mixin is, how it can be implemented in Python, and when/why it should be used.

Posted by Giovanni Bajo (2006-12-09)

A Django site. rendered by a django application. hosted by webfaction.