On 2025-12-18 04:25:35 -0500, c186282 wrote:
> On 12/18/25 01:54, rbowman wrote:
> > On Wed, 17 Dec 2025 23:02:24 -0500, c186282 wrote:
> > 
> > >     Oh, I usually write "i=i+2". It's a bit more clear and becomes the
> > >     same code anyway. += is more a 'C' thing.
> > 
> > And Python, C#, JavaScript, C++, ...
> 
>   Well, I know it *works* ... I just choose not
>   to do it in Python. Everyone has their 'style'.

Yes, but that's *your* style, not Python style.

There is the concept of "pythonic" Code (just like there is a concept of
idiomatic code in (almost) any language), but if you ask 100 randomly
chosen Python programmers whether the use of += is pythonic, I doubt
that more than a handful would say no.

        hjp


-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | [email protected]         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachment: signature.asc
Description: PGP signature

-- 
https://mail.python.org/mailman3//lists/python-list.python.org

Reply via email to