Re: Why doc call `__init__` as a method rather than function?

2023-09-15 Thread Clara Spealman via Python-list
On Fri, Sep 15, 2023 at 6:53 AM scruel tao via Python-list < python-list@python.org> wrote: > ```python > >>> class A: > ... def __init__(self): > ... pass > ... > >>> A.__init__ > > >>> a = A() > >>> a.__init__ > > &

Re: Why doc call `__init__` as a method rather than function?

2023-09-15 Thread Alan Gauld via Python-list
On 15/09/2023 11:49, scruel tao via Python-list wrote: > ```python >>>> class A: > ... def __init__(self): > ... pass > On many books and even the official documents, it seems that > many authors prefer to call `__init__` as a "method" rather >

Re: PEP668 / pipx and "--editable" installs

2023-09-15 Thread Rimu Atkinson via Python-list
. -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP668 / pipx and "--editable" installs

2023-09-16 Thread Karsten Hilbert via Python-list
Am Sat, Sep 16, 2023 at 02:17:19PM +1200 schrieb Rimu Atkinson via Python-list: > Everyone uses virtual environments. Umm, like, no. Karsten -- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B -- https://mail.python.org/mailman/listinfo/python-list

RE: Postgresql equivalent of Python's timeit?

2023-09-17 Thread AVI GROSS via Python-list
may have trouble duplicating the results with a somewhat different setup. -Original Message- From: Python-list On Behalf Of Albert-Jan Roskam via Python-list Sent: Sunday, September 17, 2023 5:02 AM To: Peter J. Holzer Cc: python-list@python.org Subject: Re: Postgresql equivalent of

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Thomas Passin via Python-list
On 9/17/2023 11:48 AM, AVI GROSS via Python-list wrote: Timing things that are fairly simple is hard enough to do repeatedly, but when it involves access to slower media and especially to network connections to servers, the number of things that can change are enormous. There are all kinds of

Re: Postgresql equivalent of Python's timeit?

2023-09-17 Thread Thomas Passin via Python-list
On 9/17/2023 5:01 AM, Albert-Jan Roskam via Python-list wrote: On Sep 15, 2023 19:45, "Peter J. Holzer via Python-list" wrote: On 2023-09-15 17:42:06 +0200, Albert-Jan Roskam via Python-list wrote: >    This is more related to Postgresql than to Python, I

Python Launcher Pops Up When Py-based App Is Running (Mac)

2023-09-17 Thread James Greenham via Python-list
might need to be larger so clipped image is right size) options.initWidth = (options.clipwidth / options.scale) options.initHeight = (options.clipheight / options.scale) if options.width>options.initWidth: options.initWidth = options.width if options.height>options.initHeight: options.initHeight = options.height app = AppKit.NSApplication.sharedApplication() # create an app delegate delegate = AppDelegate.alloc().init() AppKit.NSApp().setDelegate_(delegate) # create a window rect = Foundation.NSMakeRect(0,0,100,100) win = AppKit.NSWindow.alloc() win.initWithContentRect_styleMask_backing_defer_ (rect, AppKit.NSBorderlessWindowMask, 2, 0) if options.debug: win.orderFrontRegardless() # create a webview object webview = WebKit.WebView.alloc() webview.initWithFrame_(rect) # turn off scrolling so the content is actually x wide and not x-15 webview.mainFrame().frameView().setAllowsScrolling_(objc.NO) webview.setPreferencesIdentifier_('webkit2png') webview.preferences().setLoadsImagesAutomatically_(not options.noimages) # add the webview to the window win.setContentView_(webview) # create a LoadDelegate loaddelegate = WebkitLoad.alloc().init() loaddelegate.options = options loaddelegate.urls = args webview.setFrameLoadDelegate_(loaddelegate) app.run() if __name__ == '__main__' : main() Best, James -- https://mail.python.org/mailman/listinfo/python-list

subprocess: TTYs and preexec_fn

2023-09-17 Thread Antonio Russo via Python-list
? I do plan to use threads and locks. 3. Does this seem widely useful enough to be worth trying to get into Python itself? It would be nice if this specific behavior, which probably has even more nuances than I already am aware of, were safely achievable out of the box. Best, Antonio -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP668 / pipx and "--editable" installs

