More pythonic circle?

Pythor pythor at gmail.com
Sun Apr 9 12:00:09 EDT 2006


Steven D'Aprano wrote:
> No, "minimum number of space characters" means "you don't use enough
> spaces", not "your variable names are too short" *wink*
>
Hmm.  Guess I can't read too well.

> Within a single line, a good guideline is to leave a single space on
> either side of pluses and minuses (e.g. x**2 + 5*x - 3). Likewise, a
> single space on both sides of an equal sign and a single space after
> commas tend to be usual.
What I produced was natural for my fingers, but I can see that it's
difficult on the eyes.  I'll try to remember that.
>
> As for variables cx, cy, dx and dy, I don't believe that they are unclear.
> If your function is highly mathematical in nature, I believe it is
> acceptable if not expected to follow standard mathematical conventions
> such as r for radius, x and y for real numbers, z for complex, dx for
> delta (change of) x, etc. If in doubt, when initialising the variable add
> a comment spelling it out in full.
>
> On the other hand, you do have an argument "value" with default 255, with
> not even hint for what it is.
Well, value is just a value.  It's the number that get's punched into
the array for any points within the circle.  I didn't have any better
name I could think of.




More information about the Python-list mailing list