Re: ssl server: how to disable client cert verfication?

2022-02-04 Thread Grant Edwards
On 2022-02-04, Christian Heimes wrote: > On 04/02/2022 19.24, Grant Edwards wrote: >> The problem is _getting_ the client certificate that was provided >> during the client/server handshake. That's trivial if the handshake >> was successful. The problem is obtaining the cl

Re: ssl server: how to disable client cert verfication?

2022-02-04 Thread Grant Edwards
On 2022-02-04, Kushal Kumaran wrote: >> It's a troubleshooting utility for displaying a client's certificate. >> >>> Which kinds of client certificates do you want to permit >> >> All of them. Anything that's parsable as an X509 certificate no matter >> how "invalid" it is. >> > > Does `openssl

Re: ssl server: how to disable client cert verfication?

2022-02-04 Thread Grant Edwards
On 2022-02-04, Chris Angelico wrote: > On Fri, 4 Feb 2022 at 09:37, Grant Edwards wrote: >> I've looked through the ssl.Context documentation multiple times, and >> haven't been able to spot any option or flag that disables client >> certificate validation or allows

Re: ssl server: how to disable client cert verfication?

2022-02-03 Thread Grant Edwards
On 2022-02-03, Barry wrote: > >> [...] I just want to require that the client provide a certificate >> and then print it out using print(connection.getpeercert()) > > I am not near the pc with the code on. But in outline you provide a > ssl context that returns true for the validation of the cert

Re: ssl server: how to disable client cert verfication?

2022-02-03 Thread Grant Edwards
On 2022-02-03, Kushal Kumaran wrote: > On Thu, Feb 03 2022 at 10:57:56 AM, Grant Edwards > wrote: >> I've got a small ssl server app. I want to require a certificate from >> the client, so I'm using a context with >> >> context.verify_mode = ssl.CERT_REQUIRED >

Re: ssl: why wrap newly accept()ed connections?

2022-02-03 Thread Grant Edwards
On 2022-02-03, Kushal Kumaran wrote: > >> [...] >> However, example server code I've found does not wrap the newly >> accepted connection. I've checked, and newsocket is already an >> object. [...] >> >> What is the purpose of wrapping newsocket? > > That section is talking about using an

ssl: why wrap newly accept()ed connections?

2022-02-03 Thread Grant Edwards
According to the docs, when you accept() an ssl connection, you need to wrap the new connection: https://docs.python.org/3/library/ssl.html?highlight=ssl#ssl-sockets When a client connects, you’ll call accept() on the socket to get the new socket from the other end, and use the context’s

ssl server: how to disable client cert verfication?

2022-02-03 Thread Grant Edwards
I've got a small ssl server app. I want to require a certificate from the client, so I'm using a context with context.verify_mode = ssl.CERT_REQUIRED But, I want all certificates accepted. How do I disable client certificate verification? -- Grant --

Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Grant Edwards
On 2022-01-17, Sina Mobasheri wrote: > Yes sure, actually I can continue working and developing with python > without this feature no problem but it's something that I like and > I'm just curious about it, about why Python doesn't implement this > kind of installation You talk about "Python"

Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Grant Edwards
On 2022-01-17, Dennis Lee Bieber wrote: > On Mon, 17 Jan 2022 08:07:07 -0800 (PST), Grant Edwards > declaimed the following: > >>On 2022-01-17, Sina Mobasheri wrote: >>> Java offers download JDK... >>> [...] >>> My question is why Python hasn't option

Re: Why There Is No Python Compressed Archive or Binaries ?

2022-01-17 Thread Grant Edwards
On 2022-01-17, Sina Mobasheri wrote: > Java offers download JDK... > [...] > My question is why Python hasn't option for downloading as > Compressed Archive ? Isn't that what the installers are? -- Grant -- https://mail.python.org/mailman/listinfo/python-list

