Re: []=[]

2023-09-22 Thread Greg Ewing via Python-list
On 23/09/23 4:51 am, Stefan Ram wrote: []=[] (Executes with no error.) # []=[] ( 1 ) #\_/# (Executes with no error.) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Using generator expressions

2023-09-25 Thread Jonathan Gossage via Python-list
hat I tried generator expressions both inside parentheses and not, without success. -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Re: Using generator expressions

2023-09-25 Thread Dom Grigonis via Python-list
y = test1(*[a for a in st]) y = test1(*st) Maybe any of these would be ok for you? Regards, DG > On 25 Sep 2023, at 17:15, Jonathan Gossage via Python-list > wrote: > > I am having a problem using generator expressions to supply the arguments > for a class instance init

Re: Using generator expressions

2023-09-25 Thread Thomas Passin via Python-list
On 9/25/2023 10:15 AM, Jonathan Gossage via Python-list wrote: I am having a problem using generator expressions to supply the arguments for a class instance initialization. The following example shows the problem: class test1(object): def __init__(self, a, b): self.name = a

ANN: Python Meeting Düsseldorf - 27.09.2023

2023-09-25 Thread eGenix Team via Python-list
/This announcement is in German since it targets a local user group//meeting in Düsseldorf, Germany/ Ankündigung Python Meeting Düsseldorf - September 2023 <https://www.egenix.com/company/news/Python-Meeting-Duesseldorf-2023-09-27> Ein Treffen von Python Enthusiast

Re: Using generator expressions

2023-09-25 Thread Jonathan Gossage via Python-list
Mon, Sep 25, 2023 at 11:15 AM Thomas Passin via Python-list < [email protected]> wrote: > On 9/25/2023 10:15 AM, Jonathan Gossage via Python-list wrote: > > I am having a problem using generator expressions to supply the arguments > > for a class instance initialization.

Re: Using generator expressions

2023-09-25 Thread Chris Angelico via Python-list
On Tue, 26 Sept 2023 at 01:39, Jonathan Gossage via Python-list wrote: > > Many thanks, all. It turned out that my problem was not fully understanding > the use and power of the unpack operator *. Using it to activate my > generator made things start to work. I changed the line whe

Re: []=[]

2023-09-25 Thread Piergiorgio Sartor via Python-list
On 23/09/2023 09.41, Stefan Ram wrote: [email protected] (Stefan Ram) writes: []=[] I was watching a video of a David Beazley talk "Python Concurrency From the Ground Up" , where he wrote can_recv, can_send, [] = select(recv_wait, send_wait, []) . Later, he clarifi

Re: []=[]

2023-09-25 Thread Chris Angelico via Python-list
On Tue, 26 Sept 2023 at 02:52, Piergiorgio Sartor via Python-list wrote: > > On 23/09/2023 09.41, Stefan Ram wrote: > > [email protected] (Stefan Ram) writes: > >> []=[] > > > >I was watching a video of a David Beazley talk "Python > >Conc

Re: []=[]

2023-09-26 Thread Rob Cliffe via Python-list
It's not a bug, it's an empty unpacking. Just as you can write     [A,B] = [1,2] # Sets A to 1, B to 2 Best wishes Rob Cliffe On 23/09/2023 04:41, Greg Ewing via Python-list wrote: On 23/09/23 4:51 am, Stefan Ram wrote: []=[]    (Executes with no error.) # []=[] ( 1 ) #\_/#

Unable to uninstall 3.10.9

2023-09-26 Thread Pau Vilchez via Python-list
Hello Python Team, I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my computer. I have tried deleting the Appdata folder then repairing and then uninstalling but it still persists in the remove/add program function in windows 10. I am just trying to reinstall it because I

The GIL and PyEval_RestoreThread

2023-09-26 Thread Peter Ebden via Python-list
Hi all, I've been working on embedding Python and have an interesting case around locking with PyEval_RestoreThread which wasn't quite doing what I expect, hoping someone can explain what I should expect here. I have a little example (I'm running this in parallel from two diffe

Re: error of opening Python

2023-09-26 Thread Greg Ewing via Python-list
On 27/09/23 3:30 pm, Chris Roy-Smith wrote: surely running a 64 bit version of python in a 23mbit version of windows will cause significant problems! 23 millibits? I don't think you'd be able to run much at all with that few bits! :-) -- Greg -- https://mail.python.org/mailman/listi