2023-09-17 Thread Rimu Atkinson via Python-list
erstand if you try it for yourself. Google has many excellent resources, here is one https://www.freecodecamp.org/news/how-to-setup-virtual-environments-in-python/ Best of luck :) R -- https://mail.python.org/mailman/listinfo/python-list

Async options for flask app

2023-09-17 Thread Rimu Atkinson via Python-list
ypi.org/project/quart/ How well does gevent monkey-patch into a Flask app? A penny for your thoughts Thanks! R -- https://mail.python.org/mailman/listinfo/python-list

Re: Async options for flask app

2023-09-17 Thread Chris Angelico via Python-list
On Mon, 18 Sept 2023 at 13:45, Rimu Atkinson via Python-list wrote: > > Hi all, > > I'm writing a fediverse server app, similar to kbin https://kbin.pub/en > and lemmy https://join-lemmy.org/. It's like reddit except anyone can > run a server in the same way email wor

Re: PEP668 / pipx and "--editable" installs

2023-09-17 Thread Thomas Passin via Python-list
On 9/16/2023 7:57 PM, Rimu Atkinson via Python-list wrote: It is nothing bad about using virtual environments but also not about not using them. In my own work I haven't see a use case where I needed them. And I expect that some day I'll encounter a use case for it. This here is not

Re: Why doc call `__init__` as a method rather than function?

2023-09-17 Thread Chris Angelico via Python-list
On Mon, 18 Sept 2023 at 13:49, anthony.flury via Python-list wrote: > > > > To me __init__ is a method, but that is implemented internally as > function associated to a class > What is a method, if it is not a function associated with a class? ChrisA -- https://mail.python.or

Re: Why doc call `__init__` as a method rather than function?

2023-09-17 Thread Cameron Simpson via Python-list
ll it, the "bound method" knows that t is associated with `a` and puts that in as the first argument (usually named `self`). Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

Re: Confusing behavior of PYTHONWARNINGS

2023-09-18 Thread Roel Schroeven via Python-list
Op 16/09/2023 om 10:17 schreef Meowxiik via Python-list: Hello, For the third time I am trying to work with `PYTHONWARNINGS` filter, and for the third time I am having a terrible time. I'd like to seek your assistance, I have a few questions: **Question 1:** Does the environment var

Re: Why doc call `__init__` as a method rather than function?

2023-09-18 Thread Roel Schroeven via Python-list
Op 15/09/2023 om 15:05 schreef anthony.flury via Python-list: Like all of the other methods you shouldn't ever need to call them directly : these are called dunder methods and represent functions and features which are called by other operators. The only recommended way to c

Re: Why doc call `__init__` as a method rather than function?

2023-09-18 Thread scruel tao via Python-list
let's still remember: All methods are functions, but not every function is a method. Thanks again for helping, you guys are really nice! -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP668 / pipx and "--editable" installs

2023-09-18 Thread Mats Wichmann via Python-list
On 9/18/23 02:16, Peter J. Holzer via Python-list wrote: On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: I tried to install it via "pipx install -e .[develop]". It's pyproject.toml has a bug: A missing dependency "dateutil". But "dateutil" is

Re: PEP668 / pipx and "--editable" installs

2023-09-18 Thread Mats Wichmann via Python-list
On 9/18/23 12:56, c.buhtz--- via Python-list wrote: On 2023-09-18 10:16 "Peter J. Holzer via Python-list" wrote: On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: I tried to install it via "pipx install -e .[develop]". It's pyproject.toml has a

Re: PEP668 / pipx and "--editable" installs

2023-09-18 Thread Thomas Passin via Python-list
On 9/18/2023 2:56 PM, c.buhtz--- via Python-list wrote: On 2023-09-18 10:16 "Peter J. Holzer via Python-list" wrote: On 2023-09-15 14:15:23 +, c.buhtz--- via Python-list wrote: I tried to install it via "pipx install -e .[develop]". It's pyproject.toml has a

Python 3.12.0 rc3 (final release candidate I promise!) now available