[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-25 Thread Grant Edwards
Grant Edwards added the comment: Yes, passing the mangle_from value to BytesGenerator seems like the safest fix. It's unfortunate that BytesGenerator defaults to doing "the wrong thing" in the absence of a policy argument, but there might be code that depends on it. I've never

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-21 Thread Grant Edwards
On 2021-11-21, Greg Ewing wrote: > On 21/11/21 2:18 pm, Grant Edwards wrote: >> My recollection is that it was quite common back in the days before FP >> hardware was "a thing" on small computers. CPM and DOS compilers for >> various languages often gave the

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Grant Edwards
On 2021-11-21, Chris Angelico wrote: >> I think there have been attempts to use a decimal representation in some >> accounting packages or database applications that allow any decimal numbers >> to be faithfully represented and used in calculations. Generally this is not >> a very efficient

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Grant Edwards
On 2021-11-20, Ben Bacarisse wrote: > You seem to be agreeing with me. It's the floating point part that is > the issue, not the base itself. No, it's the base. Floating point can't represent 3/10 _because_ it's base 2 floating point. Floating point in base 10 doesn't have any problem

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Grant Edwards
On 2021-11-20, Chris Angelico wrote: > But you learn that it isn't the same as 1/3. That's my point. You > already understand that it is *impossible* to write out 1/3 in > decimal. Is it such a stretch to discover that you cannot write 3/10 > in binary? For many people, it seems to be. There

Re: import question

2021-11-18 Thread Grant Edwards
On 2021-11-17, lucas wrote: > are there any other ways to import a module or package other then > the "import" or "from...import..." statements? i ask because i'm > allowing programming on my web2py website and i don't want any > accessing packages like os or sys. Safely allowing people to

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

2021-10-29 Thread Grant Edwards
On 2021-10-29, Shaozhong SHI wrote: > Python script works well, but seems to stop running at a certain point when > handling very large dataset. > > Can anyone shed light on this? No. Nobody can help you with the amount of information you have provided. -- Grant --

Re: walrus with a twist :+= or ...

2021-10-28 Thread Grant Edwards
On 2021-10-28, Avi Gross via Python-list wrote: > I see := makes ≔ which is just a longer equals sign. On my screen it's an assignment operator that looks like := only a bit smaller. > Not sure this mailing list allows this stuff, so if your mailer does > not show it, never mind. Everything

Re: Request to advise error for python.

2021-10-21 Thread Grant Edwards
On 2021-10-21, Mats Wichmann wrote: > There are some nuances. If you are on a Linux system, Python is a > system program and you don't want to try to install into system > locations (you'll run into permission problems anyway), so trying a user > install is useful. So: > > pip install

Re: Big jump in version

2021-10-05 Thread Grant Edwards
On 2021-10-04, Cecil Westerhof via Python-list wrote: > When I run: > pip3 list --outdated > > I get: > Package Version Latest Type > --- -- - > cryptography 3.4.8 35.0.0 wheel > > The jump from 3 to 35 seems a bit excessive to me. Or is it correct?

Re: Posts from gmane no longer allowed?

2021-09-27 Thread Grant Edwards
On 2021-09-27, 황병희 wrote: > Grant Edwards writes: > >> I've been reading (and posting to) this list for many years by >> pointing an NNTP client >> at news://gmane.comp.python.general. Sometime in the past few days posts >> started >> being refus

Re: Posts from gmane no longer allowed?

2021-09-27 Thread Grant Edwards
On 2021-09-27, Ned Deily wrote: > I have been in touch with the administrator of gmane. It appears that > posting from python-list to gmane has been deliberately disabled, at > least temporarily, with cause. I'll see if we can resolve the problem. Thanks. Though I've figured out a solution

Re: Why does SMTP.send_message() do from mangling?

2021-09-26 Thread Grant Edwards
On 2021-09-27, Grant Edwards wrote: > Why does SMTP.send_message(msg) do from mangling even though msg's > policy has mangle_from_ set to False? I've concluded this is a bug in SMTP.send_message() https://bugs.python.org/issue45299 -- Grant -- https://mail.python.org/mailman/li

[issue45299] SMTP.send_message() does from mangling when it should not

2021-09-26 Thread Grant Edwards
New submission from Grant Edwards : SMTP.send_message() does from mangling even when the message's policy has that disabled. The problem is in the send_messsage() function shown below: 912 def send_message(self, msg, from_addr=None, to_addrs=None, 913

Re: Bug in email.generator.BytesGenerator() [was: Why does SMTP.send_message() do from mangling?]

