Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-24 18:19:52 -0500, Thomas Passin wrote: > On 2/24/2023 2:47 PM, dn via Python-list wrote: > > On 25/02/2023 08.12, Peter J. Holzer wrote: > > > On 2023-02-24 16:12:10 +1300, dn via Python-list wrote: > > > > In some ways, providing this information seems appropriate. > > > > Curiously,

Re: TypeError: can only concatenate str (not "int") to str

2023-02-24 Thread dn via Python-list
On 25/02/2023 09.36, Hen Hanna wrote: TypeError: can only concatenate str (not "int") to str thanks for the comments, --- esp. 2 or 3 (?) ppl who directly addressed it or commented on it. If you haven't already, please review the Python Software Foundation's Code

Re: Evaluate once or every time

2023-02-24 Thread Thomas Passin
On 2/24/2023 7:00 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: On 2023-02-24 at 18:42:39 -0500, Thomas Passin wrote: VOWELS = 'aeiouAEIOU' is_vowel = 'y' in VOWELS If I really needed them to be in a list, I'd probably do a list comprehension: VOWEL_LIST = [ch for ch in VOWELS] Why use a

Re: Evaluate once or every time

2023-02-24 Thread 2QdxY4RzWzUUiLuE
On 2023-02-24 at 18:42:39 -0500, Thomas Passin wrote: > VOWELS = 'aeiouAEIOU' > is_vowel = 'y' in VOWELS > > If I really needed them to be in a list, I'd probably do a list > comprehension: > > VOWEL_LIST = [ch for ch in VOWELS] Why use a comprehension when a simple loop will do? ;-) No.

Re: Find 6-letter words that are hidden (embedded) within

2023-02-24 Thread Hen Hanna
On Friday, February 24, 2023 at 1:18:28 PM UTC-8, David Raymond wrote: > > Find 6-letter words that are hidden (embedded) within each row of letters. > > The letters are in the correct order. > > > > 1. JSOYOMFUBELR > > 2. SCDUARWDRLYE > > 3. DASNAGEFERTY > > 4. CLULOOTSCEHN > > 5.

Re: Not receiving posts

2023-02-24 Thread Grant Edwards
On 2023-02-24, Mats Wichmann wrote: > On 2/23/23 13:56, Grant Edwards wrote: >> On 2023-02-23, Jim Byrnes wrote: >> >>> I have been reading the python-list for some time now. At first via >>> gemane and since it's demise via a subscription. >> >> FWIW, gmane is still there, and still working

Re: Evaluate once or every time

2023-02-24 Thread Thomas Passin
On 2/24/2023 5:35 PM, avi.e.gr...@gmail.com wrote: Mark, I was very interested in the point you made and have never thought much about string concatenation this way but adjacency is an operator worth using. This message has a new subject line as it is not about line continuation or comments.

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Thomas Passin
On 2/24/2023 2:47 PM, dn via Python-list wrote: On 25/02/2023 08.12, Peter J. Holzer wrote: On 2023-02-24 16:12:10 +1300, dn via Python-list wrote: In some ways, providing this information seems appropriate. Curiously, this does not even occur during an assert exception - despite the

Re: Line continuation and comments

2023-02-24 Thread dn via Python-list
On 25/02/2023 10.04, Mark Bourne wrote: Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line.  I find it makes it more difficult to see where the

Re: Not receiving posts

2023-02-24 Thread Mats Wichmann
On 2/23/23 13:56, Grant Edwards wrote: On 2023-02-23, Jim Byrnes wrote: I have been reading the python-list for some time now. At first via gemane and since it's demise via a subscription. FWIW, gmane is still there, and still working fine. I read this list by pointing slrn at news.gmane.io

Re: Evaluate once or every time

2023-02-24 Thread Chris Angelico
On Sat, 25 Feb 2023 at 09:36, wrote: > From what you say, concatenation between visibly adjacent strings is done > once when generating bytecode. Using a plus is supposed to be about the same > but may indeed result in either an error if you use anything other than a > string literal > > bad =

Evaluate once or every time

2023-02-24 Thread avi.e.gross
Mark, I was very interested in the point you made and have never thought much about string concatenation this way but adjacency is an operator worth using. This message has a new subject line as it is not about line continuation or comments. From what you say, concatenation between visibly

Re: Line continuation and comments

2023-02-24 Thread Roel Schroeven
Mark Bourne schreef op 24/02/2023 om 22:04: Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line. I find it makes it more difficult to see where the

Re: Line continuation and comments

2023-02-24 Thread Mark Bourne
Personally, I don't particularly like the way you have to put multiline strings on the far left (rather than aligned with the rest of the scope) to avoid getting spaces at the beginning of each line. I find it makes it more difficult to see where the scope of the class/method/etc. actually

TypeError: can only concatenate str (not "int") to str

2023-02-24 Thread Hen Hanna
TypeError: can only concatenate str (not "int") to str thanks for the comments, --- esp. 2 or 3 (?) ppl who directly addressed it or commented on it. py and pypy don't tell me what the (offending) int is (even tho' it'd be easy to

RE: Find 6-letter words that are hidden (embedded) within

2023-02-24 Thread David Raymond
> Find 6-letter words that are hidden (embedded) within each row of letters. > The letters are in the correct order. > > 1. JSOYOMFUBELR > 2. SCDUARWDRLYE > 3. DASNAGEFERTY > 4. CLULOOTSCEHN > 5. USENEARSEYNE > The letters are in the correct order.

Re: Find 6-letter words that are hidden (embedded) within

