Re: Python

2025-12-21 Thread Thomas Passin
On 12/21/2025 11:54 AM, Chris Angelico via Python-list wrote: On Mon, 22 Dec 2025 at 03:19, Peter J. Holzer wrote: On 2025-12-21 23:59:48 +1100, Chris Angelico via Python-list wrote: On Sun, 21 Dec 2025 at 23:31, Peter J. Holzer wrote: There is the concept of "pythonic" Code (just like ther

Re: Python

2025-12-21 Thread Chris Angelico via Python-list
On Mon, 22 Dec 2025 at 03:19, Peter J. Holzer wrote: > > On 2025-12-21 23:59:48 +1100, Chris Angelico via Python-list wrote: > > On Sun, 21 Dec 2025 at 23:31, Peter J. Holzer wrote: > > > There is the concept of "pythonic" Code (just like there is a concept of > > > idiomatic code in (almost) any

Re: Python

2025-12-21 Thread Peter J. Holzer
On 2025-12-21 23:59:48 +1100, Chris Angelico via Python-list wrote: > On Sun, 21 Dec 2025 at 23:31, Peter J. Holzer wrote: > > 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 progra

Re: Python

2025-12-21 Thread Roel Schroeven
Op 18/12/2025 om 5:02 schreef c186282:   Oh, I usually write "i=i+2". It's a bit more   clear and becomes the same code anyway. I'm going to disagree here. In my opinion i += 2 is more clear. It avoids repeating the i, which makes it more immediately clear that the operation only involves varia

Re: Python

2025-12-21 Thread Chris Angelico via Python-list
On Sun, 21 Dec 2025 at 23:31, Peter J. Holzer wrote: > 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

Re: Python (was Re: Recent history of vi)

2025-12-21 Thread Peter J. Holzer
On 2025-12-21 04:22:02 +, rbowman wrote: > On Sat, 20 Dec 2025 05:25:25 -0500, c186282 wrote: > > >Well, I kind of liked PICK system ... everything was equal, always > >represented as a string. Numbers, chars, whatever - instantly/easily > >converted between each other. > >NO '

Re: Python (was Re: Recent history of vi)

2025-12-21 Thread Peter J. Holzer
On 2025-12-21 04:25:26 +, rbowman wrote: > On Sat, 20 Dec 2025 10:12:49 +, Richard Kettlewell wrote: > > I would say that although Python does have some aspects of strong > > typing, it is mostly weakly typed. > > Type hints sort of address that. Type hints add static typing (and only for

Re: Python (was Re: Recent history of vi)

2025-12-21 Thread Peter J. Holzer
On 2025-12-20 10:12:49 +, Richard Kettlewell wrote: > Another property suggested in [1] for ‘strong typing’ is that functions > can only be called with with arguments matching a declared type. I would call that "static typing". I think it is useful to separate these, especially for Python.

Re: Python

2025-12-21 Thread Peter J. Holzer
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#, Java

Re: Python

2025-12-21 Thread Peter J. Holzer
On 2025-12-18 18:00:45 +, Richard Kettlewell wrote: > Peter Flass writes: > > I comment *A LOT*. When I had to go back and revisit some very old > > code, I wished I had commented more. I've almost never looked at a > > program and said "I wish it had fewer comments." > > Regrettably, I’ve en