Re: Line continuation and comments

2023-02-22 Thread Paul Bryan
Adding to this, there should be no reason now in recent versions of Python to ever use line continuation. Black goes so far as to state "backslashes are bad and should never be used": https://black.readthedocs.io/en/stable/the_black_code_style/future_style.html#using-backslashes-for-with-statement

Re: Typing Number, PyCharm

2023-02-06 Thread Paul Bryan
On Mon, 2023-02-06 at 12:11 +, Weatherby,Gerard wrote: > On the one hand, it is a well-known type, so it should be > recognizable to users of an API. On the other hand, Number is > entirely abstract, so it doesn’t provide useful type checking for the > implementation; I had to add # noinspecti

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Paul Bryan
On Thu, 2023-01-19 at 09:47 +1300, dn via Python-list wrote: > The longer an identifier, the more it 'pushes' code over to the right > or  > to expand over multiple screen-lines. Some thoughts on this are > behind > PEP-008 philosophies, eg line-limit. I sympathize with this issue. I've pushed t

Re: Improvement to imports, what is a better way ?

2023-01-18 Thread Paul Bryan
I would suggest allowing each module to define its own imports, don't import what a module doesn't consume, keep them simple, avoid devising a common namespace for each, and let tools like isort/black work out how to order/express them in source files. On Wed, 2023-01-18 at 10:43 -0800, Dan Kolis

Re: set.add() doesn't replace equal element

2022-12-30 Thread Paul Bryan
er durable immutable attribute, I would be inclined to make that the dictionary key, and store the DHCP object as the value. On Fri, Dec 30 2022 at 04:27:56 PM -0600, Ian Pilcher wrote: On 12/30/22 15:47, Paul Bryan wrote: What kind of elements are being added to the set? Can you show repr

Re: set.add() doesn't replace equal element

2022-12-30 Thread Paul Bryan
What kind of elements are being added to the set? Can you show reproducible sample code? On Fri, Dec 30 2022 at 03:41:19 PM -0600, Ian Pilcher wrote: I just discovered this behavior, which is problematic for my particular use. Is there a different set API (or operator) that can be used to a

String to Float, without introducing errors

2022-12-18 Thread Paul St George
fully aware of what goes on under the bonnet.  >> On 17 Dec 2022, at 16:54:05 EST 2022, Thomas Passin wrote: On 12/17/2022 3:45 PM, Paul St George wrote: > Thanks to all! > It was the rounding rounding error that I needed to avoid (as Peter J. Holzer > suggested). The

String to Float, without introducing errors

2022-12-18 Thread Paul St George
fully aware of what goes on under the bonnet. Here is a picture: https://paulstgeorge.com/newton/cyclography.html Thanks, Paul >> On 17 Dec 2022, at 16:54:05 EST 2022, Thomas Passin wrote: On 12/17/2022 3:45 PM, Paul St George wrote: > Thanks to all! > It was the rounding roundin

Re: String to Float, without introducing errors

2022-12-17 Thread Paul St George
+ (7 * 0.1) + (2 * 0.01) + (7 * 0.001) Now I do not need to! > On 17 Dec 2022, at 13:11, Alan Gauld wrote: > > On 17/12/2022 11:51, Paul St George wrote: >> I have a large/long array of numbers in an external file. The numbers look >> like this: >> >> -6455

String to Float, without introducing errors

2022-12-17 Thread Paul St George
I have a large/long array of numbers in an external file. The numbers look like this: -64550.727 -64511.489 -64393.637 -64196.763 -63920.2 -63563.037 -63124.156 -62602.254 -61995.895 -61303.548 -60523.651 -59654.66 ... When I bring the numbers into my code, they are Strings. To use the numbers i

Re: Are these good ideas?

2022-11-14 Thread Paul Bryan
Seems like this is a use case for context managers and/or context variables: https://docs.python.org/3/library/contextlib.html https://docs.python.org/3/library/contextvars.html On Mon, 2022-11-14 at 17:14 +, Stephen Tucker wrote: > Hi, > > I have two related issues I'd like comments on. >

Re: python 3.10 vs breakage

