Re: Book recommendation? For getting up to date (Posting On Python-List Prohibited)

2025-03-02 Thread Salvador Mirzo via Python-list
rbowman writes: > On Thu, 20 Feb 2025 21:51:51 - (UTC), Lawrence D'Oliveiro wrote: > >> On Thu, 20 Feb 2025 10:05:32 -0300, Salvador Mirzo wrote: >> >>> It's much more pleasurable (to me) to read books off-screen. >> >> You can’t do searches, though. > > For non-fiction a decent index does

Re: Book recommendation? For getting up to date (Posting On Python-List Prohibited)

2025-03-02 Thread Salvador Mirzo via Python-list
Lawrence D'Oliveiro writes: > On Thu, 20 Feb 2025 10:05:32 -0300, Salvador Mirzo wrote: > >> It's much more pleasurable (to me) to read books off-screen. > > You can’t do searches, though. That's quite right, which is why I also love to have an ebook form of them. -- https://mail.python.org/mai

Re: Book recommendation? For getting up to date (Posting On Python-List Prohibited)

2025-02-21 Thread rbowman via Python-list
On Thu, 20 Feb 2025 21:51:51 - (UTC), Lawrence D'Oliveiro wrote: > On Thu, 20 Feb 2025 10:05:32 -0300, Salvador Mirzo wrote: > >> It's much more pleasurable (to me) to read books off-screen. > > You can’t do searches, though. For non-fiction a decent index does wonders. A good layout and ta

Re: Book recommendation? For getting up to date (Posting On Python-List Prohibited)

2025-02-20 Thread Salvador Mirzo via Python-list
Lawrence D'Oliveiro writes: > On Wed, 19 Feb 2025 22:42:23 -0500, songbird wrote: > >> no need for me to print any programming books. > > I gave up on paper-based programming documentation a long time ago. There > is way too much of it that I need, and it changes too fast. So I keep it > all on

Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)

2024-11-08 Thread Thomas Passin via Python-list
On 11/8/2024 2:09 PM, dn via Python-list wrote: On 8/11/24 14:40, Mild Shock via Python-list wrote: Well you can use your Browser, since JavaScript understand post and pre increment: Question: are we talking Python or JavaScript? So we have x ++ equals in Python: Trying to find a word-for

Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)

2024-11-08 Thread dn via Python-list
On 8/11/24 14:40, Mild Shock via Python-list wrote: Well you can use your Browser, since JavaScript understand post and pre increment: Question: are we talking Python or JavaScript? So we have x ++ equals in Python: Trying to find a word-for-word translation serves as badly in computer-pr

Re: Two aces up Python's sleeve (Posting On Python-List Prohibited)

