Re: Any marginally usable programming language approaches an ill defined barely usable re-implementation of half of Common-Lisp

2024-05-29 Thread Dan Sommers via Python-list
On 2024-05-29 at 11:39:14 -0700, HenHanna via Python-list wrote: > On 5/27/2024 1:59 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: > > https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule [...] > Are the Rules 1--9 by Greenspun good too? I don't know; let me look it up. Oh, there it

Re: Serializing pydantic enums

2024-05-29 Thread Mats Wichmann via Python-list
On 5/29/24 13:27, Larry Martell via Python-list wrote: On Tue, May 28, 2024 at 11:46 AM Left Right via Python-list wrote: Most Python objects aren't serializable into JSON. Pydantic isn't special in this sense. What can you do about this? -- Well, if this is a one-of situation, then, maybe

Re: Serializing pydantic enums

2024-05-29 Thread Larry Martell via Python-list
On Wed, May 29, 2024 at 12:27 PM Larry Martell wrote: > > On Tue, May 28, 2024 at 11:46 AM Left Right via Python-list > wrote: > > > > Most Python objects aren't serializable into JSON. Pydantic isn't > > special in this sense. > > > > What can you do about this? -- Well, if this is a one-of

Re: SOLVED! Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-29 Thread dn via Python-list
On 29/05/24 06:49, Gilmeh Serda via Python-list wrote: Solved by using a different method. Hedonist for hire... no job too easy! This combination of sig-file and content seems sadly ironic. How about CONTRIBUTING to the community by explaining 'the solution' to people who may find a

Re: Any marginally usable programming language approaches an ill defined barely usable re-implementation of half of Common-Lisp

2024-05-29 Thread Kaz Kylheku via Python-list
On 2024-05-29, HenHanna wrote: > On 5/27/2024 1:59 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: >> https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule > > > interesting!!! > > Are the Rules 1--9 by Greenspun good too? I don't think they exist; it's a joke. However, Greenspun's resume

Re: Any marginally usable programming language approaches an ill defined barely usable re-implementation of half of Common-Lisp

2024-05-29 Thread HenHanna via Python-list
On 5/27/2024 1:59 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2024-05-27 at 12:37:01 -0700, HenHanna via Python-list wrote: On 5/27/2024 7:18 AM, Cor wrote: Some entity, AKA "B. Pym" , wrote this mindboggling stuff: (selectively-snipped-or-not-p) On 12/16/2023, c...@clsnet.nl

Re: Serializing pydantic enums

2024-05-29 Thread Larry Martell via Python-list
On Tue, May 28, 2024 at 11:46 AM Left Right via Python-list wrote: > > Most Python objects aren't serializable into JSON. Pydantic isn't > special in this sense. > > What can you do about this? -- Well, if this is a one-of situation, > then, maybe just do it by hand? > > If this is a recurring

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
On 5/29/2024 10:59 AM, MRAB via Python-list wrote: On 2024-05-29 15:32, Thomas Passin via Python-list wrote: On 5/29/2024 8:55 AM, Kevin M. Wilson wrote: Please recall, I said the format for the email failed to retain the proper indents. I'll attach a picture of the code! Purpose; to

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Grant Edwards via Python-list
On 2024-05-29, Mats Wichmann via Python-list wrote: > On 5/29/24 08:02, Grant Edwards via Python-list wrote: >> On 2024-05-29, Chris Angelico via Python-list wrote: >> >>> print(f"if block {name[index]=} {index=}") >> >> Holy cow! How did I not know about the f-string {=} thing? > > It's more

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread MRAB via Python-list
On 2024-05-29 15:32, Thomas Passin via Python-list wrote: On 5/29/2024 8:55 AM, Kevin M. Wilson wrote: Please recall, I said the format for the email failed to retain the proper indents. I'll attach a picture of the code! Purpose; to uppercase every other letter in a string. Thanks all, KMW

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Barry Scott via Python-list
> On 29 May 2024, at 05:38, Kevin M. Wilson via Python-list > wrote: > > The format in this email is not of my making, should someone know, how to do > this so that it's a readable script do tell! > KMW Your mail program may have a plain-text mode to compose messages in try using that.

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
On 5/29/2024 8:55 AM, Kevin M. Wilson wrote: Please recall, I said the format for the email failed to retain the proper indents. I'll attach a picture of the code! Purpose; to uppercase every other letter in a string. Thanks all, KMW Simpler is good, and readability is good. For a simple

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Mats Wichmann via Python-list
On 5/29/24 08:02, Grant Edwards via Python-list wrote: On 2024-05-29, Chris Angelico via Python-list wrote: print(f"if block {name[index]=} {index=}") Holy cow! How did I not know about the f-string {=} thing? It's more recent than f-strings in general, so it's not that hard to miss. --

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Grant Edwards via Python-list
On 2024-05-29, Chris Angelico via Python-list wrote: > print(f"if block {name[index]=} {index=}") Holy cow! How did I not know about the f-string {=} thing? -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: Formatted Output and Argument Parsing (was: Re: Flubbed it in the second interation through the string: range error... HOW?)

2024-05-29 Thread Chris Angelico via Python-list
On Wed, 29 May 2024 at 23:06, Dan Sommers via Python-list wrote: > (For the history-impaired, getopt existed long before Python and will > likely exist long after it, but getopt's "replacement" optparse lasted > only from 2003 until 2011.) Depends on your definition of "lasted". It's not getting

Formatted Output and Argument Parsing (was: Re: Flubbed it in the second interation through the string: range error... HOW?)

2024-05-29 Thread Dan Sommers via Python-list
On 2024-05-29 at 17:14:51 +1000, Chris Angelico via Python-list wrote: > I wouldn't replace str.format() everywhere, nor would I replace > percent encoding everywhere - but in this case, I think Thomas is > correct. Not because it's 2024 (f-strings were brought in back in > 2015, so they're

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Thomas Passin via Python-list
On 5/29/2024 3:14 AM, Chris Angelico via Python-list wrote: On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list wrote: By which Thomas means stuff like this: print(f'if block {name[index]} and index {index}') Notice the leading "f'". Personally I wouldn't even go that far,

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread MRAB via Python-list
On 2024-05-29 05:33, Kevin M. Wilson via Python-list wrote: The following is my effort to understand how to process a string, letter, by letter: def myfunc(name):        index = 0    howmax = len(name)    # while (index <= howmax):    while (index < howmax):        if (index % 2 == 0):         

Re: SOLVED! Re: Weird Stuff (Markdown, syntax highlighting and Python)

2024-05-29 Thread o1bigtenor via Python-list
On Tue, May 28, 2024 at 9:48 PM Gilmeh Serda via Python-list < python-list@python.org> wrote: > > Solved by using a different method. > > - - - And that was how? TIA -- https://mail.python.org/mailman/listinfo/python-list

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Chris Angelico via Python-list
On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list wrote: > By which Thomas means stuff like this: > > print(f'if block {name[index]} and index {index}') > > Notice the leading "f'". Personally I wouldn't even go that far, just: > > print('if block', name[index], 'and index',

Re: Flubbed it in the second interation through the string: range error... HOW?

2024-05-29 Thread Cameron Simpson via Python-list
On 29May2024 01:14, Thomas Passin wrote: Also, it's 2024 ... time to start using f-strings (because they are more readable than str.format()) By which Thomas means stuff like this: print(f'if block {name[index]} and index {index}') Notice the leading "f'". Personally I wouldn't even go