2022-08-26 Thread Paul Bryan
lity.  [1] https://github.com/kliment/Printrun/blob/master/README.md On Fri, 2022-08-26 at 17:36 -0400, gene heskett wrote: > On 8/26/22 16:54, Paul Bryan wrote: > > Why can't you build linuxcnc with it? Why has Octoprint quit > > talking to > > 3d printers? Why won'

Re: python 3.10 vs breakage

2022-08-26 Thread Paul Bryan
Why can't you build linuxcnc with it? Why has Octoprint quit talking to 3d printers? Why won't pronterface buy it? Why can't you find a 4.0.7 version of wxPython? Why is it sitting there staring at you? What is bookworm? What is bullseye? On Fri, 2022-08-26 at 16:37 -0400, gene heskett wrote: > Gr

Re: subprocess.popen how wait complete open process

2022-08-21 Thread Paul Bryan
Sometimes, launching subprocesses can seem like punishment. I don't think there is a standard cross-platform way to know when a launched asynchronous process is "fully open" (i.e. fully initialized, accepting user input). On Sun, 2022-08-21 at 02:11 -0700, simone zambonardi wrote: > Hi, I am runni

Re: Information about Dying kernel

2022-08-07 Thread Paul Bryan
Have you tried turning it off and back on again? On Sun, 2022-08-07 at 18:59 +0200, nhlanhlah198506 wrote: > Greetings What can I do if my computer said my kernels has died Thank > you Sent from my Galaxy -- https://mail.python.org/mailman/listinfo/python-list

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-03 Thread Paul Bryan
I wouldn't say any particular Linux distribution is appreciably better for Python development than another. I would suggest using a version of a Linux distribution that supports a recent Python release (e.g. 3.9 or 3.10). On Thu, 2022-08-04 at 10:22 +0800, Turritopsis Dohrnii Teo En Ming wrote: >

Re: Subtract n months from datetime

2022-06-20 Thread Paul Bryan
min(value.day, calendar.monthrange(year, month)[1])   return date(year, month, day) Paul On Tue, 2022-06-21 at 05:29 +0100, Paulo da Silva wrote: > Hi! > > I implemented a part of a script to subtract n months from datetime. > Basically I subtracted n%12 from year and n//12 from the mo

Re: F-string usage in a print()

2022-05-24 Thread Paul Bryan
Try something like: print(f"Year = {years}, Future value = {future_value}") On Tue, 2022-05-24 at 21:14 +, Kevin M. Wilson via Python-list wrote: > future_value = 0 > for i in range(years): > # for i in range(months): >    future_value += monthly_investment >    future_value = round(future_va

Re: Non-deterministic set ordering

2022-05-15 Thread Paul Bryan
This may explain it: https://stackoverflow.com/questions/27522626/hash-function-in-python-3-3-returns-different-results-between-sessions On Mon, 2022-05-16 at 04:20 +0100, Rob Cliffe via Python-list wrote: > > > On 16/05/2022 04:13, Dan Stromberg wrote: > > > > On Sun, May 15, 2022 at 8:01 PM R

Re: .0 in name

2022-05-13 Thread Paul Bryan
hat is valid identifier syntax. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: .0 in name

2022-05-13 Thread Paul Bryan
s.html#identifiers Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Why does datetime.timedelta only have the attributes 'days' and 'seconds'?

2022-04-14 Thread Paul Bryan
I think because minutes and hours can easily be composed by multiplying seconds. days is separate because you cannot compose days from seconds; leap seconds are applied to days at various times, due to irregularities in the Earth's rotation. On Thu, 2022-04-14 at 15:38 +0200, Loris Bennett wrote:

Re: for convenience

2022-03-24 Thread Paul St George
is super interesting. You have my permission, and please feel free to contact me offline if you want to ask anything. Yes, I had noticed the tandem with @Chris. I think I needed both! I already have a folder on my Mac called ‘Cameron’. Perhaps I now need an additional folder. Then I can ask my question about whether Python grows to be more like its programmers, or do programmers learn to think Pythonically? — Paul St George -- https://mail.python.org/mailman/listinfo/python-list

Re: for convenience

2022-03-22 Thread Paul St George
On 21/03/2022 17.47, Avi Gross wrote: > So, I ask Paul what other language than python he has used before, just out > of curiosity. The other language I have used (and often) is Processing. Before that, and a long time ago, Lingo. — Paul -- https://mail.python.org/mailman/li