2024-11-08 Thread Mild Shock via Python-list
Well you can use your Browser, since JavaScript understand post and pre increment: > x = 5 5 > x ++ 5 > x = 5 5 > ++ x 6 So we have x ++ equals in Python: x + = 1 x - 1 And ++ x equals in Python: x += 1 x But I don't know how to combine an assignment and an expression into on

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-11 Thread Jon Ribbens via Python-list
On 2024-09-11, Lawrence D'Oliveiro wrote: > On Tue, 10 Sep 2024 22:48:36 - (UTC), Jon Ribbens wrote: >> But what if you tell it the wrong thing ... > > To get back to the original point of this thread, all that rigmarole to > try to ensure to call “rollback” in case of an exception is complet

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-10 Thread Jon Ribbens via Python-list
On 2024-09-10, Lawrence D'Oliveiro wrote: > On Tue, 10 Sep 2024 08:38:30 - (UTC), Jon Ribbens wrote: > >> On 2024-09-09, Lawrence D'Oliveiro wrote: >>> >>> On Mon, 9 Sep 2024 21:12:51 - (UTC), Jon Ribbens wrote: On 2024-09-09, Lawrence D'Oliveiro wrote: > > On Mon, 9 Se

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-10 Thread Jon Ribbens via Python-list
On 2024-09-10, Karsten Hilbert wrote: > Am Tue, Sep 10, 2024 at 08:38:30AM - schrieb Jon Ribbens via Python-list: >> Ok. So we've moved away from "In any DBMS worth its salt, rollback is >> something that happens automatically" > > Nope. The original post asked something entirely different. N

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-10 Thread Karsten Hilbert via Python-list
Am Tue, Sep 10, 2024 at 08:38:30AM - schrieb Jon Ribbens via Python-list: > Ok. So we've moved away from "In any DBMS worth its salt, rollback is > something that happens automatically" Nope. The original post asked something entirely different. > and now you're saying it isn't automatic aft

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-10 Thread Jon Ribbens via Python-list
On 2024-09-09, Lawrence D'Oliveiro wrote: > On Mon, 9 Sep 2024 21:12:51 - (UTC), Jon Ribbens wrote: >> On 2024-09-09, Lawrence D'Oliveiro wrote: >>> On Mon, 9 Sep 2024 10:00:11 - (UTC), Jon Ribbens wrote: On 2024-09-09, Lawrence D'Oliveiro wrote: > The database only needs to com

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-09 Thread Jon Ribbens via Python-list
On 2024-09-09, Lawrence D'Oliveiro wrote: > On Mon, 9 Sep 2024 10:00:11 - (UTC), Jon Ribbens wrote: >> On 2024-09-09, Lawrence D'Oliveiro wrote: >>> The database only needs to commit when it is explicitly told. Anything >>> less -- no commit. >> >> So the Python code is half-way through a tr

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-09 Thread Jon Ribbens via Python-list
On 2024-09-09, Karsten Hilbert wrote: > Am Mon, Sep 09, 2024 at 10:00:11AM - schrieb Jon Ribbens via Python-list: >> So the Python code is half-way through a transaction when it throws >> a (non-database-related) exception and that thread of execution is >> aborted. The database connection ret

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-09 Thread Karsten Hilbert via Python-list
Am Mon, Sep 09, 2024 at 10:00:11AM - schrieb Jon Ribbens via Python-list: > So the Python code is half-way through a transaction when it throws > a (non-database-related) exception and that thread of execution is > aborted. The database connection returns to the pool, How does it return to th

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-09 Thread Karsten Hilbert via Python-list
Am Mon, Sep 09, 2024 at 10:00:11AM - schrieb Jon Ribbens via Python-list: > > The database only needs to commit when it is explicitly told. Anything > > less -- no commit. > > So the Python code is half-way through a transaction when it throws > a (non-database-related) exception and that thre

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-09 Thread Jon Ribbens via Python-list
On 2024-09-08, Lawrence D'Oliveiro wrote: > On Sun, 8 Sep 2024 11:03:21 - (UTC), Jon Ribbens wrote: >> What if there's an exception in your exception handler? I'd put the >> rollback in the 'finally' handler, so it's always called. If you've >> already called 'commit' then the rollback does no

Re: psycopg2 positioning of .commit() (Posting On Python-List Prohibited)

2024-09-09 Thread Jon Ribbens via Python-list
On 2024-09-09, Lawrence D'Oliveiro wrote: > On Mon, 9 Sep 2024 09:13:40 - (UTC), Jon Ribbens wrote: >> On 2024-09-08, Lawrence D'Oliveiro wrote: >>> On Sun, 8 Sep 2024 11:03:21 - (UTC), Jon Ribbens wrote: What if there's an exception in your exception handler? I'd put the rollba

Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)

2024-08-27 Thread Piergiorgio Sartor via Python-list
On 25/08/2024 23.53, Lawrence D'Oliveiro wrote: Looking at this article about the top three languages for getting programming jobs , naturally I couldn’t help noticing the code in the screenshot at th

Re: Triggered By Mediocre Code (Posting On Python-List Prohibited)

2024-08-26 Thread rbowman via Python-list
On Sun, 25 Aug 2024 23:49:48 - (UTC), Lawrence D'Oliveiro wrote: > The irony of my putdown is that PHP can do it about as simply. But don’t > expect your typical PHP programmers to know that ... It has had amazing longevity for something that was born as Personal Home Page. -- https://mail

Re: python C-api and thread (Posting On Python-List Prohibited)

2024-08-06 Thread aotto1968 via Python-list
On 06.08.24 02:32, Lawrence D'Oliveiro wrote: On Mon, 5 Aug 2024 23:19:14 +0200, aotto1968 wrote: Is it possible to run two completely independent Python interpreters in one process, each using a thread? By independent, I mean that no data is shared between the interpreters and thus the C API

Re: Password Hash Validation (Posting On Python-List Prohibited)

2024-07-12 Thread Lawrence D'Oliveiro via Python-list
On Fri, 21 Jun 2024 06:32:58 - (UTC), I wrote: > On Fri, 21 Jun 2024 03:40:55 - (UTC), I wrote: > >> I think I will create my own wrapper using ctypes. > > Done . The repo now includes an example script that exercises the various functions of the module

Re: Best (simplest) way to share data (Posting On Python-List Prohibited)