2021-09-26 Thread Grant Edwards
On 2021-09-27, Grant Edwards wrote: > According to > https://docs.python.org/3/library/email.generator.html#email.generator.BytesGenerator > the default from mangling behavior is _supposed_ to obey the message > policy if no policy or mangle_from_ value was > provi

Bug in email.generator.BytesGenerator() [was: Why does SMTP.send_message() do from mangling?]

2021-09-26 Thread Grant Edwards
On 2021-09-27, Grant Edwards wrote: > Why does SMTP.send_message(msg) do from mangling even though msg's > policy has mangle_from_ set to False? The msg policy is > email.policy.SMTP which has mangle_from_ disabled. > > One might expect that SMTP.send_message(msg) would use either

Why does SMTP.send_message() do from mangling?

2021-09-26 Thread Grant Edwards
Why does SMTP.send_message(msg) do from mangling even though msg's policy has mangle_from_ set to False? The msg policy is email.policy.SMTP which has mangle_from_ disabled. One might expect that SMTP.send_message(msg) would use either msg's policy or email.policy.SMTP to send the message, but it

Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-27, Grant Edwards wrote: >>From the list's POV, gmane.io is a "normal" email subscriber who just > happens to archive all the articles it receives. I should never have > mentioned that gmane.io does NNTP -- it just seems to have confused