Re: for convenience

2022-03-22 Thread Paul St George
On 21/03/2022 18.02, Cameron Simpson wrote: > On 21Mar2022 22:12, Paul St George wrote: > >When I am writing code, I often do things like this: > > > >context = bpy.context # convenience > > > >then whenever I need bpy.context, I only need to write cont

Re: for convenience

2022-03-22 Thread Paul St George
On 21/03/2022 18.04, dn wrote: > On 22/03/2022 10.17, Chris Angelico wrote: > > On Tue, 22 Mar 2022 at 08:13, Paul St George > <https://mail.python.org/mailman/listinfo/python-list>> wrote: > >> > >> > >> When I am writing code, I often do t

Re: for convenience

2022-03-21 Thread Paul Bryan
No, nor did I suggest that you did. `context` is presumably an attribute in the `bpy` module, for which you are creating a `context` attribute in your module. On Mon, 2022-03-21 at 22:31 +0100, Paul St George wrote: > Hi, > I do not (knowingly) have a module called ‘context'. > &

Re: for convenience

2022-03-21 Thread Paul St George
Hi, I do not (knowingly) have a module called ‘context'. > On 21 Mar 2022, at 22:24, Paul Bryan wrote: > > Assuming `bpy` is a module, you're creating a new attribute in your module, > `context`, that contains a reference to the same object that is referenced in >

Re: for convenience

2022-03-21 Thread Paul Bryan
Assuming `bpy` is a module, you're creating a new attribute in your module, `context`, that contains a reference to the same object that is referenced in the `context` attribute in the `bpy` module. On Mon, 2022-03-21 at 22:12 +0100, Paul St George wrote: > > When I am writing code,

for convenience

2022-03-21 Thread Paul St George
When I am writing code, I often do things like this: context = bpy.context # convenience then whenever I need bpy.context, I only need to write context Here’s my question: When I forget to use the convenient shorter form why is bpy.context not interpreted as bpy.bpy.context? — Paul St

Re: A Newspaper for Python Mailing Lists

2022-01-11 Thread Paul Bryan
Subscribed. 🙂️ On Wed, 2022-01-12 at 00:35 +0400, Abdur-Rahmaan Janhangeer wrote: > Added RSS: > > 2.0 unless later versions have some advantages: > > https://pyherald.com/rss.xml > > Kind Regards, > > Abdur-Rahmaan Janhangeer > about | blog  > github > Mauritius > -- https://mail.python.or

Re: A Newspaper for Python Mailing Lists

2022-01-08 Thread Paul Bryan
+1 to RSS. On Sun, 2022-01-09 at 10:28 +0400, Abdur-Rahmaan Janhangeer wrote: > Well yes XD though LWN covers Py topics well when it wants > > > 1. Yes sure, did not expect RSS interest > 2. Excuse my blunder, will do! > > On Sun, 9 Jan 2022, 01:15 Peter J. Holzer, wrote: > > > On 2021-12-26

Re: Custom designed alarm clock

2021-12-18 Thread Paul Bryan
Suggested reading: https://pypi.org/project/python-for-android/ https://play.google.com/store/apps/details?id=org.qpython.qpy3 https://www.androidauthority.com/an-introduction-to-python-on-android-759685/ https://data-flair.training/blogs/android-app-using-python/ On Sat, 2021-12-18 at 18:36 -050

Re: Isn't TypeError built in?

2021-12-12 Thread Paul Bryan
Yes, TypeError is built in. The only thing I can think of is that something has deleted `TypeError` from `__builtins__`? It would be interesting to see what's in `__builtins__` when `__del__` is called. On Mon, 2021-12-13 at 12:22 +1100, Mike Dewhirst via Python-list wrote: > Obviously something i

Re: Urllib.request vs. Requests.get

2021-12-07 Thread Paul Bryan
pyter-server/";, method="GET", headers={"User-Agent": "Workaround/1.0"}, ) res = urllib.request.urlopen(req) Paul On Tue, 2021-12-07 at 12:35 +0100, Julius Hamilton wrote: > Hey, > > I am currently working on a simple program which scrapes t

Re: Advantages of Default Factory in Dataclasses