2024-07-08 Thread Chris Green via Python-list
Lawrence D'Oliveiro wrote: > On Sat, 6 Jul 2024 08:28:41 +0100, Chris Green wrote: > > > One fairly obvious way is to have single process/script which reads the > > A2D values continuously and writes them to a file. All other scripts > > then read from the file as needed, a simple file lock can

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-20 Thread Gordinator via Python-list
On 20/05/2024 10:58, Peter J. Holzer wrote: On 2024-05-20 00:26:03 +0200, Roel Schroeven via Python-list wrote: Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: Modern debian (ubuntu) and fedora block users installing using pip. Even if you're telling it to install in ~/.local? I

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-20 Thread Gordinator via Python-list
I'm on Manjaro Of course, I'm not here to tell you how to use your computer, and it's great that you're using Linux, but I'd suggest that you look into installing Arch Linux proper. Arch Linux isn't as difficult as people make it out to be (I'd argue that anyone who's had to deal with the C

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-20 Thread Peter J. Holzer via Python-list
On 2024-05-20 00:26:03 +0200, Roel Schroeven via Python-list wrote: > Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: > > > Modern debian (ubuntu) and fedora block users installing using pip. > > > > Even if you're telling it to install in ~/.local? I could see not allowing > > to ru

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 6:00 PM, Karsten Hilbert via Python-list wrote: Am Sun, May 19, 2024 at 10:45:09PM +0100 schrieb Barry via Python-list: On 18 May 2024, at 16:27, Peter J. Holzer via Python-list wrote: I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block us

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 6:34 PM, Grant Edwards via Python-list wrote: On 2024-05-19, Barry via Python-list wrote: On 18 May 2024, at 16:27, Peter J. Holzer via Python-list wrote: I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block users installing using pip.

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 6:08 PM, Skip Montanaro via Python-list wrote: Modern debian (ubuntu) and fedora block users installing using pip. Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I honestly haven't tried. Maybe I should... 🤔 I have an old laptop run

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Barry via Python-list wrote: > > >> On 18 May 2024, at 16:27, Peter J. Holzer via Python-list >> wrote: >> >> I don't think Linux users have to deal with venvs > > Modern debian (ubuntu) and fedora block users installing using pip. You can't even use pip to do "user" installs?

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Gilmeh Serda via Python-list wrote: > On Sun, 19 May 2024 08:32:46 +0100, Alan Gauld wrote: > >> I've honestly never experienced this "nightmare". >> I install stuff and it just works. > > Hear! Hear! Me too! And all that. > > I'm on Manjaro, which is a tad finicky about other peopl

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Roel Schroeven via Python-list
Skip Montanaro via Python-list schreef op 20/05/2024 om 0:08: Modern debian (ubuntu) and fedora block users installing using pip. > Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I assumed pip install --user would work, but no. I tried it (on Debi

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Skip Montanaro via Python-list
Modern debian (ubuntu) and fedora block users installing using pip. > Even if you're telling it to install in ~/.local? I could see not allowing to run it as root. I honestly haven't tried. Maybe I should... 🤔 I have an old laptop running XUbuntu 22.04 which I generally only use to compile the mo

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Karsten Hilbert via Python-list
Am Sun, May 19, 2024 at 10:45:09PM +0100 schrieb Barry via Python-list: > > On 18 May 2024, at 16:27, Peter J. Holzer via Python-list > > wrote: > > > > I don't think Linux users have to deal with venvs > > Modern debian (ubuntu) and fedora block users installing using pip. > You must use a venv

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Barry via Python-list
> On 18 May 2024, at 16:27, Peter J. Holzer via Python-list > wrote: > > I don't think Linux users have to deal with venvs Modern debian (ubuntu) and fedora block users installing using pip. You must use a venv to pip install packages from pypi now. This is implemented in python and pip and e

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Dan Sommers via Python-list
On 2024-05-19 at 18:13:23 +, Gilmeh Serda via Python-list wrote: > Was there a reason they chose the name Pip? Package Installer for Python https://pip.pypa.io/en/stable/index.html -- https://mail.python.org/mailman/listinfo/python-list

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread MRAB via Python-list
On 2024-05-19 19:13, Gilmeh Serda via Python-list wrote: On Sun, 19 May 2024 08:32:46 +0100, Alan Gauld wrote: I've honestly never experienced this "nightmare". I install stuff and it just works. Hear! Hear! Me too! And all that. I'm on Manjaro, which is a tad finicky about other people touc

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Dan Sommers via Python-list
On 2024-05-19 at 18:13:23 +, Gilmeh Serda via Python-list wrote: > Was there a reason they chose the name Pip? Package Installer for Python https://pip.pypa.io/en/stable/index.html Every time I see PIP, I think Peripheral Interchange Program, but I'm old. -- https://mail.python.org/mailma

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Thomas Passin via Python-list
On 5/19/2024 3:32 AM, Alan Gauld via Python-list wrote: On 18/05/2024 19:12, Piergiorgio Sartor via Python-list wrote: [snip] The dependency nightmare created by python, pip and all the rest cannot be resolved otherwise. I've honestly never experienced this "nightmare". I install stuff an

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Grant Edwards via Python-list
On 2024-05-19, Alan Gauld via Python-list wrote: >> The dependency nightmare created by python, pip >> and all the rest cannot be resolved otherwise. > > I've honestly never experienced this "nightmare". > I install stuff and it just works. Same here. I occasonlly use pip to install something t

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-19 Thread Alan Gauld via Python-list
On 18/05/2024 19:12, Piergiorgio Sartor via Python-list wrote: >> So venvs make managing all that pretty convenient. Dunno why everybody's >> so down on venvs... Not so much down on them, they are just one extra step that's mostly not needed(in my use case) > Only people which are *not* using p

venvs vs. package management (was: Terminal Emulator (Posting On Python-List Prohibited))

2024-05-18 Thread Peter J. Holzer via Python-list
On 2024-05-18 20:12:33 +0200, Piergiorgio Sartor via Python-list wrote: > On 18/05/2024 20.04, Mats Wichmann wrote: > > So venvs make managing all that pretty convenient. Dunno why everybody's > > so down on venvs... > > Only people which are *not* using python... :-) > > In my experience, venvs

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-18 Thread Piergiorgio Sartor via Python-list
On 18/05/2024 20.04, Mats Wichmann wrote: [...] So venvs make managing all that pretty convenient. Dunno why everybody's so down on venvs... Only people which are *not* using python... :-) In my experience, venvs is the only possible way to use python properly. The dependency nightmare create

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-18 Thread Grant Edwards via Python-list
On 2024-05-18, Mats Wichmann via Python-list wrote: > Distros have do offer a good selection of packaged Python bits, yes, but > only for the version of Python that's "native" to that distro release. > If you need to test other versions of Python, you're mostly on your own. For a few years I n

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-18 Thread Mats Wichmann via Python-list
On 5/18/24 10:48, Grant Edwards via Python-list wrote: On 2024-05-18, Peter J. Holzer via Python-list wrote: On 2024-05-16 19:46:07 +0100, Gordinator via Python-list wrote: To be fair, the problem is the fact that they use Windows (but I guess Linux users have to deal with venvs, so we're eve

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-18 Thread Grant Edwards via Python-list
On 2024-05-18, Peter J. Holzer via Python-list wrote: > On 2024-05-16 19:46:07 +0100, Gordinator via Python-list wrote: > >> To be fair, the problem is the fact that they use Windows (but I >> guess Linux users have to deal with venvs, so we're even. > > I don't think Linux users have to deal with

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-18 Thread Peter J. Holzer via Python-list
On 2024-05-16 19:46:07 +0100, Gordinator via Python-list wrote: > To be fair, the problem is the fact that they use Windows (but I guess Linux > users have to deal with venvs, so we're even. I don't think Linux users have to deal with venvs any more than Windows users. Maybe even less because many

Re: Terminal Emulator (Posting On Python-List Prohibited)

2024-05-16 Thread Gordinator via Python-list
On 16/05/2024 01:12, Lawrence D'Oliveiro wrote: On 15 May 2024 10:31:25 GMT, Stefan Ram wrote: We need somethin like a portable curses module (plus colorama) and it has got to work on both Windoze and Linux straight out of the box in standard Python. Something else for Windows Python users to

Re: Python Dialogs (Posting On Python-List Prohibited)

2024-05-03 Thread Alan Bawden via Python-list
Lawrence D'Oliveiro writes: > Assume you have an expression "s.replace('a','b').replace('c','d'). > replace('e','f').replace('g','h')". Its value is a string which > is the value of s, but with "a" replaced by "b", "c" replaced by > "d", "e" replaced by "f" and "g" replaced by "h". Ho

Re: GIL-Removal Project Takes Another Step (Posting On Python-List Prohibited)

2024-03-20 Thread Chris Angelico via Python-list
On Wed, 20 Mar 2024 at 18:31, Greg Ewing via Python-list wrote: > > On 20/03/24 4:14 pm, Lawrence D'Oliveiro wrote: > > not to > > mention the latency when there isn’t quite enough memory for an allocation > > and you have to wait until the next GC run to proceed. Run the GC a > > thousand times a

Re: GIL-Removal Project Takes Another Step (Posting On Python-List Prohibited)

2024-03-20 Thread Greg Ewing via Python-list
On 20/03/24 4:14 pm, Lawrence D'Oliveiro wrote: not to mention the latency when there isn’t quite enough memory for an allocation and you have to wait until the next GC run to proceed. Run the GC a thousand times a second, and the latency is still 1 millisecond. That's not the way it usually wo

Re: Await expressions (Posting On Python-List Prohibited)

2024-02-03 Thread Mild Shock via Python-list
Funny source code tells me IOCP is used; proactor is only implemented on Windows with IOCP. https://github.com/python/cpython/blob/3.12/Lib/asyncio/proactor_events.py But maybe the focus is more on networking than file system. But it has sock_sendfile() that might avoid copying data to usersp

Re: Await expressions (Posting On Python-List Prohibited)

2024-02-03 Thread Mild Shock via Python-list
The docu tells me: Windows loop.add_reader() and loop.add_writer() only accept socket handles (e.g. pipe file descriptors are not supported). https://docs.python.org/3/library/asyncio-platforms.html Alternatives are aiofiles and anyio and maybe more, but not sure whether they span all platforms,

Re: Await expressions (Posting On Python-List Prohibited)

2024-02-03 Thread Mild Shock via Python-list
And whats the roadmap for an asyncified module loader, is this on the radar of Python? Mild Shock schrieb: I am still waiting for async files in the style of nodejs that works on windows and is bundled with the main python distribution. I am not very  fond on doing something like adding list

Re: Await expressions (Posting On Python-List Prohibited)

2024-02-03 Thread Mild Shock via Python-list
I am still waiting for async files in the style of nodejs that works on windows and is bundled with the main python distribution. I am not very fond on doing something like adding listeners to a file descriptor, in nodejs async files are based on callbacks not on listeners. Whats the roadmap

Re: Await expressions (Posting On Python-List Prohibited)

2024-02-02 Thread Jon Ribbens via Python-list
On 2024-02-02, Lawrence D'Oliveiro wrote: > On 1 Feb 2024 10:09:10 GMT, Stefan Ram wrote: > >> Heck, even of the respected members of this newsgroup, IIRC, no one >> mentioned "__await__". > > It’s part of the definition of an “awaitable”, if you had looked that up. > >

Re: Await expressions (Posting On Python-List Prohibited)

2024-01-27 Thread Dieter Maurer via Python-list
>On 27/01/24 10:46 am, Stefan Ram wrote: >>But your explanation seems to have no mention of the "something" / >>"the awaitable object" part following the preposition "on". Shouldn't >>this awaitable object play a rôle in the explanation of what happens? You can explain a function call

Re: Await expressions (Posting On Python-List Prohibited)

2024-01-26 Thread Chris Angelico via Python-list
On Sat, 27 Jan 2024 at 11:01, Greg Ewing via Python-list wrote: > > If it helps at all, you can think of an async function as being > very similar to a generator, and "await" as being very similar to > "yield from". In the current implementation they're almost exactly > the same thing underneath.

Re: Await expressions (Posting On Python-List Prohibited)

2024-01-26 Thread Greg Ewing via Python-list
On 27/01/24 10:46 am, Stefan Ram wrote: But your explanation seems to have no mention of the "something" / "the awaitable object" part following the preposition "on". Shouldn't this awaitable object play a rôle in the explanation of what happens? If it helps at all, you can think of an

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-15 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Thursday, March 15, 2018 at 2:56:24 PM UTC+13, Ben Bacarisse wrote: >> >> Lawrence D’Oliveiro writes: >> >>> On Wednesday, March 14, 2018 at 2:18:24 PM UTC+13, Ben Bacarisse wrote: >>> Lawrence D’Oliveiro writes: The original problem -- triples of

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-14 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Wednesday, March 14, 2018 at 2:18:24 PM UTC+13, Ben Bacarisse wrote: >> Lawrence D’Oliveiro writes: >> >> The original problem -- triples of natural numbers -- is >> not particularly hard, but the general problem -- enumerating n-tuples >> of some sequence -- is

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-13 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Tuesday, March 13, 2018 at 1:58:48 PM UTC+13, Ben Bacarisse wrote: >> Of course you can always generate n-tuples of N and then map these to >> n-tuples of the intended sequence but that seems inelegant. > > This whole discussion seems to be going off on esoteric,

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-13 Thread Steven D'Aprano
On Sun, 11 Mar 2018 01:40:01 +, Ben Bacarisse wrote: > I'm sure deep recursion is not needed, it's just tricky translating from > a lazy language when one is not familiar with all the iterator > facilities in Python. For example, I couldn't find an append operation > that returns an iterable.

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-12 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Sunday, March 11, 2018 at 2:40:16 PM UTC+13, Ben Bacarisse wrote: >> It would be nice to avoid relying on any value-based ordering. > > I don’t see why. The set of elements has to have the same cardinality > as the set of natural numbers, after all. Why not take a

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-10 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Sunday, March 11, 2018 at 3:24:05 AM UTC+13, Ben Bacarisse wrote: >> Unfortunately my Python is not up to using iterators well enough to >> avoid a "maximum recursion depth exceeded" error. > > My solution only needed recursion up to a depth equal to the length of

Re: Unnoticed traceback in a thread (Posting On Python-List Prohibited)

2018-03-08 Thread Rob Gaddi
On 03/08/2018 05:06 PM, Lawrence D’Oliveiro wrote: On Friday, March 9, 2018 at 11:43:00 AM UTC+13, Paul Rubin wrote: That you're using threading.Lock for something like this is a borderline code smell. Any use of multithreading in non-CPU-intensive code is a code smell. But CPU intensive co

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-07 Thread Chris Angelico
On Thu, Mar 8, 2018 at 5:17 AM, Ooomzay wrote: > On Thursday, 1 March 2018 22:44:59 UTC, Rob Gaddi wrote: >> On 03/01/2018 02:24 PM, Lawrence D’Oliveiro wrote: >> > On Thursday, March 1, 2018 at 6:44:39 PM UTC+13, Paul Rubin wrote: >> >> DOM trees are a classic example (see the various DOM module

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-07 Thread Ooomzay
On Thursday, 1 March 2018 22:44:59 UTC, Rob Gaddi wrote: > On 03/01/2018 02:24 PM, Lawrence D’Oliveiro wrote: > > On Thursday, March 1, 2018 at 6:44:39 PM UTC+13, Paul Rubin wrote: > >> DOM trees are a classic example (see the various DOM modules in the > >> Python stdlib). Non-leaf nodes have a

Re: Bitstream -- Binary Data for Humans (Posting On Python-List Prohibited)

2018-03-06 Thread Sébastien Boisgérault
Le mardi 6 mars 2018 11:15:15 UTC+1, Terry Reedy a écrit : > On 3/6/2018 3:58 AM, Sébastien Boisgérault wrote: > > Hi Lawrence, > > > > Le mardi 6 mars 2018 01:20:36 UTC+1, Lawrence D’Oliveiro a écrit : > >> On Tuesday, March 6, 2018 at 8:06:00 AM UTC+13, Sébastien Boisgérault > >> wrote: > >>> I

Re: Bitstream -- Binary Data for Humans (Posting On Python-List Prohibited)

2018-03-06 Thread Terry Reedy
On 3/6/2018 3:58 AM, Sébastien Boisgérault wrote: Hi Lawrence, Le mardi 6 mars 2018 01:20:36 UTC+1, Lawrence D’Oliveiro a écrit : On Tuesday, March 6, 2018 at 8:06:00 AM UTC+13, Sébastien Boisgérault wrote: I have released bitstream, a Python library to manage binary data (at the byte or bit l

Re: Bitstream -- Binary Data for Humans (Posting On Python-List Prohibited)

2018-03-06 Thread Sébastien Boisgérault
Le mardi 6 mars 2018 10:23:02 UTC+1, Lawrence D’Oliveiro a écrit : > On Tuesday, March 6, 2018 at 9:59:55 PM UTC+13, Sébastien Boisgérault wrote: > > > > Le mardi 6 mars 2018 01:20:36 UTC+1, Lawrence D’Oliveiro a écrit : > > > >> On Tuesday, March 6, 2018 at 8:06:00 AM UTC+13, Sébastien Boisgéraul

Re: Bitstream -- Binary Data for Humans (Posting On Python-List Prohibited)

2018-03-06 Thread Sébastien Boisgérault
Hi Lawrence, Le mardi 6 mars 2018 01:20:36 UTC+1, Lawrence D’Oliveiro a écrit : > On Tuesday, March 6, 2018 at 8:06:00 AM UTC+13, Sébastien Boisgérault wrote: > > I have released bitstream, a Python library to manage binary data > > (at the byte or bit level), hopefully without the pain that this

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Gregory Ewing
Richard Damon wrote: The idea was to have a way to mark that certain classes/objects request that they are reference counted so they get the __del__ called as soon as the last reference goes away, without needing to require that overhead for all objects in all implementations. That could be

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Gregory Ewing
Steven D'Aprano wrote: Not just the class __dict__. You would have to do a full search of the MRO looking for any superclass which defines such methods. That could be reduced a lot by making it a type slot. But it would still increase the overhead of every refcount change by at least a factor o

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Gregory Ewing
Paul Rubin wrote: Richard Damon writes: a class to define member functions like __ref__ and __unref__ (or perhaps some other name) that if defined, would be called every time a name was bound or unbound to an object? That sounds horrendous and wouldn't handle the case of a list element creat

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Richard Damon
On 3/3/18 6:57 PM, Steven D'Aprano wrote: On Sat, 03 Mar 2018 10:01:43 -0700, Ian Kelly wrote: On Sat, Mar 3, 2018 at 9:19 AM, Richard Damon wrote: One idea does come to mind though, would it be reasonable, and somewhat Pythonic, for a class to define member functions like __ref__ and __unref

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Steven D'Aprano
On Sat, 03 Mar 2018 10:01:43 -0700, Ian Kelly wrote: > On Sat, Mar 3, 2018 at 9:19 AM, Richard Damon > wrote: >> One idea does come to mind though, would it be reasonable, and somewhat >> Pythonic, for a class to define member functions like __ref__ and >> __unref__ (or perhaps some other name) t

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Chris Angelico
On Sun, Mar 4, 2018 at 3:19 AM, Richard Damon wrote: > One idea does come to mind though, would it be reasonable, and somewhat > Pythonic, for a class to define member functions like __ref__ and __unref__ > (or perhaps some other name) that if defined, would be called every time a > name was bound

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Chris Angelico
On Sun, Mar 4, 2018 at 3:19 AM, Richard Damon wrote: > On 3/3/18 9:03 AM, Ian Kelly wrote: >> >> On Fri, Mar 2, 2018 at 9:57 PM, Gregory Ewing >> wrote: >>> >>> Paul Rubin wrote: So you want the programmer to put more head scratching into figuring out which reference should be stro

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Ian Kelly
On Sat, Mar 3, 2018 at 9:19 AM, Richard Damon wrote: > One idea does come to mind though, would it be reasonable, and somewhat > Pythonic, for a class to define member functions like __ref__ and __unref__ > (or perhaps some other name) that if defined, would be called every time a > name was bound

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Richard Damon
On 3/3/18 9:03 AM, Ian Kelly wrote: On Fri, Mar 2, 2018 at 9:57 PM, Gregory Ewing wrote: Paul Rubin wrote: So you want the programmer to put more head scratching into figuring out which reference should be strong and which should be weak? Also, sometimes weak references don't really solve th

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-03 Thread Ian Kelly
On Fri, Mar 2, 2018 at 9:57 PM, Gregory Ewing wrote: > Paul Rubin wrote: >> >> So you want the programmer to put more head scratching into figuring out >> which reference should be strong and which should be weak? > > > Also, sometimes weak references don't really solve the > problem, e.g. if you

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-02 Thread Gregory Ewing
Paul Rubin wrote: So you want the programmer to put more head scratching into figuring out which reference should be strong and which should be weak? Also, sometimes weak references don't really solve the problem, e.g. if you have a graph where you can't identify any particular node as a "root"

Re: Python 3.6 fails to install to non-standard directory under Linux (Posting On Python-List Prohibited)

2018-03-02 Thread bsferrazza
On Friday, March 2, 2018 at 12:27:17 PM UTC-8, Lawrence D’Oliveiro wrote: > On Saturday, March 3, 2018 at 6:42:05 AM UTC+13, bsfer...@avnera.com wrote: > > > ... > > File "/nfs/home/myuser/lfs/sources/Python-3.6.4/Lib/shutil.py", line 476, > > in rmtree > > ... > > NFS trouble? > > I have had

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-02 Thread ooomzay
On Friday, March 2, 2018 at 1:59:02 AM UTC, Lawrence D’Oliveiro wrote: > On Friday, March 2, 2018 at 1:03:08 PM UTC+13, ooo...@gmail.com wrote: > > On Thursday, March 1, 2018 at 11:51:50 PM UTC, Lawrence D’Oliveiro wrote: > >> On Friday, March 2, 2018 at 12:39:01 PM UTC+13, ooo...@gmail.com wrote:

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-01 Thread ooomzay
On Thursday, March 1, 2018 at 11:51:50 PM UTC, Lawrence D’Oliveiro wrote: > On Friday, March 2, 2018 at 12:39:01 PM UTC+13, ooo...@gmail.com wrote: > > class RAIIFileAccess(): > > '''File Access-like Resource using [RAII] idiom''' > > > > ... > > > > def __del__(self): > >

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-01 Thread Rob Gaddi
On 03/01/2018 02:24 PM, Lawrence D’Oliveiro wrote: On Thursday, March 1, 2018 at 6:44:39 PM UTC+13, Paul Rubin wrote: DOM trees are a classic example (see the various DOM modules in the Python stdlib). Non-leaf nodes have a list of child nodes, child nodes have pointers back upwards to their pa

Re: help me ? (Posting On Python-List Prohibited)

2018-03-01 Thread Rustom Mody
On Thursday, March 1, 2018 at 5:37:28 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 28 Feb 2018 09:58:24 -0800, Aktive wrote: > > > what the hell do you care about cheating.. > > > > the world doest care about cheating. > > > > its about skill. > > Because cheaters don't have skill. That's why

Re: help me ? (Posting On Python-List Prohibited)

2018-02-28 Thread Steven D'Aprano
On Wed, 28 Feb 2018 09:58:24 -0800, Aktive wrote: > what the hell do you care about cheating.. > > the world doest care about cheating. > > its about skill. Because cheaters don't have skill. That's why they cheat. > You guys been too much in school Ah, spoken like a cheater. -- Steve

Re: help me ? (Posting On Python-List Prohibited)

2018-02-28 Thread Aktive
On Wednesday, 28 February 2018 06:00:07 UTC+1, Lawrence D’Oliveiro wrote: > On Wednesday, February 28, 2018 at 4:44:04 PM UTC+13, jlad...@itu.edu wrote: > > This is part of the reason why interviews for software developer jobs > > have gotten so crazy. > > This is why you need to have a CV that b

Re: could use some help with this problem! (Posting On Python-List Prohibited)

2018-02-20 Thread Terry Reedy
On 2/20/2018 7:59 PM, Ben Bacarisse wrote: Lawrence D’Oliveiro writes: On Wednesday, February 21, 2018 at 3:10:25 AM UTC+13, Ben Bacarisse wrote: You almost never /have/ to use nested loops. Has the course got this far without introducing the idea of a function? If you are using a function

Re: could use some help with this problem! (Posting On Python-List Prohibited)

2018-02-20 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Wednesday, February 21, 2018 at 3:10:25 AM UTC+13, Ben Bacarisse wrote: >> You almost never /have/ to use nested loops. Has the course got this >> far without introducing the idea of a function? > > If you are using a function to avoid a nested loop, perhaps that

Re: Are the critiques in "All the things I hate about Python" valid? (Posting On Python-List Prohibited)

2018-02-20 Thread bartc
On 20/02/2018 19:35, Lawrence D’Oliveiro wrote: On Wednesday, February 21, 2018 at 1:43:41 AM UTC+13, bartc wrote: In Pascal (and presumably Ada) then all the gubbins need to make this work properly: var x: 1..10; x = 10; x = x + 1; { error? } Error on both statements. Pascal d

Re: Extracting data from ython dictionary object (Posting On Python-List Prohibited)

2018-02-09 Thread Stanley Denman
On Friday, February 9, 2018 at 12:20:29 AM UTC-6, Lawrence D’Oliveiro wrote: > On Friday, February 9, 2018 at 6:04:48 PM UTC+13, Stanley Denman wrote: > > {'/Title': '1F: Progress Notes Src.: MILANI, JOHN C Tmt. Dt.: > > 05/12/2014 - 05/28/2014 (9 pages)', '/Page': IndirectObject(465, 0), > >

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread eryk sun
On Thu, Feb 1, 2018 at 4:57 AM, Victor Porton wrote: > Lawrence D’Oliveiro wrote: > >> On Thursday, February 1, 2018 at 8:10:24 AM UTC+13, Victor Porton wrote: >>> Lawrence D’Oliveiro wrote: >>> The usual behaviour for POSIX is that the call is aborted with EINTR after you get the signal

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Thursday, February 1, 2018 at 5:57:58 PM UTC+13, Victor Porton wrote: >> I meant to call poll() from C code, not Python code. > > Do you need to use C code at all? Python is quite capable of handling this > . I alread

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Thursday, February 1, 2018 at 8:10:24 AM UTC+13, Victor Porton wrote: >> Lawrence D’Oliveiro wrote: >> >>> The usual behaviour for POSIX is that the call is aborted with EINTR >>> after you get the signal. >> >> That poll() is interrupted does not imply that Pytho

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 9:55:45 PM UTC+13, Victor Porton wrote: >> Lawrence D’Oliveiro wrote: >> >>> On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton >>> wrote: For this reason I cannot use Python signals because "A Python signal

Re: Package containing C sources (Posting On Python-List Prohibited)

2018-01-31 Thread Vincent Vande Vyvre
Le 31/01/18 à 07:52, Victor Porton a écrit : Lawrence D’Oliveiro wrote: On Wednesday, January 31, 2018 at 6:13:00 PM UTC+13, Victor Porton wrote: I am going to create a Python wrapper around a generally useful C library. So the wrapper needs to contain some C code to glue them together. Not n

Re: Handle SIGINT in C and Python (Posting On Python-List Prohibited)

2018-01-31 Thread Victor Porton
Lawrence D’Oliveiro wrote: > On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton wrote: >> For this reason I >> cannot use Python signals because "A Python signal handler does not get >> executed inside the low-level (C) signal handler. Instead, the low-level >> signal handler sets

  1   2   3   >