2023-02-24 Thread Hen Hanna
On Friday, February 24, 2023 at 10:34:31 AM UTC-8, Hen Hanna wrote: > i just wrote a program, which... >within [FunFunPython] >finds: (funny, futon, python) > >( 5- and 6- letter words ) > > > (my program uses a Trie, but is

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-25 08:47:00 +1300, dn via Python-list wrote: > That said, have observed coders 'graduating' from other languages, making > wider use of assert - assumed to be more data (value) sanity-checks than > typing, but ... > > Do you use assert frequently? Not very often, but I do use it.

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread dn via Python-list
On 25/02/2023 08.12, Peter J. Holzer wrote: On 2023-02-24 16:12:10 +1300, dn via Python-list wrote: In some ways, providing this information seems appropriate. Curiously, this does not even occur during an assert exception - despite the value/relationship being the whole point of using the

Re: Find 6-letter words that are hidden (embedded) within

2023-02-24 Thread Pancho via Python-list
On 24/02/2023 18:34, Hen Hanna wrote: i just wrote a program, which... within[FunFunPython] finds: (funny,futon,python) ( 5- and 6- letter words ) (my program uses a Trie, but is pretty simple)

Find 6-letter words that are hidden (embedded) within

2023-02-24 Thread Hen Hanna
i just wrote a program, which... within[FunFunPython] finds: (funny,futon,python) ( 5- and 6- letter words ) (my program uses a Trie, but is pretty simple) Maybe someone would show me how

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-24 16:12:10 +1300, dn via Python-list wrote: > In some ways, providing this information seems appropriate. Curiously, this > does not even occur during an assert exception - despite the > value/relationship being the whole point of using the command! > > x = 1 > assert x == 2 >

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-23 20:32:26 -0700, Michael Torrie wrote: > On 2/23/23 01:08, Hen Hanna wrote: > > Python VM is seeing an "int" object (123) (and telling me that) > > ... so it should be easy to print that "int" object What does > > Python VMknow ? and when does it know it ? > It knows

Re: Why doesn't Python (error msg) tell me WHAT the actual (arg) values are ?

2023-02-24 Thread Peter J. Holzer
On 2023-02-22 15:46:09 -0800, Hen Hanna wrote: > On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote: > > > py bug.py > > Traceback (most recent call last): > > File "C:\Usenet\bug.py", line 5, in > > print( a + 12 ) > > TypeError: can only concatenate str (not "int") to str

terse

2023-02-24 Thread avi.e.gross
Greg, I do not advocate for writing extremely concise python as mentioned in that book although I was quite interested and do use some of the methods. But I worry about what you focused in on. Everyone says a picture is worth a thousand words. So when writing about python one-liners, you might

Re: putting JUNK at the end of a [.py] file

2023-02-24 Thread Thomas Passin
On 2/24/2023 12:37 AM, Hen Hanna wrote: On Thursday, February 23, 2023 at 9:17:05 PM UTC-8, Thomas Passin wrote: On 2/23/2023 7:21 PM, Hen Hanna wrote: in a LaTeX file, after the (1st) \end{document} line, i can put any random Junk i want (afterwards) until the end of the file. Is there a

Re: putting JUNK at the end of a [.py] file

2023-02-24 Thread Loris Bennett
Hen Hanna writes: > in a LaTeX file, after the (1st) \end{document} line, > i can put any random Junk i want(afterwards) until the end of the > file. > > > Is there a similar Method for a.py file ? > > Since i know of no such trick, i sometimes put this

Re: putting JUNK at the end of a [.py] file

2023-02-24 Thread Hen Hanna
On Thursday, February 23, 2023 at 9:17:05 PM UTC-8, Thomas Passin wrote: > On 2/23/2023 7:21 PM, Hen Hanna wrote: > > > > in a LaTeX file, after the (1st) \end{document} line, > > i can put any random Junk i want (afterwards) until the end of the file. > > > > > > Is there a similar Method

Re: putting JUNK at the end of a [.py] file

2023-02-24 Thread Mats Wichmann
On 2/24/23 08:27, Mats Wichmann wrote: Indeed, I work on a project that by convention puts editor instructions at the end of each file (which some might consider junk :-) ), like this: # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4

Re: putting JUNK at the end of a [.py] file

2023-02-24 Thread Mats Wichmann
On 2/23/23 22:16, Thomas Passin wrote: On 2/23/2023 7:21 PM, Hen Hanna wrote: in a LaTeX file,   after the (1st)   \end{document} line,    i can put any random Junk i want    (afterwards)   until the end of the file. Is there a similar Method  for a    .py file ? Since

Re: semi colonic

2023-02-24 Thread Peter J. Holzer
On 2023-02-23 15:56:54 -0500, avi.e.gr...@gmail.com wrote: > I am not sure it is fair to blame JSON for a design choice. We can't blame JSON (it has no agency), but as you say, it it was a choice. And we can absolutely blame Doug for making that choice! hp -- _ | Peter J. Holzer

[Python-announce] ANN: A new version (0.14.0) of sparse has been released.

2023-02-24 Thread Hameer Abbasi
I’d like to announce the release of PyData/Sparse 0.14.0. PyData/Sparse is available on conda-forge and PyPI. PyData/Sparse is a package that provides sparse arrays conforming to the NumPy API, along with a subset of NumPy operations on sparse arrays. The highlights of this release include

Re: lxml with python-3.12.0a5

2023-02-24 Thread Robin Becker
On 23/02/2023 18:09, Mats Wichmann wrote: I seem to always have trouble with lxml (which I know doesn't help). The cause would seem to be this: GH-101291: Refactor the `PyLongObject` struct into object header and PyLongValue struct. (GH-101292) So it looks to me like cython