2021-11-21 Thread Paul Bryan
On Sun, 2021-11-21 at 21:51 +0400, Abdur-Rahmaan Janhangeer wrote: > > On Tue, Nov 16, 2021 at 7:17 PM Paul Bryan wrote: > > On Tue, 2021-11-16 at 17:04 +0400, Abdur-Rahmaan Janhangeer wrote: > > > > > A simple question: why do we need field(default_fac

Re: Advantages of Default Factory in Dataclasses

2021-11-16 Thread Paul Bryan
mples: dicts, lists, other dataclasses. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Python script seems to stop running when handling very large dataset

2021-10-29 Thread Paul Bryan
With so little information provided, not much light will be shed. When it stops running, are there any errors? How is the dataset being processed? How large is the dataset? How large a dataset can be successfully processed? What libraries are being used? What version of Python are you using? On wha

Re: Request for argmax(list) and argmin(list)

2021-08-31 Thread Paul Bryan
Why not: >>> l = [1, 3, 5, 9, 2, 7] >>> l.index(max(l)) 3 >>> l.index(min(l)) 0 On Tue, 2021-08-31 at 21:25 -0700, ABCCDE921 wrote: > I dont want to import numpy > > argmax(list) >    returns index of (left most) max element > >  argmin(list) >    returns index of (left most) min element --

Re: src layout for projects seems not so popular

2021-08-31 Thread Paul Bryan
An interesting thread in PyPA (with links to other threads) discussing src layout: https://github.com/pypa/packaging.python.org/issues/320 On Tue, 2021-08-31 at 10:53 +0400, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > Just an observation. Out of Github's trending repos for > Python for

Re: port to PDOS (especially mainframe)

2021-08-20 Thread Paul Edwards
On Saturday, April 17, 2021 at 11:12:38 PM UTC+10, Paul Edwards wrote: > https://github.com/s390guy/SATK/commits/master/README > > and I can see that on 2014-08-13 he cited 3.3 as an > explicit requirement. Note that the work I was doing to make a C90-compliant version of Pytho

Re: a simple question

2021-07-26 Thread Paul Bryan
It would help to know the error message you get every time. On Mon, 2021-07-26 at 22:19 +, Glenn Wilson via Python-list wrote: > I recently downloaded the latest version of python, 3.9.6. Everything > works except, the turtle module. I get an error message every time , > I use basic commands l

Re: Where to keep local Python modules?

2021-07-23 Thread Paul Bryan
On my Arch Linux box, slightly different path, but still in .local/bin: pbryan@dynamo:~$ python3 Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/lib/python39.zip', '/u

Re: Replacement for Mailman

2021-06-08 Thread Paul Bryan
How about Mailman 3.x on Python 3.x? On Tue, 2021-06-08 at 15:08 -0400, D'Arcy Cain wrote: > Given that mailman still runs under 2.7 and that's being deprecated, > does > anyone have a suggestion for a replacement? > -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Paul Bryan
I do not believe my proposal has reached—or will reach—consensus. It seems there are some who still value the linkage between the two, and the S/N ratio is indeed low enough it doesn't warrant changing from the status quo. Thanks everyone for the consideration and discussion.  Paul On Thu,

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-06 Thread Paul Bryan
I will also add that it can get confusing when someone replies to a newsgroup posting that was originally suppressed to the mailing list. This has happened as recently as today. On Thu, 2021-05-06 at 14:36 +, Grant Edwards wrote: > On 2021-05-06, Chris Angelico wrote: > > On Thu, May 6, 2021

Re: Proposal: Disconnect comp.lang.python from python-list

2021-05-05 Thread Paul Bryan
What's involved in moderating c.l.p? Would there be volunteers willing to do so? On Thu, 2021-05-06 at 00:43 +, Jon Ribbens via Python-list wrote: > On 2021-05-06, Chris Angelico wrote: > > On Thu, May 6, 2021 at 10:32 AM Paul Bryan wrote: > > > > > > G

Proposal: Disconnect comp.lang.python from python-list

2021-05-05 Thread Paul Bryan
Given the ease of spoofing sender addresses, and its propensity for use in anonymous spamming and trolling (thanks python-list-owner for staying on top of that!), I propose to disconnect comp.lang.python from the python-list mailing list. Both would then operate independently. Paul -- https

Re: Not found in the documentation

2021-04-26 Thread Paul Bryan
I agree. I would be useful for it to be documented elsewhere, especially in docstrings. I wonder if this is/was a conscious decision to keep Python runtime smaller? Paul On Mon, 2021-04-26 at 18:24 -0700, elas tica wrote: > Le mardi 27 avril 2021 à 01:44:04 UTC+2, Paul Bryan a écrit : >

Re: Not found in the documentation

2021-04-26 Thread Paul Bryan
after a >decimal point, are not shown. > * A sign is shown only when the number is negative. Paul On Mon, 2021-04-26 at 16:24 -0700, elas tica wrote: > > Python documentation doesn't seem to mention anywhere what is the str > value of an int: is it right?  the same for f

Re: Current thinking on required options

2021-04-19 Thread Paul Bryan
Calling them options—when they're required—seems like a problem. 🙂 On Mon, 2021-04-19 at 09:04 -0700, Dan Stromberg wrote: > On Mon, Apr 19, 2021 at 2:55 AM Loris Bennett > > wrote: > > > However, the options -o, -u, and -g are required, not optional. > > > > The documentation > > > >   https:

Re: port to PDOS (especially mainframe)

2021-04-17 Thread Paul Edwards
E and I can see that on 2014-08-13 he cited 3.3 as an explicit requirement. BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-04-17 Thread Paul Edwards
important flat file which PDOS-generic will access to provide a FAT facility to any applications running under PDOS-generic. Those applications will need to be specific to PDOS-generic and they may well be a.out/ELF/COFF - I haven't reached that point yet. I'm still preparing the assembler, I can't do what I want without that. :-) BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-04-17 Thread Paul Edwards
Note that Java (and Python for that matter) are available for later versions of z/OS, but as far as I am aware, they are not available for the free MVS that hobbyists use, ie MVS 3.8J, and it's definitely not available for the environment I'm actually interested in, which is PD

Re: port to PDOS (especially mainframe)

2021-04-16 Thread Paul Edwards
port all those features. It only supports C90-compliant applications. Meanwhile, 35,000 lines (or more) of lovingly handcrafted Python code are going to waste. :-) BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-04-16 Thread Paul Edwards
et security fixes anymore. Ok, thanks. I'll consider doing that as well. BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-04-16 Thread Paul Edwards
On Saturday, April 17, 2021 at 5:13:31 AM UTC+10, Paul Rubin wrote: > Paul Edwards writes: > > I have succeeded in producing a Python 3.3 executable despite being > > built with a C library that only supports C90. > It seems to me that you might have an easier time porting M