Re: Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Mats Wichmann wrote: > On 9/26/21 10:38, 2qdxy4rzwzuui...@potatochowder.com wrote: >> On 2021-09-26 at 11:21:08 -0500, > >> No. I use mbsync (formerly isync) to synchronize my gmail account with >> a local maildir folder, and while mbsync does send the app password >> (over TLS)

Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Ethan Furman wrote: > On 9/26/21 10:34 AM, Grant Edwards wrote: > > On 2021-09-26, Ethan Furman wrote: > >>> I am unaware of a change in the newsgroup <--> mailing list policy, >>> and other newsgroup posts were coming through last week (it's be

Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Grant Edwards wrote: > >> 2 Every message from the OP in this 'thread' (not others) has broken the >> thread, which indicates a wider problem/change. > > And I apologize for that. It's because I'm reading the list using an > NNTP client (slrn) con

Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, dn via Python-list wrote: > On 27/09/2021 06.34, Grant Edwards wrote: >> On 2021-09-26, Ethan Furman wrote: >>> On 9/26/21 9:21 AM, Grant Edwards wrote: >>>> On 2021-09-26, Chris Angelico wrote: >>> >>>>> I'm not

Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Ethan Furman wrote: > On 9/26/21 9:21 AM, Grant Edwards wrote: > > On 2021-09-26, Chris Angelico wrote: > > >> I'm not sure whether the policy change happened on python-list, or at > >> gmane. From the look of the error message you got, it may h

Subject: Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Chris Angelico wrote: Thanks for the tips on registering an application for oauth2 credentials. It sounds like I should be able to do that if I practice my hoop-jumping a bit more. > (But I'd still recommend an app password. Much easier.) Yes, I really should go with the 2FA and

Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-26, Chris Angelico wrote: > Not sure what the significance of the "application" is - Google has > different services for where you're using it with your own domain, but > that shouldn't be relevant. If you want to use Gmail with mutt, you > should be able to do that, regardless. (Or

Re: Posts from gmane no longer allowed?

2021-09-26 Thread Grant Edwards
On 2021-09-25, Grant Edwards wrote: > I've been reading (and posting to) this list for many years by > pointing an NNTP client at > news://gmane.comp.python.general. Sometime in the past few days > posts started being refused: > > You have tried posting to gmane.comp.pyt

Posts from gmane no longer allowed?

2021-09-25 Thread Grant Edwards
I've been reading (and posting to) this list for many years by pointing an NNTP client at news://gmane.comp.python.general. Sometime in the past few days posts started being refused: You have tried posting to gmane.comp.python.general, which is a unidirectional mailing list. Gmane can

Re: on floating-point numbers

2021-09-12 Thread Grant Edwards
On 2021-09-11, Chris Angelico wrote: > Once you accept that "perfectly representable numbers" aren't > necessarily the ones you expect them to be, 64-bit floats become > adequate for a huge number of tasks. Even 32-bit floats are pretty > reliable for most tasks, although I suspect that there's

Re: on writing a while loop for rolling two dice

2021-09-08 Thread Grant Edwards
On 2021-09-08, Dennis Lee Bieber wrote: > I spent close to 20 years (80s-90s) maintaining the /output/ of such > a preprocessor. Ouch. I hope it paid well. ;) Back when I did a lot of TeX/LaTeX stuff on VMS, I used to make occasional fixes and add (very minor) features to one of the dvi

Re: on writing a while loop for rolling two dice

2021-09-08 Thread Grant Edwards
On 2021-09-08, charles hottel wrote: > So what do yoy think or feel about a language like RATFOR (Rational > FORTRAN) which was implemented as macros? The RATFOR implementations I've seen weren't done using macros. It was a preprocessor, yes. But it generates code for the various structured

Re: on writing a while loop for rolling two dice

2021-09-08 Thread Grant Edwards
On 2021-09-08, charles hottel wrote: > So what do yoy think or feel about a language like RATFOR (Rational > FORTRAN) which was implemented as macros? Should they instead have > simply adapted themselves to FORTRAN? That's an interesting question. If the langauge is complete, well-defined,

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Grant Edwards
On 2021-09-06, Stefan Ram wrote: > "Avi Gross" writes: >> In languages like C/C++ there are people who make up macros like: >>#define INDEFINITELY_LOOP while (true) >>Or something like that and then allow the preprocessor to replace >>INDEFINITELY_LOOP with valid C code. > > Those usually are

Re: on floating-point numbers

2021-09-06 Thread Grant Edwards
On 2021-09-05, Peter J. Holzer wrote: > On 2021-09-05 03:38:55 +1200, Greg Ewing wrote: >> If 7.23 were exactly representable, you would have got >> 723/1000. >> >> Contrast this with something that *is* exactly representable: >> >> >>> 7.875.as_integer_ratio() >> (63, 8) >> >> and observe

Re: Problem with python

2021-09-06 Thread Grant Edwards
On 2021-09-04, Hope Rouselle wrote: > Igor Korot writes: > >> Hi, >> Will this syntax work in python 2? > > If you say > > print(something) > > it works in both. But it doesn't always work the _same_ in both. If you're expecting some particular output, then one or the other might not won't

Re: Problem with python

2021-09-04 Thread Grant Edwards
On 2021-09-04, Peter J. Holzer wrote: > On 2021-09-04 14:29:47 -0500, Igor Korot wrote: >> Will this syntax work in python 2? > > Yes. It's just a redundant pair of parentheses. Not really. With the parens, it doesn't produce the same results in 2.x unless you import the print function from the

Re: on floating-point numbers

2021-09-02 Thread Grant Edwards
On 2021-09-02, Hope Rouselle wrote: > Suppose these numbers are prices in dollar, never going beyond cents. > Would it be safe to multiply each one of them by 100 and therefore work > with cents only? The _practical_ answer is that no, it's not safe to use floating point when doing normal

Re: urgent

2021-08-31 Thread Grant Edwards
On 2021-08-29, Hari wrote: > i was download ur python software but it is like boring user > interface for me like young student to learn ,can u have any > updates? Check the calendar, it must be September again... Well, almost. -- Grant Edwards grant.b.edwardsY

Re: some problems for an introductory python test

2021-08-12 Thread Grant Edwards
On 2021-08-12, MRAB wrote: > >> Windows never had filesystems that supported metadata like OS/2 and >> MacOS did. The registry was an ugly hack that attempted (very poorly) >> to make up for that lack of metadata. >> > FYI, NTFS does support Alternate Data Streams. That is interesting -- and it

Re: some problems for an introductory python test

2021-08-12 Thread Grant Edwards
On 2021-08-12, Hope Rouselle wrote: >> OS/2 had all kinds of amazing features (for its time). [...] Plus, >> it had this fancy concept of "extended attributes"; on older >> systems (like MS-DOS's "FAT" family), a file might be Read-Only, >> Hidden, a System file, or needing to be Archived, and

Re: creating raw AWS log event

2021-06-24 Thread Grant Edwards
>> encoded b'eJwrSS0uUchNLS5OTE8FAB8fBMY=' >>> str(encoded) "b'eJwrSS0uUchNLS5OTE8FAB8fBMY='" Ah, that's not what you want, is it? >>> encoded.decode('ascii') 'eJwrSS0uUchNLS5OTE8FAB8fBMY=' That's better. -- Grant Edwards grant.b.edwardsYow! I think my career at is ruined! gmail.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Php vs Python gui (tkinter...) for small remote database app

2021-06-15 Thread Grant Edwards
ity issues. -- Grant Edwards grant.b.edwardsYow! I'd like some JUNK at FOOD ... and then I want to gmail.combe ALONE -- -- https://mail.python.org/mailman/listinfo/python-list

curses apps on MS Windows?

2021-06-14 Thread Grant Edwards
There's been a surprising amount of discussion lately about using curses libraries on Windows OS. I'm surprised by this, because I don't think I've ever even seen a Windows curses application. Are there examples of popular curses applications for Windows? Does windows have a terminfo/termcap

Re: Replacement for Mailman

2021-06-08 Thread Grant Edwards
On 2021-06-08, Paul Bryan wrote: > How about Mailman 3.x on Python 3.x? According to https://www.gnu.org/software/mailman/requirements.html mailman 3.x still requires Python 2.7 for the archiver and the web UI. -- Grant Edwards grant.b.edwardsYow! Do you guys know

Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-02 Thread Grant Edwards
On 2021-06-03, wrote: >> -Original Message- >> From: Grant Edwards >> Sent: Monday, May 31, 2021 11:18 AM >> To: python-list@python.org >> Subject: Re: How to debug python + curses? [was: RE: Applying > winpdb_reborn] >> >> On 2021-05-31,

Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread Grant Edwards
On 2021-05-31, Dennis Lee Bieber wrote: > On Mon, 31 May 2021 08:07:21 +1000, Cameron Simpson > declaimed the following: > > >>Open another terminal, note its terminal device with the "tty" command. >>Start your programme like this: >> >>python .. 2>/dev/tty-of-the-other-termina > >

Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread Grant Edwards
On 2021-05-30, Alan Gauld via Python-list wrote: > On 30/05/2021 18:26, pjfarl...@earthlink.net wrote: >> I tried winpdb-reborn some time last year on my Win10 system (python 3.8.3 >> at that time), but could not figure out how to use it to debug a python >> script that uses the curses module. >

Re: imaplib: is this really so unwieldy?

2021-05-26 Thread Grant Edwards
On 2021-05-25, Dennis Lee Bieber wrote: >>Oh ok, it seemed to be fine. Would it be the right way to do it with >>sys.exit()? Having to import another library just to end a program >>might not be ideal. > > I've never had to use sys. for exit... I would have sworn you used to have to

Re: imaplib: is this really so unwieldy?

2021-05-26 Thread Grant Edwards
On 2021-05-25, Dennis Lee Bieber wrote: > On Tue, 25 May 2021 19:21:39 +0200, hw declaimed the > following: > > >> >>Oh ok, it seemed to be fine. Would it be the right way to do it with >>sys.exit()? Having to import another library just to end a program >>might not be ideal. > > I've

Re: imaplib: is this really so unwieldy?

2021-05-25 Thread Grant Edwards
On 2021-05-25, MRAB wrote: > On 2021-05-25 16:41, Dennis Lee Bieber wrote: >> In Python 3, strings are UNICODE, using 1, 2, or 4 bytes PER >> CHARACTER (I don't recall if there is a 3-byte version). If your >> input bytes are all 7-bit ASCII, then they map directly to a 1-byte >> per character

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-25, Michael F. Stemper wrote: > On 24/05/2021 23.08, hw wrote: >> On 5/25/21 12:37 AM, Greg Ewing wrote: >> >> Are all names references?  When I pass a name as a parameter to a >> function, does the object the name is referring to, when altered by the >> function, still appear

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-25, Greg Ewing wrote: > On 25/05/21 5:56 pm, Avi Gross wrote: >> Var = read in something from a file and make some structure like a data.frame >> Var = remove some columns from the above thing pointed to by Var >> Var = make some new calculated columns ditto >> Var = remove some rows

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-24, Alan Gauld via Python-list wrote: > On 24/05/2021 19:48, Grant Edwards wrote: > >>> Traceback ( File "", line 1 >>> if = 1.234 >>>^ >>> SyntaxError: invalid syntax >> >> I must admit it might be n

Re: imaplib: is this really so unwieldy?

2021-05-25 Thread Grant Edwards
On 2021-05-25, hw wrote: > I'm about to do stuff with emails on an IMAP server and wrote a program > using imaplib My recollection of using imaplib a few years ago is that yes, it is unweildy, oddly low-level, and rather un-Pythonic (excuse my presumption in declaring what is and isn't

Re: learning python ...

2021-05-24 Thread Grant Edwards
On 2021-05-24, Dennis Lee Bieber wrote: > Attempting to rebind a keyword in Python will produce an error... > if = 1.234 > Traceback ( File "", line 1 > if = 1.234 >^ > SyntaxError: invalid syntax I must admit it might be nice if the compiler told you _why_ the syntax is

Re: Unexpected Inheritance Problem

2021-05-21 Thread Grant Edwards
On 2021-05-20, Terry Reedy wrote: > On 5/20/2021 2:53 PM, Grant Edwards wrote: >> On 2021-05-20, Mats Wichmann wrote: >> >>> many fonts squish together repeated underscores in the display so it's >>> hard to see this visually, >> >> Is it just

Re: Unexpected Inheritance Problem

2021-05-20 Thread Grant Edwards
On 2021-05-20, Mats Wichmann wrote: > On 5/20/21 4:54 AM, Richard Damon wrote: >> On 5/20/21 3:24 AM, Peter Otten wrote: >>> On 20/05/2021 06:00, Richard Damon wrote: >>> class GedcomHead(Gedcom0Tag): """GEDCOM 0 HEAD tag""" def ___init___(self, *, parent): >>> >>> An

Re: for installation of pygames.

2021-05-08 Thread Grant Edwards
On 2021-05-07, wrote: >I'm a user of python , so I'm requesting you to give me permission to run >pygames. I hereby grant you prermistion to run pygames. Are you asking about pygame? You don't need anybody's permission to install and use pygame: https://www.pygame.org/

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

2021-05-06 Thread Grant Edwards
On 2021-05-06, Chris Green wrote: > Grant Edwards wrote: >> On 2021-05-06, Chris Green wrote: >> > Grant Edwards wrote: >> > >> >> Pointing a newsreader at news.gmane.io allows one to participate in >> >> the mailing list just fine without us

Re: Bloody rubbish

2021-05-06 Thread Grant Edwards
On 2021-05-06, Michael Torrie wrote: > On 5/5/21 8:58 PM, Joe Pfeiffer wrote: >> Mr Flibble writes: >> >>> Python is slow and significant whitespace is patently absurd. >> >> Why am I not surprised to learn your "fast" implementation turns out to >> be something other than python? > > And it's

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

2021-05-06 Thread Grant Edwards
On 2021-05-06, Chris Green wrote: > Grant Edwards wrote: > >> Pointing a newsreader at news.gmane.io allows one to participate in >> the mailing list just fine without using Usenet. >> > ??? Surely that *is* using Usenet, at least you're using NNTP which > i

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

2021-05-06 Thread Grant Edwards
On 2021-05-06, Dennis Lee Bieber wrote: > Granted, I did move from pure comp.lang.python to > gmane.comp.python.general when the spam became too much to keep > track of. (Now if I could only figure out why the beaglebone group > stopped accepting replies via gmane -- I keep having to remember

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

2021-05-06 Thread Grant Edwards
On 2021-05-06, Chris Angelico wrote: > On Thu, May 6, 2021 at 10:43 AM Avi Gross via Python-list > wrote: >> >> Chris, >> >> Given some notice, what stops anyone from joining the mailing list before >> there is a divorce between the forums? > > Nothing! Nothing at all. That is, if you're talking

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

2021-05-06 Thread Grant Edwards
On 2021-05-06, Richard Damon wrote: > If the idea is just to provide a NNTP accessible version of the mailing > list, than perhaps rather than a comp.* group, putting it on gmane would > be a viable option, that avoids some of the Usenet issues. The list _is_ on gmane and has been since

Re: Are there Python modules that allow a program to write to the screen?

2021-04-26 Thread Grant Edwards
On 2021-04-26, Stephen Tucker wrote: > I have old software written in GWBASIC that I use to plot diagrams on the > screen. Pygame is probably the closest thing to what you're describing. If you want to produce professional looking plots from data, then matplotlib or one of the Gnuplot wrappers

Re: Current thinking on required options

2021-04-19 Thread Grant Edwards
On 2021-04-19, 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://docs.python.org/3/library/argparse.html#required >> >> advises against required options and

Re: Comparing text strings

2021-04-13 Thread Grant Edwards
On 2021-04-12, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > I don't know whether or how Slackware handles "compound" package names > (e.g., python-flask), but at some point, you're going to have to pull > apart (aka---gasp--parse), the package names to come up

Re: Issues in starting Python application

2021-04-01 Thread Grant Edwards
On 2021-04-01, Mahira Pamnani wrote: > I have been trying hard to install Python on my PC since a long time. The > application gets installed but, for reasons unknown, it doesn't start. > It keeps asking to repair, modify or uninstall the application. That's because you're re-running the

Re: Ann: New Python curses book

2021-03-30 Thread Grant Edwards
On 2021-03-30, Alan Gauld via Python-list wrote: > On 30/03/2021 17:14, Grant Edwards wrote: > >> Is the kindle format readable via a web browser pointed at >> read.amazon.com (AKA "Kindle Cloud Reader)? > > It seems to be, I downloaded the free sample and coul

Re: Ann: New Python curses book

2021-03-30 Thread Grant Edwards
On 2021-03-30, William Ray Wing via Python-list wrote: > I’ve ordered the book (physical volume). It will fulfill a need I’ve > had for some time. Unfortunately, it is only available in the UK > store, so the shipping cost by far outweighs the book’s cost. Hope > for other’s sake, it migrates

Re: Ann: New Python curses book

2021-03-30 Thread Grant Edwards
On 2021-03-30, Alan Gauld via Python-list wrote: > I've just published, in Kindle and paperback formats, > my book on "Programming curses with Python". > > https://www.amazon.co.uk/dp/B091B85B77/ > > (It should be available in most other Amazon stores too) Cool. Is the kindle format readable

Re: python documentation

2021-03-27 Thread Grant Edwards
On 2021-03-27, MRAB wrote: > On 2021-03-27 17:03, pyt...@blackward.eu wrote: >> You write, that "Everyone claims that it's easier to move to some other >> language rather than to migrate to Python 3". >> >> Thank you for sharing this remarkable information! > > You've quoted him partially and

Re: .title() - annoying mistake

2021-03-22 Thread Grant Edwards
On 2021-03-22, Chris Angelico wrote: > On Tue, Mar 23, 2021 at 1:18 AM Grant Edwards > wrote: > >> I guess it depends on what you mean by "character". In my mind, the >> first character of string s is s[1], and I would then expect that >> >> s.title()

Re: .title() - annoying mistake

2021-03-22 Thread Grant Edwards
On 2021-03-21, MRAB wrote: IMO, the doc is wrong. >> Hmm, maybe it's different in 3.10, but the docs I'm seeing look fine. >> But maybe there's a better way to word it for both of them. > > Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 > bit (AMD64)] on win32 > Type

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
On 2021-03-21, Chris Angelico wrote: > On Mon, Mar 22, 2021 at 2:16 AM Robert Latest via Python-list > wrote: > >> I wonder if .title() properly capitalizes titles in any language. It doesn't >> in >> English (nor does it purport to), so it begs the question why it is there in >> the first

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
On 2021-03-20, Alan Bawden wrote: > Sibylle Koczian writes: > >Am 20.03.2021 um 09:34 schrieb Alan Bawden: >> >> When you write that code to capitalize your book titles, you should be >> calling .title() rather than .upper() if you are doing it right. >> >But that's

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
On 2021-03-20, Robert Latest via Python-list wrote: > Mats Wichmann wrote: >> The problem is that there isn't a standard for title case, > > The problem is that we owe the very existence of the .title() method to too > much weed being smoked during Python development. It makes specific >

[issue43584] Doc description of str.title() upper case vs. title case.

2021-03-21 Thread Grant Edwards
New submission from Grant Edwards : The documentation for str.title() states that the first character in each world is converted to upper case. That is not correct for recent versions of Python. The first character in each word is converted to title case. Title and upper may be the same

Re: .title() - annoying mistake

2021-03-19 Thread Grant Edwards
become "L'Homme". It's language-dependant. In English, certain words are not capitalized in titles unless they're the first word in the title (short articles and prepositions), and .title() doesn't get that right either: >>> "the man in the grey flannel suit".title()

Re: .title() - annoying mistake

2021-03-19 Thread Grant Edwards
e OP is reporting. Issue 12737 is about Unicode combining marks. The OP's problem is related to the apostrophe used to form a possessive. -- Grant Edwards grant.b.edwardsYow! Civilization is fun! at

Re: Please don't feed the trolls

2021-03-08 Thread Grant Edwards
On 2021-03-08, D'Arcy Cain wrote: > On 2021-03-06 4:24 p.m., Terry Reedy wrote: >> Trolling, among other things, is fishing with a moving line, especially >> with a revolving lure, as from a moving boat.  A troll, among other >> things, is that method or the lure used. > > You are confusing

Re: Choosable dependency

2021-03-07 Thread Grant Edwards
On 2021-03-07, Manfred Lotz wrote: > On Sat, 6 Mar 2021 15:40:41 - (UTC) > Grant Edwards wrote: > >> On 2021-03-06, Manfred Lotz wrote: >> > Let us say I have a package which reads a TOML file. >> > >> > I want to give the user of my package th

Re: Choosable dependency

2021-03-07 Thread Grant Edwards
On 2021-03-06, Manfred Lotz wrote: > Let us say I have a package which reads a TOML file. > > I want to give the user of my package the choice to decide if he wants > to use the toml, tomlkit or rtoml package. Why would the user choose one over the other? Does the user get different

Re: Why assert is not a function?

2021-03-04 Thread Grant Edwards
On 2021-03-03, Chris Angelico wrote: > On Thu, Mar 4, 2021 at 1:40 AM Grant Edwards > wrote: > >> I thought the entire point of asser being a keyword was so that if you >> disable asserts then they go away completely: the arguments aren't >> even evaluated. >

Re: Why assert is not a function?

2021-03-03 Thread Grant Edwards
On 2021-03-02, Chris Angelico wrote: > On Wed, Mar 3, 2021 at 10:22 AM Mirko via > Python-list> wrote: > >> In production code you don't want any asserts, but logging. Having >> "assert" being a function would make it much harder to get rid of >> it in production code. > > Really? > > if

Re: weirdness with list()

2021-03-01 Thread Grant Edwards
On 2021-03-01, Greg Ewing wrote: > On 28/02/21 1:17 pm, Cameron Simpson wrote: >> [its length in bytes] is presented via the object's __len__ method, > >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. > > You're misusing __len__ here. If an object is

Re: Tkinter needed as a legacy version 2.7 imports the module...

2021-02-27 Thread Grant Edwards
On 2021-02-26, MRAB wrote: > On 2021-02-26 22:23, Kevin M. Wilson via Python-list wrote: > >> Is there a site where I might/can download a version of Tkinter for Python >> 2.7? > > Tkinter as already included in Python 2.7. Not always, it depends on how he installed Python 2.7. That said, MRAB

Re: editor recommendations?

2021-02-26 Thread Grant Edwards
ty much only use emacs for editing text... -- Grant Edwards grant.b.edwardsYow! Hmmm ... a CRIPPLED at ACCOUNTANT with a FALAFEL gmail.comsandwich is HIT by a

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-20 Thread Grant Edwards
On 2021-02-20, Dan Stromberg wrote: > Convert to a str. > Convert to a list of ints, one for each digit > Add 7 mod 10, for each digit in the list I'd probably subtract 3 (mod 10), so as to more obviously match the stated requirement. > Convert to a list of single-character str's > Catenate

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-20 Thread Grant Edwards
On 2021-02-20, MRAB wrote: > Have a look at the 'translate' method of the 'str' class. That's very clever, but being too clever on homework assignemnts doesn't always get a good grade. If they've just studied iteration, the modulus operator, and int/str conversions, then I'd avise using the

<    1   2   3   4   5   6   7   8   9   10   >