2023-09-19 Thread Thomas Wouters via Python-list
andidate-released/33105#we-hope-you-enjoy-the-new-releases-9>We hope you enjoy the new releases! Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation <https://www.python.org/psf-landing/>. Your release team, Thomas Wouters Ned Deily Steve Dower Łukasz Langa -- Thomas Wouters -- https://mail.python.org/mailman/listinfo/python-list

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
implement business ideas - efficiently in both time and costs ::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 https://www.egenix.com/company/contact/ https://www.malemburg.com/ -- https://mail.python.org/mailman/listinfo/python-list

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 < python-list@python.org> 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
... :-) bye, -- piergiorgio -- https://mail.python.org/mailman/listinfo/python-list

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: > > r...@zedat.fu-berlin.de (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
didn’t add it to the path correctly, any help is greatly appreciated. Very Respectfully, Pau Vilchez -- https://mail.python.org/mailman/listinfo/python-list

The GIL and PyEval_RestoreThread

2023-09-26 Thread Peter Ebden via Python-list
ou received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future. -- https://mail.python.org/mailman/listinfo/python-list

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
/bin/python3 -c'import sys;print(sys.version)' 3.12.0rc3 (main, Sep 27 2023, 09:35:10) [GCC 13.2.1 20230801] user@host:~/devel $ -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

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
se it still relies on the system Python interpreter. Not sure what this really means, nor how to get python to be in my venv. -- https://mail.python.org/mailman/listinfo/python-list

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
rrymartell larrymartell 16 Sep 27 11:21 python3 -> > /usr/bin/python3 ... > Not sure what this really means, nor how to get python to be in my venv. WHy do you want python to be "in your venv"? -- https://mail.python.org/mailman/listinfo/python-list

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: python-list@python.org 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
Loris -- This signature is currently under constuction. -- https://mail.python.org/mailman/listinfo/python-list

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
our efforts by volunteering yourself or through organization contributions to the Python Software Foundation <https://www.python.org/psf-landing/>. Your release team, Thomas Wouters Ned Deily Steve Dower Łukasz Langa -- Thomas Wouters -- 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
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 python-list@python.org: > 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
reinstall it because I didn’t add it to the path correctly, any help is greatly appreciated.   Very Respectfully,   Pau Vilchez   -- https://mail.python.org/mailman/listinfo/python-list

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
.   -- https://mail.python.org/mailman/listinfo/python-list

RE: regarding installation of python version

2023-10-09 Thread Mike Dewhirst via Python-list
mya.G via Python-list" Date: 10/10/23 04:43 (GMT+10:00) To: python-list@python.org Subject: regarding installation of python version        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   v

Is a Python event polled or interrupt driven?

2023-10-12 Thread Chris Green via Python-list
callback, 1) -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

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
ation contributions to the Python Software Foundation. Regards from lovely Czechia, Your release team, Thomas Wouters Ned Deily Steve Dower Łukasz Langa -- Thomas Wouters -- https://mail.python.org/mailman/listinfo/python-list

Where I do ask for a new feature

2023-10-16 Thread Bongo Ferno via Python-list
te out the full object path every time. -- https://mail.python.org/mailman/listinfo/python-list

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
possible with Python and with that 'simple_websocket_server' package used? Thanks for any hints (or search keywords, or code samples)! Janis [*] https://pypi.org/project/simple-websocket-server/ -- https://mail.python.org/mailman/listinfo/python-list

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
hat inspects the annotations at runtime and makes whatever changes it likes, but that's part of what I described as "shenanigans". ChrisA -- https://mail.python.org/mailman/listinfo/python-list

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
ttributeError: print('first instantiation'); self.initialized = True and then changing that to >>> try: self.initialized:bool Karsten -- https://mail.python.org/mailman/listinfo/python-list

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
zed:bool But that's not equivalent code. You might just as well say that the ellipsis here suddenly changes the code: self.initialized self.initialized = ... These are completely different, and they behave differently. Both are valid, but they mean different things. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

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
if "i" was already used in another place.. -- https://mail.python.org/mailman/listinfo/python-list

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

<    17   18   19   20   21   22   23   24   25   26   >