Re: port to PDOS (especially mainframe)

2021-04-16 Thread Paul Edwards
On Wednesday, April 14, 2021 at 8:35:59 PM UTC+10, Paul Edwards wrote: > ImportError: importlib requires posix or nt > but I don't know what it needs to satisfy that. > > It's a bit strange that it can only be posix or nt when VMS is supported in > 3.3 too. The r

Re: port to PDOS (especially mainframe)

2021-04-14 Thread Paul Edwards
On Thursday, April 15, 2021 at 4:32:51 AM UTC+10, Alan Gauld wrote: > On 14/04/2021 11:35, Paul Edwards wrote: > > I have succeeded in producing a Python 3.3 executable > ... > > However, the executable doesn't work yet. > Late to this party but how big is the assembl

Re: Website

2021-04-14 Thread Paul Bryan
Yes. On Wed, 2021-04-14 at 15:41 +0200, Rainyis wrote: > Hello, > I am Sergio Llorente, and I want to create a web about python. I > will publish apps, scripts.. made by python. I will like to put > python in > the domain. The domain will be like all-about-python.com but in > Spanish( > todosobrep

Re: port to PDOS (especially mainframe)

2021-04-14 Thread Paul Edwards
nt" _bootstrap.py but I don't know what it needs to satisfy that. It's a bit strange that it can only be posix or nt when VMS is supported in 3.3 too. BFN. Paul. Index: Modules/main.c === RCS file: c:\cvsroot/pyt

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread Paul Bryan
outsourcing a part of your service network infrastructure to Cloudflare. Paul  On Sat, 2021-04-10 at 13:35 -0500, Christian Seberino wrote: > > > > a) your reverse proxy must be colocated with the service it fronts > > on the same machine; > > b) your network infrastructur

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread Paul Bryan
There is absolutely nothing wrong with building your own reverse proxy in front of your own service, as long as you control both. This constitutes a tiered network/application architecture, and it's a common practice. There's no man in the middle; there's no imposter; its all "you".  If your proxy

