Re: Python - working with xml/lxml/objectify/schemas, datatypes, and assignments

2023-01-10 Thread aapost
On 1/4/23 12:13, aapost wrote: On 1/4/23 09:42, Dieter Maurer wrote: aapost wrote at 2023-1-3 22:57 -0500: ... Consider the following: from lxml import objectify, etree schema = etree.XMLSchema(file="path_to_my_xsd_schema_file") parser = objectify.makeparser(schema=schema, encoding="UTF-8")

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Greg Ewing
On 11/01/23 11:21 am, Jen Kris wrote: where one object derives from another object (a = b[0], for example), any operation that would alter one will alter the other. I think you're still confused. In C terms, after a = b[0], a and b[0] are pointers to the same block of memory. If you change

Re: Tkinter GUI freezing, used Thread then encountered RuntimeError: threads can only be started once

2023-01-10 Thread MRAB
On 2023-01-11 00:13, Cameron Simpson wrote: On 10Jan2023 18:32, MRAB wrote: I don't like how you're passing Thread...start as an argument. IMHO, it would be better/cleaner to pass a plain function, even if the only thing that function does is to start the thread. Yes, and this is likely the

Re: Tkinter GUI freezing, used Thread then encountered RuntimeError: threads can only be started once

2023-01-10 Thread Cameron Simpson
On 10Jan2023 18:32, MRAB wrote: I don't like how you're passing Thread...start as an argument. IMHO, it would be better/cleaner to pass a plain function, even if the only thing that function does is to start the thread. Yes, and this is likely the thing causing the cited exception "threads

Re: To clarify how Python handles two equal objects

2023-01-10 Thread MRAB
On 2023-01-10 22:21, Jen Kris via Python-list wrote: There are cases where NumPy would be the best choice, but that wasn’t the case here with what the loop was doing. To sum up what I learned from this post, where one object derives from another object (a = b[0], for example), any operation

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Thomas Passin
On 1/10/2023 5:21 PM, Jen Kris wrote: There are cases where NumPy would be the best choice, but that wasn’t the case here with what the loop was doing. To sum up what I learned from this post, where one object derives from another object (a = b[0], for example), any operation that would alter

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Ethan Furman
On 1/10/23 12:03, Jen Kris via Python-list wrote: > I am writing a spot speedup in assembly language for a short but computation-intensive Python > loop, and I discovered something about Python array handling that I would like to clarify. > But on the next iteration we assign arr1 to

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Thomas Passin
On 1/10/2023 5:11 PM, Chris Angelico wrote: On Wed, 11 Jan 2023 at 09:08, Thomas Passin wrote: Just to add a possibly picky detail to what others have said, Python does not have an "array" type. It has a "list" type, as well as some other, not necessarily mutable, sequence types. Just to

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Jen Kris via Python-list
There are cases where NumPy would be the best choice, but that wasn’t the case here with what the loop was doing.  To sum up what I learned from this post, where one object derives from another object (a = b[0], for example), any operation that would alter one will alter the other.  When

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Chris Angelico
On Wed, 11 Jan 2023 at 09:08, Thomas Passin wrote: > > Just to add a possibly picky detail to what others have said, Python > does not have an "array" type. It has a "list" type, as well as some > other, not necessarily mutable, sequence types. Just to be even pickier, Python DOES have an array

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Thomas Passin
Just to add a possibly picky detail to what others have said, Python does not have an "array" type. It has a "list" type, as well as some other, not necessarily mutable, sequence types. If you want to speed up list and matrix operations, you might use NumPy. Its arrays and matrices are

Re: Mailing-Lists (pointer)

2023-01-10 Thread Cameron Simpson
On 10Jan2023 08:45, Chris Green wrote: dn wrote: See also the wisdom of enabling comp.lang.python and python-list as 'mirrors', enabling those who prefer one mechanism/client to another, yet maintaining a single 'community'. Yes, this is important I think. Plus, if possible, if it's

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Roel Schroeven
Jen Kris via Python-list schreef op 10/01/2023 om 21:41: But where they have been set to the same object, an operation on one will affect the other as long as they are equal (in Python). As long as they are *identical*, not equal. Identical as in having the same identity as Python defines it.

Re: To clarify how Python handles two equal objects