Re: The GIL and PyEval_RestoreThread

2023-09-27 Thread Peter Ebden via Python-list
" That suggests to me that it should try to acquire the GIL again and wait until it can (although possibly also that it's not an expected use and Python thread states are expected to be more 1:1 with C threads). On Wed, Sep 27, 2023 at 3:53 AM MRAB via Python-list wrote: > On 2023-09

venv --upgrade 3.12.0rc2 --> 3.12.0rc3 failure

2023-09-27 Thread Robin Becker via Python-list
Attempting venv upgrade 3.12.0rc2 --> 3.12.0rc3 I find pyvenv.cfg changes, but the virtual python doesn't. I guess this ought to be a bug. user@host:~/devel $ ~/LOCAL?3.12.0rc2/bin/python3 -m venv xxx bash: /home/user/LOCAL?3.12.0rc2/bin/python3: No such file or directory user@host

Re: Unable to uninstall 3.10.9

2023-09-27 Thread Mats Wichmann via Python-list
On 9/25/23 12:10, Pau Vilchez via Python-list wrote: Hello Python Team, I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my computer. I have tried deleting the Appdata folder then repairing and then uninstalling but it still persists in the remove/add program function in

Re: upgrade of pip on my python 2.7 version

2023-09-27 Thread Thomas Passin via Python-list
On 9/27/2023 7:17 AM, Zuri Shaddai Kuchipudi via Python-list wrote: hello everyone this the error that im getting while trying to install and upgrade pip on what is the solution for it? C:\repository\pst-utils-pc-davinci-simulator>pip install You are using pip version 7.0.1, however vers

Re: upgrade of pip on my python 2.7 version

2023-09-27 Thread Chris Angelico via Python-list
On Thu, 28 Sept 2023 at 01:16, Zuri Shaddai Kuchipudi via Python-list wrote: > > hello everyone this the error that im getting while trying to install and > upgrade pip on what is the solution for it? > The solution is to upgrade to Python 3. https://pip.pypa.io/en/latest/develop

path to python in venv

2023-09-27 Thread Larry Martell via Python-list
I was under the impression that in a venv the python used would be in the venv's bin dir. But in my venvs I see this in the bin dirs: lrwxrwxrwx 1 larrymartell larrymartell7 Sep 27 11:21 python -> python3 lrwxrwxrwx 1 larrymartell larrymartell 16 Sep 27 11:21 python3 -> /usr/

Re: upgrade of pip on my python 2.7 version

2023-09-27 Thread Mats Wichmann via Python-list
On 9/27/23 05:17, Zuri Shaddai Kuchipudi via Python-list wrote: hello everyone this the error that im getting while trying to install and upgrade pip on what is the solution for it? C:\repository\pst-utils-pc-davinci-simulator>pip install You are using pip version 7.0.1, however version 23.

Re: path to python in venv

2023-09-27 Thread Jon Ribbens via Python-list
On 2023-09-27, Larry Martell wrote: > I was under the impression that in a venv the python used would be in > the venv's bin dir. But in my venvs I see this in the bin dirs: > > lrwxrwxrwx 1 larrymartell larrymartell 7 Sep 27 11:21 python -> python3 > lrwxrwxrwx 1 la

Re: path to python in venv

2023-09-27 Thread Larry Martell via Python-list
On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: > > On 2023-09-27, Larry Martell wrote: > > I was under the impression that in a venv the python used would be in > > the venv's bin dir. But in my venvs I see this in the bin dirs: > > > > lrw

RE: path to python in venv

2023-09-27 Thread Niktar Lirik via Python-list
Hi Larry, You could just create venv with option '—copies' For example: python -m venv -–copies .venv From: Larry Martell via Python-list Sent: 27 сентября 2023 г. 22:48 To: Jon Ribbens Cc: [email protected] Subject: Re: path to python in venv On Wed, Sep 27, 2023 at 12:42 PM J

Re: path to python in venv