Re: Problem in uninstalling python

2021-04-09 Thread Paul Bryan
Please describe your problem in detail. Paul On Fri, 2021-04-09 at 11:03 +0530, arishmallick...@gmail.com wrote: >    I am encountering problem in uninstalling python. Please help me > in this. > > > >    Sent from [1]Mail for Windows 10 > > > > Reference

Re: Code Formatter Questions

2021-03-28 Thread Paul Bryan
s there anyway to make any of these formatters do this? Formatters are typically strongly opinionated (autopep8 being an exception), so I think you'll be going against the grain by trying to make exceptions. I suggest accepting their opinions (pick the formatter that most closely aligns with y

Re: port to PDOS (especially mainframe)

2021-03-24 Thread Paul Edwards
hon requires C99 since 3.6, Exactly why I go back to the oldest version I can! BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
sockets? Does it have WinSock? Something > else? Nothing at all? (sorry for the delay in replying) Nothing at all. Just what you can find in ISO/IEC 9899:1990. BFN. Paul. -- https://mail.python.org/mailman/listinfo/python-list

Re: port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
On Tuesday, March 23, 2021 at 10:19:46 PM UTC+11, Paul Edwards wrote: > Objects/exceptions.c: ADD_ERRNO(ConnectionRefusedError, ECONNREFUSED); > > Those errno are non-standard (non-C90) and I assume > other platforms can't cope with that either. But I can't > se

Re: port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
On Tuesday, March 23, 2021 at 10:19:46 PM UTC+11, Paul Edwards wrote: > My latest problem is this: > > Objects/exceptions.c: ADD_ERRNO(ConnectionRefusedError, ECONNREFUSED); Sorry, I forgot to include the actual error: ../Objects/exceptions.c:2538: `ECONNREFUSED' undeclared (fir

Re: port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
#x27;t see how other platforms are circumventing that problem. (ie I did a grep -R of the whole source code). I could define a stack of constants in pyconfig.h to allow the compile to go through, but I don't see anyone else doing the same thing. Is there some other way of circumventing the problem? Thanks. Paul. -- https://mail.python.org/mailman/listinfo/python-list

port to PDOS (especially mainframe)

2021-03-23 Thread Paul Edwards
n PDOS/3X0. Well, maybe it can all be done on Windows. I need to see what asma is capable of. Thanks. Paul. # Produce Windows executables # links with PDPCLIB created by makefile.msv CC=gccwin CFLAGS=-O0 LD=ldwin LDFLAGS= AS=aswin AR=arwin STRIP=stripwin COPTS=-S $(CFLAGS) -fno-common -ansi -I. -

Re: .title() - annoying mistake

2021-03-21 Thread Paul Bryan
ing to be baked into the simplistic `str.title` method. As demonstrated by the OP, it will almost certainly come up short, even in the simplest use case. I suggest the best approach then is to find (or write) a module that addresses the specific use case, not try to address such shortcomings in `

Re: .title() - annoying mistake

2021-03-19 Thread Paul Bryan
es form word boundaries, which may not be the desired result The link above includes a workaround for apostrophes. Paul On Fri, 2021-03-19 at 18:43 +0400, Abdur-Rahmaan Janhangeer wrote: > Greetings list, > > See this: > > > > > "Python's usage".title() > &q

Re: SSL certificate issue

2021-03-18 Thread Paul Bryan
In order for us to help, we'll need to know the details of your problem. On Thu, 2021-03-18 at 10:58 +, Sagar, Neha wrote: > Hi, > > I am facing SSL certificate issue working with python. Can you help > me on this. > > Thanks, > Neha > > DXC Technology India Private Limited - Unit 13, Block

Re: Apriori Algorithm

2021-03-06 Thread Paul Bryan
Google tells me this: https://github.com/tommyod/Efficient-Apriori On Sat, 2021-03-06 at 18:46 -0800, sarang shah wrote: > I want to make apriori algorithm from start. Anybody have any > reference file? -- https://mail.python.org/mailman/listinfo/python-list