2023-01-10 Thread MRAB
On 2023-01-10 20:41, Jen Kris via Python-list wrote: Thanks for your comments.  I'd like to make one small point.  You say: "Assignment in Python is a matter of object references. It's not "conform them as long as they remain equal". You'll have to think in terms of object references the

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Weatherby,Gerard
For clarification, equality is not identity in Python. e.g. x = 7 y = 7.0 print(x == y) print(x is y) Will return True False Full explanation at https://docs.python.org/3/reference/expressions.html#comparisons From: Python-list on behalf of Chris Angelico Date: Tuesday, January 10, 2023

Re: Mailing-Lists (pointer)

2023-01-10 Thread Dieter Maurer
Chris Green wrote at 2023-1-10 08:45 +: > ... >Yes, this is important I think. Plus, if possible, if it's decided to >move to a forum format make that accessible by E-Mail. I much prefer a mailing list over an http based service. With mailing lists, all interesting messages arrive in my

Python 3.12.0 alpha 4 released

2023-01-10 Thread Thomas Wouters
I'm pleased to announce the release of Python 3.12 alpha 4. https://www.python.org/downloads/release/python-3120a4/ *This is an early developer preview of Python 3.12*. Major new features of the 3.12 series, compared to 3.11 Python 3.12 is still in development. This release, 3.12.0a4 is the

[Python-announce] Python 3.12.0 alpha 4 released

2023-01-10 Thread Thomas Wouters
I'm pleased to announce the release of Python 3.12 alpha 4. https://www.python.org/downloads/release/python-3120a4/ *This is an early developer preview of Python 3.12*. Major new features of the 3.12 series, compared to 3.11 Python 3.12 is still in development. This release, 3.12.0a4 is the

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Chris Angelico
On Wed, 11 Jan 2023 at 07:41, Jen Kris wrote: > > > Thanks for your comments. I'd like to make one small point. You say: > > "Assignment in Python is a matter of object references. It's not > "conform them as long as they remain equal". You'll have to think in > terms of object references the

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Jen Kris via Python-list
Thanks for your comments.  I'd like to make one small point.  You say: "Assignment in Python is a matter of object references. It's not "conform them as long as they remain equal". You'll have to think in terms of object references the entire way." But where they have been set to the same

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Chris Angelico
On Wed, 11 Jan 2023 at 07:14, Jen Kris via Python-list wrote: > > I am writing a spot speedup in assembly language for a short but > computation-intensive Python loop, and I discovered something about Python > array handling that I would like to clarify. > > For a simplified example, I created

To clarify how Python handles two equal objects

2023-01-10 Thread Jen Kris via Python-list
I am writing a spot speedup in assembly language for a short but computation-intensive Python loop, and I discovered something about Python array handling that I would like to clarify.  For a simplified example, I created a matrix mx1 and assigned the array arr1 to the third row of the

Re: Tkinter GUI freezing, used Thread then encountered RuntimeError: threads can only be started once

2023-01-10 Thread MRAB
On 2023-01-10 14:57, Abhay Singh wrote: Here is the entire code snippet of the same. Please help def change_flag(top_frame, bottom_frame, button1, button2, button3, button4, controller): global counter, canvas, my_image, chosen, flag, directory canvas.delete('all') button5['state'] =

Tkinter GUI freezing, used Thread then encountered RuntimeError: threads can only be started once

2023-01-10 Thread Abhay Singh
Here is the entire code snippet of the same. Please help def change_flag(top_frame, bottom_frame, button1, button2, button3, button4, controller): global counter, canvas, my_image, chosen, flag, directory canvas.delete('all') button5['state'] = DISABLED counter += 1 chosen, options_text =

Re: Mailing-Lists (pointer)

2023-01-10 Thread Chris Green
dn wrote: [snip] > See also the wisdom of enabling comp.lang.python and python-list as > 'mirrors', enabling those who prefer one mechanism/client to another, > yet maintaining a single 'community'. > Yes, this is important I think. Plus, if possible, if it's decided to move to a forum

Re: Mailing-Lists (pointer)

2023-01-10 Thread Milan Glacier
On 01/10/23 11:33, dn wrote: On 10/01/2023 08.46, Stefan Ram wrote: If anyone is interested: In "comp.misc", there's a discussion about the use of mailing lists in software development. Subject: An objective criteria for deprecating community platforms (I did not create this subject!)