2023-09-27 Thread Larry Martell via Python-list
On Wed, Sep 27, 2023 at 12:53 PM Niktar Lirik wrote: > > Hi Larry, > > You could just create venv with option '—copies' > > > > For example: > > python -m venv -–copies .venv Thanks! That is just what I was looking for. > From: Larry Martell via Py

Re: path to python in venv

2023-09-27 Thread Mats Wichmann via Python-list
On 9/27/23 13:46, Larry Martell via Python-list wrote: On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list wrote: On 2023-09-27, Larry Martell wrote: I was under the impression that in a venv the python used would be in the venv's bin dir. But in my venvs I see this in the bin

Re: path to python in venv

2023-09-27 Thread Jon Ribbens via Python-list
On 2023-09-27, Larry Martell wrote: > On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list > wrote: >> On 2023-09-27, Larry Martell wrote: >> > I was under the impression that in a venv the python used would be in >> > the venv's bin dir. But in

Re: upgrade of pip on my python 2.7 version

2023-09-27 Thread Mats Wichmann via Python-list
On 9/27/23 14:02, Zuri Shaddai Kuchipudi via Python-list wrote: Why it's trying to select an incompatible version when you ask to upgrade is not something I'd like to speculate on, for me personally that's a surprise. Maybe something else you did before? Also make sure you'

Re: upgrade of pip on my python 2.7 version

2023-09-27 Thread Chris Angelico via Python-list
On Thu, 28 Sept 2023 at 07:27, Mats Wichmann via Python-list wrote: > > Upgrading to Python 3 is the best answer... except when it isn't. If > you want to convert a small project it's usually not too hard; and using > a conversion tool can work well. Just remember that P

Re: path to python in venv

2023-09-27 Thread Thomas Passin via Python-list
On 9/27/2023 2:53 PM, Larry Martell via Python-list wrote: I was under the impression that in a venv the python used would be in the venv's bin dir. But in my venvs I see this in the bin dirs: lrwxrwxrwx 1 larrymartell larrymartell7 Sep 27 11:21 python -> python3 lrwxrwxrwx 1 larr

Re: venv --upgrade 3.12.0rc2 --> 3.12.0rc3 failure

2023-09-28 Thread Robin Becker via Python-list
On 28/09/2023 10:05, Barry via Python-list wrote: So this must be the source of my confusion user@host:~ $ python312 -mvenv --help .. --upgrade Upgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place

Installing package as root to a system directory

2023-09-28 Thread Loris Bennett via Python-list
, but seems to me to be a little clunky, mainly because the files don't then belong to root. The most correct way, in my case, would probably be to create an RPM out of the Python package, but that seems like it would be too much overhead. What other approaches to people use? Cheers,

Re: upgrade of pip on my python 2.7 version

2023-09-28 Thread Thomas Passin via Python-list
On 9/28/2023 9:23 AM, Zuri Shaddai Kuchipudi via Python-list wrote: On Wednesday, 27 September 2023 at 23:33:02 UTC+2, Chris Angelico wrote: On Thu, 28 Sept 2023 at 07:27, Mats Wichmann via Python-list wrote: Upgrading to Python 3 is the best answer... except when it isn't. If you wa

Re: Dynamically modifying "__setattr__"

2023-09-29 Thread Greg Ewing via Python-list
, '=', value) a = A() a.x = 1 print('a.x =', a.x) -- Greg -- https://mail.python.org/mailman/listinfo/python-list

type annotation vs working code

2023-09-30 Thread Karsten Hilbert via Python-list
ailingSingleton' object has no attribute 'special_value' Where's the error in my thinking (or code) ? Thanks, Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-list

Re: type annotation vs working code

2023-09-30 Thread Mats Wichmann via Python-list
On 9/30/23 13:00, Karsten Hilbert via Python-list wrote: A type annotation isn't supposed to change what code does, or so I thought: # class Borg: _instances:dict = {} def __new__(cls, *args, **

Re: type annotation vs working code

2023-09-30 Thread Karsten Hilbert via Python-list
Am Sun, Oct 01, 2023 at 09:04:05AM +1300 schrieb dn via Python-list: > >class WorkingSingleton(Borg): > > > > def __init__(self): > > print(self.__class__.__name__, ':') > > try: > > self.already_init

