[Tutor] Python 2.7.1 interpreter passing function pointer as function argument and Shedskin 0.7
Steven D'Aprano
steve at pearwood.info
Wed Dec 29 11:28:07 CET 2010
Alan Gauld wrote:
>
> "Frank Chang" <frankchang91 at gmail.com> wrote
>
>> I apologize for the cut and paste mangling. Is there a better method
>> than copy-pasting for including 20 or more lines of python source code in
>> the tutor posts? Thank you.
>
> Long listings are usually better in pastebin - where the indentation is
> clear and we get syntax colouring too. It all makes them more readable :-)
Even better is to spend the time to work out the smallest amount of code
that exhibits the problem. The code you post must be runnable, it must
actually demonstrate the problem -- it is surprising how many people
post "broken" code that actually works, or worse, code that fails in
some completely different way -- and lastly, and most importantly, it
should be as small as possible.
Doing so shows respect to those you are asking to look at the code, AND
maximizes the number of people willing to spend the time answering your
question: instead of looking at 200 lines and seven functions, they only
need to look at one function and sixteen lines of code. (Or whatever it
takes to reproduce the problem.)
Even more important, while trying to reproduce the problem in the
minimum code possible, you may very well solve the problem yourself. I
can't tell you how many times I've gone to write up a request for help,
but while refactoring my code I've discovered the mistake and didn't
need to post my question.
--
Steven
More information about the Tutor
mailing list