Re: program python

2021-03-04 Thread Paul Bryan
I don't see a Python program in that link. Are you asking how to extract data from a CSV? A good start will be to look into the csv.reader function and csv.DictReader class. Paul On Thu, 2021-03-04 at 12:36 -0800, alberto wrote: > Hi I'm tring to write a program with python to eva

Re: Fw: Scipy installation

2021-02-18 Thread Paul Bryan
Can you describe what you tried, and how it failed? Pasting error messages and such would be helpful. On Thu, 2021-02-18 at 17:53 +, Mustafa Althabit via Python-list wrote: >   > >    Hi,I am trying to install Scipy but it failed, I have python > 3.9. I need your assistance with that.  > Than

Re: New Python implementation

2021-02-11 Thread Paul Bryan
uch a statement? > Thanks for the sentiment but I am not relying on luck. By your conduct so far, I think you will also not be relying on the goodwill of this community. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Mutable defaults

2021-02-10 Thread Paul Bryan
Also -1 on changing the existing default behavior. +1 to an opt-in late-bound solution. On Thu, 2021-02-11 at 10:29 +1100, Chris Angelico wrote: > On Thu, Feb 11, 2021 at 10:17 AM J. Pic wrote: > > > > > Most of us know of the perils of mutable default values. > > > > And those who don't pay th

Re: Python cannot count apparently

2021-02-07 Thread Paul Bryan
That's not the only problem with the code. There's a missing close- paren and a reference to "string" which I presume was meant to be "myString". Suggest OP create a reproducible case, and paste the code and output verbatim. On Sun, 2021-02-07 at 20:40 +0100, Karsten Hilbert wrote: > Am Sun, Feb

Re: IDE tools to debug in Python?