Re: type annotation vs working code

2023-10-01 Thread Karsten Hilbert via Python-list
intent: a class where each instance is aware of every other > instance - yet > the word "Singleton" implies there's only one (cf a dict full of ...)? The latter. Regards, Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-list

Re: type annotation vs working code

2023-10-01 Thread Chris Angelico via Python-list
On Sun, 1 Oct 2023 at 22:58, Karsten Hilbert via Python-list wrote: > > Sorry for having conflated the core of the matter with all > the Borg shenanigans, that's where I found the problem in my > real code, so there :-)

Re: type annotation vs working code

2023-10-01 Thread Richard Damon via Python-list
g (set to True when you initialize), and look it up with getattr() with a default value of False. -- Richard Damon -- https://mail.python.org/mailman/listinfo/python-list

Re: type annotation vs working code

2023-10-01 Thread Chris Angelico via Python-list
On Mon, 2 Oct 2023 at 09:10, Barry via Python-list wrote: > > > > > On 1 Oct 2023, at 19:36, Richard Damon via Python-list > > wrote: > > > > Perhaps a better method would be rather than just using the name and > > catching the exception, use a rea

How to write list of integers to file with struct.pack_into?

2023-10-02 Thread Jen Kris via Python-list
= bytes(qs_array[offset]) struct.pack_into(buf,"https://mail.python.org/mailman/listinfo/python-list

Python 3.12.0 (final) now available.

2023-10-02 Thread Thomas Wouters via Python-list
Finally, it’s final! The final release of Python 3.12.0 (final) is here! https://www.python.org/downloads/release/python-3120/ This is the stable release of Python 3.12.0 Python 3.12.0 is the newest major release of the Python programming language, and it contains many new features and

Re: How to write list of integers to file with struct.pack_into?

2023-10-02 Thread Jen Kris via Python-list
the extra overhead, and it's more difficult yet if I'm using the Python integer output in a C program.  Your solution solves those problems.  Oct 2, 2023, 17:11 by [email protected]: > On 2023-10-01 23:04, Jen Kris via Python-list wrote: > >> >> Iwant to write

Re: How to write list of integers to file with struct.pack_into?

2023-10-02 Thread Dieter Maurer via Python-list
ct.pack_into("https://mail.python.org/mailman/listinfo/python-list

Re: How to write list of integers to file with struct.pack_into?

2023-10-02 Thread Jen Kris via Python-list
offset` is `0`, `1`, `2`, ... > but it should be `0 *8`, `1 * 8`, `2 * 8`, ... > > * The `vi` should be something which fits with the format: > integers in your case. But you pass bytes. > > Try `struct.pack_into(" instead of your loop. > > > Next time: carefully read the documentation and think carefully > about the types involved. > -- https://mail.python.org/mailman/listinfo/python-list

How to write list of integers to file with struct.pack_into?

2023-10-03 Thread Jen Kris via Python-list
work I have done:     buf = bytes((len(qs_array)) * 8)     for offset in range(len(qs_array)):     item_to_write = bytes(qs_array[offset])     struct.pack_into(buf, "https://mail.python.org/mailman/listinfo/python-list

Re: How to write list of integers to file with struct.pack_into?

2023-10-03 Thread Roel Schroeven via Python-list
Jen Kris via Python-list schreef op 2/10/2023 om 17:06: My previous message just went up -- sorry for the mangled formatting.  Here it is properly formatted: I want to write a list of 64-bit integers to a binary file.  Every example I have seen in my research converts it to .txt, but I want

Re: type annotation vs working code

2023-10-03 Thread Chris Angelico via Python-list
On Wed, 4 Oct 2023 at 15:27, dn via Python-list wrote: > - should the class have been called either; > > class SomethingSingleton(): > > or a Singleton() class defined, which is then sub-classed, ie > > class Something( Singleton ): > > in order to better com

Re: type annotation vs working code

2023-10-03 Thread Greg Ewing via Python-list
alled, and returns that instance subsequently. The problem then doesn't arise. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: type annotation vs working code

2023-10-03 Thread Chris Angelico via Python-list
On Wed, 4 Oct 2023 at 17:47, Greg Ewing via Python-list wrote: > > On 4/10/23 5:25 pm, dn wrote: > > The first question when dealing with the Singleton Pattern is what to do > > when more than one instantiation is attempted > > My preferred way of handling singletons is

Unable to completely remove Python 3.10.9 (64 bit) from Computer

2023-10-04 Thread Pau Vilchez via Python-list
Hello Python Team,   I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my computer. I have tried deleting the Appdata folder then repairing and then uninstalling but it still persists in the remove/add program function in windows 10. I am just trying to

Re: Unable to completely remove Python 3.10.9 (64 bit) from Computer

2023-10-04 Thread Roland Müller via Python-list
On 25.9.2023 19.58, Pau Vilchez via Python-list wrote: Hello Python Team, I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my computer. I have tried deleting the Appdata folder then repairing and then uninstalling but it still persists in the remove

Re: type annotation vs working code

2023-10-04 Thread Karsten Hilbert via Python-list
Am Wed, Oct 04, 2023 at 05:25:04PM +1300 schrieb dn via Python-list: > The first question when dealing with the Singleton Pattern is what to do when > more than > one instantiation is attempted: > > - silently return the first instance This, in my case. > and so, returnin

Re: Unable to completely remove Python 3.10.9 (64 bit) from Computer

2023-10-05 Thread Mats Wichmann via Python-list
On 10/4/23 13:08, Roland Müller via Python-list wrote: On 25.9.2023 19.58, Pau Vilchez via Python-list wrote:     Hello Python Team,     I am somehow unable to completely remove Python 3.10.9 (64 Bit) from my     computer. I have tried deleting the Appdata folder then repairing and then

regarding installation of python version

2023-10-09 Thread Thri sowmya.G via Python-list
  The problem is how many times I have uninstalled the python version but always it is showing the  same version  after the installation  of new version too  .But in all control panel and file explorer at everywhere the system showing that the old  version got uninstalled  but

RE: regarding installation of python version

2023-10-09 Thread Mike Dewhirst via Python-list
Look in Windows Settings, About, Advanced system settings, Environment variables and you will see two sets of variables. One for the system and one set for yourself.Select Path and click [Edit]Carefully remove all references to Python in both sets.In theory you can now install a new Python and

Is a Python event polled or interrupt driven?

2023-10-12 Thread Chris Green via Python-list
In the following code is the event polled by the Python process running the code or is there something cleverer going on such that Python sees an interrupt when the input goes high (or low)? import Adafruit_BBIO.GPIO as GPIO Pin = "P8_8" GPIO.setup(Pin, GPIO.IN)# set

Re: Is a Python event polled or interrupt driven?

2023-10-12 Thread Chris Angelico via Python-list
On Fri, 13 Oct 2023 at 01:48, Chris Green via Python-list wrote: > > In the following code is the event polled by the Python process > running the code or is there something cleverer going on such that > Python sees an interrupt when the input goes high (or low)? > This isn'

Re: Is a Python event polled or interrupt driven?

2023-10-12 Thread Chris Green via Python-list
Chris Angelico wrote: > On Fri, 13 Oct 2023 at 01:48, Chris Green via Python-list > wrote: > > > > In the following code is the event polled by the Python process > > running the code or is there something cleverer going on such that > > Python sees an interrupt wh

Python 3.13.0 alpha 1 now available.

2023-10-13 Thread Thomas Wouters via Python-list
It’s not a very exciting release (yet), but it’s time for the first alpha of Python 3.13 anyway! https://www.python.org/downloads/release/python-3130a1/ *This is an early developer preview of Python 3.13* <https://discuss.python.org/t/python-3-13-0-alpha-1/36109#major-new-features-of-the-

Where I do ask for a new feature

2023-10-16 Thread Bongo Ferno via Python-list
Where I can ask python developers for a new feature? This feature would allow us to create short aliases for long object paths, similar to the with statement. This would make code more readable and maintainable. For example, if we have a long object like "MyObject.stuff.longStuff.SubO

Re: Where I do ask for a new feature

2023-10-16 Thread Chris Angelico via Python-list
On Tue, 17 Oct 2023 at 12:55, Bongo Ferno via Python-list wrote: > > Where I can ask python developers for a new feature? > > This feature would allow us to create short aliases for long object paths, > similar to the with statement. This would make code more readable and

FlaskCon 2023 CFP

2023-10-17 Thread David Carmichael via Python-list
chael* -- https://mail.python.org/mailman/listinfo/python-list

Simple webserver

2023-10-18 Thread Janis Papanagnou via Python-list
found a Python sample[*] but I am neither familiar with Python nor with the 'simple_websocket_server' package that is used in that sample code. But the code looks so simple that I'm considering to learn and use Python for the task. The requirements I have are quite simple; I want to

Any possible type alias that can also set a default value for a function arg?

2023-10-18 Thread Matthew Carruth via Python-list
tional[str] = None foo: Default[str, "bar"] would be equivalent to foo: Optional[str] = "bar" or something like that. Basically, any way to avoid writing `= None` over and over again. -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple webserver

2023-10-18 Thread Chris Angelico via Python-list
On Thu, 19 Oct 2023 at 10:07, Janis Papanagnou via Python-list wrote: > > I am pondering about writing a client/server software with > websockets as communication protocol. The clients will run > in browser as Javascript programs and the server may be in > any (any sensible) progr

Re: Any possible type alias that can also set a default value for a function arg?

2023-10-18 Thread Chris Angelico via Python-list
On Thu, 19 Oct 2023 at 10:11, Matthew Carruth via Python-list wrote: > > We have the `Optional[T]` type as a short-hand for Union[T | None] and > telling us that said argument may not be present. > > However, I find that a majority of the time, we also want to set a default >

Re: Simple webserver

2023-10-18 Thread Janis Papanagnou via Python-list
and I also appreciate your offer and will probably come back soon with a question... - Thanks again! Janis -- https://mail.python.org/mailman/listinfo/python-list

Aw: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Karsten Hilbert via Python-list
(valid) code ... In Python a distinction can be made between "runnable" and "valid" :-D Karsten -- https://mail.python.org/mailman/listinfo/python-list

Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Chris Angelico via Python-list
regular running of the code, > > Except when they do ;-) > > ... depending on what counts as (valid) code ... > > In Python a distinction can be made between "runnable" and "valid" :-D > Can you give a counter-example? I mean, yes, any code can be written t

Aw: Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Karsten Hilbert via Python-list
> > > Fundamentally no, at least not without some shenanigans. Type hints do > > > not affect the regular running of the code, > > > > Except when they do ;-) > > > > ... depending on what counts as (valid) code ... > > > > In Python a dist

Re: Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Chris Angelico via Python-list
... depending on what counts as (valid) code ... > > > > > > In Python a distinction can be made between "runnable" and "valid" :-D > > > > > > > Can you give a counter-example? > > As per my recent foray into abusing existenc

Aw: Re: Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Karsten Hilbert via Python-list
> > >>> True > > > > and then changing that to > > > > >>> try: self.initialized:bool > > But that's not equivalent code. I learned as much (RHS vs LHS). But it did not _intuitively_ resonate with the sentiment "type annotation does not change the running of code". Karsten -- https://mail.python.org/mailman/listinfo/python-list

Re: Re: Re: Re: Any possible type alias that can also set a default value for a function arg?

2023-10-19 Thread Chris Angelico via Python-list
ivalent code. > > I learned as much (RHS vs LHS). > > But it did not _intuitively_ resonate with the sentiment > "type annotation does not change the running of code". Unfortunately, that simply means that your intuition was wrong. It doesn't change my prior statement. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Where I do ask for a new feature

2023-10-19 Thread Bongo Ferno via Python-list
> You can actually just do that with simple assignment! > > short_view = my_object.stuff.long_stuff.sub_object > print(short_view.some_method()) but then have to delete the variable manually del short_view -- https://mail.python.org/mailman/listinfo/python-list

RE: Where I do ask for a new feature

2023-10-19 Thread AVI GROSS via Python-list
need yet another? Yes, you can create one of those ways but what is the big deal with deleting a variable when no longer used? Examples might be the "finally" clause or the "with" statement or just putting the variable in a nested scope. -Original Message- From: Pytho

Re: Where I do ask for a new feature

2023-10-19 Thread Bongo Ferno via Python-list
nger used? Assigning a variable to something can be anything else than a temporal alias. A with statement makes clear that the alias is an alias and is local, and it automatically clears the variable after the block code is used. Python clutters the variable space with vars that are neede

Re: Where I do ask for a new feature

2023-10-19 Thread Cameron Simpson via Python-list
io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'> >>> print(f) <_io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'> -- https://mail.python.org/mailman/listinfo/python-list

Re: Where I do ask for a new feature

2023-10-20 Thread Roel Schroeven via Python-list
Op 20/10/2023 om 5:16 schreef Bongo Ferno via Python-list: On Thursday, October 19, 2023 at 11:26:52 PM UTC-3, [email protected] wrote: > There are many ways to make transient variables that disappear at some time > and do we need yet another? Yes, you can create one of those ways bu

Re: Simple webserver

2023-10-20 Thread Janis Papanagnou via Python-list
On 19.10.2023 01:23, Chris Angelico wrote: > > Broadly speaking, your ideas are great. Any programming language CAN > be used for the server (and I've used several, not just Python). Out of curiosity; what where these languages? - If there's one I already know I might save som

Re: Simple webserver

2023-10-20 Thread Chris Angelico via Python-list
On Fri, 20 Oct 2023 at 22:31, Janis Papanagnou via Python-list wrote: > > On 19.10.2023 01:23, Chris Angelico wrote: > > > > Broadly speaking, your ideas are great. Any programming language CAN > > be used for the server (and I've used several, not just Python). >

Re: Where I do ask for a new feature

2023-10-20 Thread Thomas Passin via Python-list
On 10/19/2023 11:16 PM, Bongo Ferno via Python-list wrote: On Thursday, October 19, 2023 at 11:26:52 PM UTC-3, [email protected] wrote: There are many ways to make transient variables that disappear at some time and do we need yet another? Yes, you can create one of those ways but what is the

Re: Simple webserver

2023-10-20 Thread De ongekruisigde via Python-list
On 2023-10-20, Chris Angelico wrote: > On Fri, 20 Oct 2023 at 22:31, Janis Papanagnou via Python-list > wrote: >> >> On 19.10.2023 01:23, Chris Angelico wrote: >> > >> > Broadly speaking, your ideas are great. Any programming language CAN >> > be us

RE: Where I do ask for a new feature

2023-10-20 Thread AVI GROSS via Python-list
there was often a preprocessor that went through your code and made changes like: #DEFINE filename "/usr/me/dir/subdir/file.c" This could allow some shorter typing but would not have anything in the namespace on the compiler level which would just see the longer substitutions.

Re: Where I do ask for a new feature

2023-10-20 Thread Michael Torrie via Python-list
On 10/19/23 19:32, Bongo Ferno via Python-list wrote: > >> You can actually just do that with simple assignment! >> >> short_view = my_object.stuff.long_stuff.sub_object >> print(short_view.some_method()) > > but then have to delete the variable manually >

Running a subprocess in a venv

2023-10-21 Thread Larry Martell via Python-list
I have a python script, and from that I want to run another script in a subprocess in a venv. What is the best way to do that? I could write a file that activates the venv then runs the script, then run that file, but that seems messy. Is there a better way? -- https://mail.python.org/mailman

Re: Running a subprocess in a venv

2023-10-21 Thread Johannes Findeisen via Python-list
On Sat, 21 Oct 2023 09:01:18 -0400 Larry Martell via Python-list wrote: > I have a python script, and from that I want to run another script in > a subprocess in a venv. What is the best way to do that? I could write > a file that activates the venv then runs the script, then run th

Re: Running a subprocess in a venv

2023-10-21 Thread Roel Schroeven via Python-list
Larry Martell via Python-list schreef op 21/10/2023 om 15:01: I have a python script, and from that I want to run another script in a subprocess in a venv. What is the best way to do that? I could write a file that activates the venv then runs the script, then run that file, but that seems messy

Re: Running a subprocess in a venv

2023-10-21 Thread Larry Martell via Python-list
On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen wrote: > > On Sat, 21 Oct 2023 09:01:18 -0400 > Larry Martell via Python-list wrote: > > > I have a python script, and from that I want to run another script in > > a subprocess in a venv. What is the best way to do t

Re: Running a subprocess in a venv

2023-10-21 Thread Johannes Findeisen via Python-list
On Sat, 21 Oct 2023 11:32:03 -0400 Larry Martell wrote: > On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen > wrote: > > > > On Sat, 21 Oct 2023 09:01:18 -0400 > > Larry Martell via Python-list wrote: > > > > > I have a python script, and from that

Re: Running a subprocess in a venv

2023-10-21 Thread Larry Martell via Python-list
On Sat, Oct 21, 2023 at 12:10 PM Johannes Findeisen wrote: > > On Sat, 21 Oct 2023 11:32:03 -0400 > Larry Martell wrote: > > > On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen > > wrote: > > > > > > On Sat, 21 Oct 2023 09:01:18 -0400 > > > La

Re: Running a subprocess in a venv

2023-10-21 Thread Thomas Passin via Python-list
On 10/21/2023 11:32 AM, Larry Martell via Python-list wrote: On Sat, Oct 21, 2023 at 9:49 AM Johannes Findeisen wrote: On Sat, 21 Oct 2023 09:01:18 -0400 Larry Martell via Python-list wrote: I have a python script, and from that I want to run another script in a subprocess in a venv. What

Re: Simple webserver

2023-10-21 Thread Janis Papanagnou via Python-list
On 20.10.2023 23:05, Paul Rubin wrote: > Janis Papanagnou writes: >> I found a Python sample[*] but I am neither familiar with >> Python nor with the 'simple_websocket_server' package that >> is used in that sample code. But the code looks so simple >> that I&

Re: Simple webserver

2023-10-21 Thread Chris Angelico via Python-list
On Sun, 22 Oct 2023 at 04:13, Janis Papanagnou via Python-list wrote: > I have a couple decades experience with about a dozen programming > languages (not counting assemblers). Asynchronous processing, IPC, > multi-processing, client/server architectures, multi-threading, > semaphor

Re: Running a subprocess in a venv

2023-10-21 Thread Mats Wichmann via Python-list
On 10/21/23 07:01, Larry Martell via Python-list wrote: I have a python script, and from that I want to run another script in a subprocess in a venv. What is the best way to do that? I could write a file that activates the venv then runs the script, then run that file, but that seems messy. Is

Cheetah 3.3.3

2023-10-22 Thread Oleg Broytman via Python-list
Hello! I'm pleased to announce version 3.3.3, the fourth release of branch 3.3 of CheetahTemplate3. What's new in CheetahTemplate3 == Minor features: - Protect ``import cgi`` in preparation to Python 3.13. Tests: - Run tests with Python

return type same as class gives NameError.

2023-10-22 Thread Antoon Pardon via Python-list
T'? Can someone explain what I am doing wrong? -- https://mail.python.org/mailman/listinfo/python-list

Re: Simple webserver

2023-10-22 Thread Dieter Maurer via Python-list
Janis Papanagnou wrote at 2023-10-21 04:03 +0200: > ... >I'd like to ask; where do you see the specific risks with Python >(as language per se) and it's (web-socket-)libraries here? The web server in Python's runtime library is fairly simple, focusing only on the HTTP

Re: return type same as class gives NameError.

2023-10-22 Thread Cameron Simpson via Python-list
This message: NameError: name 'Pnt' is not defined. Did you mean: 'PNT'? is unfortunate, because you have a very similar "PNT" name in scope. But it isn't what you want. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

Re: Question(s)

2023-10-24 Thread Dom Grigonis via Python-list
hy (at least from my perspective) working in unix environment is so much more pleasant. https://en.wikipedia.org/wiki/Unix_philosophy <https://en.wikipedia.org/wiki/Unix_philosophy> Regards, DG > On 24 Oct 2023, at 15:22, o1bigtenor via Python-list > wrote: > > Greetings &g

<    26   27   28   29   30   31   32   33   34   35   >