2021-01-27 Thread Paul Bryan via Python-list
My experience with IntelliJ (related to PyCharm): it scans all source files in the project, compiles them, graphs all dependencies, compiles those (if necessary) or inspects their class bytecode, and so on to build a full graph in memory to support showing errors in real time (highlighting in sourc

c bindings with non-python thread callback while python exits

2021-01-26 Thread Paul Grinberg
hangs because the main thread is waiting for the event pthread to join, but that thread is stuck in a callback waiting for the GIL. What is the right way to prevent this problem from happening? Thank you in advance, Paul. P.S. I am running on Linux: ubuntu 18.04 with python 3.6.9, also reproduced

Re: dict.get(key, default) evaluates default even if key exists

2020-12-16 Thread Paul Bryan
Maybe this will help: >>> def get(key, default): ... print("entering get") ... print(f"{key=} {default=}") ... print("exiting get") ... >>> def generate_default(): ... print("entering generate_default") ... print("exiting generate_default") ... return 1 ... >>> get("a", generate_defa

Re: dict.get(key, default) evaluates default even if key exists

2020-12-16 Thread Paul Bryan
et returns the value of an > existing key. As am I. > What am I missing? You'll need to tell me at this point. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: dict.get(key, default) evaluates default even if key exists

2020-12-16 Thread Paul Bryan
get("a", generate_a_default_value()) key='a' default=1 >>> The generate_a_default_value function was called before the call to get. It was called so it could produce a value that is actually passed in as an argument to the get function. Paul -- https://mail.python.org/mailman/listinfo/python-list

Re: Function returns old value

2020-12-11 Thread Paul Bryan
Sorry, actually, if you do not answer yes, will always return None, not the first answer as I suggested. On Fri, 2020-12-11 at 18:55 -0700, Joe Pfeiffer wrote: > Bischoop writes: > > > I've function asking question and comparing it, if is not matching > > 'yes' > > it does call itself to ask que

Re: Function returns old value

2020-12-11 Thread Paul Bryan
It won't return until the inner call to question (and it's not using the return value on inner call). Eventually, (and not until you answer yes) it will return the first answer. On Fri, 2020-12-11 at 18:55 -0700, Joe Pfeiffer wrote: > Bischoop writes: > > > I've function asking question and comp

Re: Property type hints?

2020-12-09 Thread Paul Bryan
Thanks for the comprehensive response, dn! I guess I'm influenced by data classes here, where the object's attribute type hints are represented by class variable annotations. On Thu, 2020-12-10 at 07:49 +1300, dn via Python-list wrote: > On 09/12/2020 13:17, Paul Bryan wrote: >

Property type hints?

2020-12-08 Thread Paul Bryan
Would this be a reasonably correct way to annotate a property with a type hint? >>> class Foo: ... bar: int ... @property ... def bar(self): ... return 1 ... >>> foo = Foo() >>> import typing >>> typing.get_type_hints(foo) {'bar': } I could also decorate the property method r

Re: help(list[int]) → TypeError

2020-12-04 Thread Paul Bryan
Thanks, will bring it to the dev list. On Fri, 2020-12-04 at 07:07 -0800, Julio Di Egidio wrote: > On Thursday, 3 December 2020 at 19:28:19 UTC+1, Paul Bryan wrote: > > Is this the correct behavior? > > > > Python 3.9.0 (default, Oct 7 2020, 23:09:01) > > [GCC 10.2.

Re: list[type, type, ...] ?!

2020-12-03 Thread Paul Bryan
Thanks, Greg. Would it make sense for list's __class_getitem__ (GenericAlias?) to perform similar checking as typing._SpecialGenericAlias (nparams)? On Fri, 2020-12-04 at 12:15 +1300, Greg Ewing wrote: > On 3/12/20 7:37 pm, Paul Bryan wrote: > > > > > list[int, int] > &g

help(list[int]) → TypeError

2020-12-03 Thread Paul Bryan
Is this the correct behavior? Python 3.9.0 (default, Oct 7 2020, 23:09:01) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> help(list[int]) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.9/_sitebuiltins.py", line

list[type, type, ...] ?!

2020-12-03 Thread Paul Bryan
nse to me in Python 3.9: I can use the built-in generic alias in list in this manner, apparently successfully: >>> list[int, int] list[int, int] In fact, it appears I can specify an indeterminate number of types. Can someone explain what this construct means? I suspect this will fail to be interp

Re: Python extension module with callbacks into Python

2020-10-29 Thread Paul Grinberg
> > Can you please clarify where/when I should call PyEval_InitThreads()? Is > > this in the main python thread before any pthread callbacks are generated? > > If so, should this be done only once? > Do it in your module init. That function is safe to be called multiple time. > I decided to do

Re: Python extension module with callbacks into Python

2020-10-28 Thread Paul Grinberg
> Try calling PyEval_InitThreads() to force the python threading to be all > setup. Can you please clarify where/when I should call PyEval_InitThreads()? Is this in the main python thread before any pthread callbacks are generated? If so, should this be done only once? -- https://mail.python.

Re: Python extension module with callbacks into Python

2020-10-28 Thread Paul Grinberg
> > I am running into unpredictable behavior with my Python extension module > > that wraps around a C++ library that starts a new pthread and, after doing > > some work, generates callbacks back into the caller. I've greatly > > simplified this to a simplistic example which still demonstrates t

Python extension module with callbacks into Python

2020-10-27 Thread Paul Grinberg
As full disclosure, I posted this question on StackOverflow as well, but it looks like questions with [Python] [Extension-Module] tags are not frequently answered. The link to my question there is https://stackoverflow.com/questions/64559322/python-extension-module-with-callbacks-into-python I

Re: [RELEASE] Python 3.9.0a6 is now available for testing

2020-04-29 Thread Paul Moore
at something isn't disambiguating this the same way as the 3.8 parser did (I'd say it's the "new parser" but Robin showed the same behaviour with "-X oldparser" which makes me wonder... Anyway, that's what I think is going on. I'll leave it to the p

Re: pip UX Studies - help improve the usability of pip

2020-03-09 Thread Paul Moore
We've had some questions as to whether this survey is legitimate. I can confirm it is (speaking as a pip core developer). The link to a page describing this work is https://pyfound.blogspot.com/2019/12/moss-czi-support-pip.html, if anyone wants to find out more. Paul Moore On Sat, 7 Mar 20

Re: Possible Addition to Python Language: Marked Sub-condition

2020-03-08 Thread Paul Moore
. Starting with a proposed language change before you've explored the existing options isn't likely to be the best approach (and would likely have meant you could resolve your issue without needing to bring it to python-ideas at all). Paul -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >