Re: backslash in triple quoted string

2025-05-12 Thread Ethan Furman via Python-list
Chris and Oleg (sp?), please control your tempers; your latter posts added nothing useful to the conversation. (Apologies for the late reply, I was out of town.) -- ~Ethan~ Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: FileNotFoundError thrown due to file name in file, rather than file itself

2024-11-14 Thread Ethan Furman via Python-list
On 11/13/24 23:03, Left Right via Python-list wrote: >> On any Unix system this is untrue. Rotating a log file is quite simple: > > I realized I posted this without cc'ing the list: > http://jdebp.info/FGA/do-not-use-logrotate.html . > > The link above gives a more detailed description of why lo

Re: Help with Streaming and Chunk Processing for Large JSON Data (60 GB) from Kenna API

2024-10-02 Thread Ethan Furman via Python-list
This thread is derailing. Please consider it closed. -- ~Ethan~ Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: ListAdmin: Is list/archive working correctly?

2024-08-31 Thread Ethan Furman via Python-list
On 8/30/24 15:28, dn via Python-list wrote: > The OP was @Gilmeh Serda (from an invalid email address). That appears in the email thread > > @Stefan Ram has had two contributions quoted, but no such original-message has appeared in the thread. I can't speak about the archives, but I can say th

Re: bring back nntp library to python3

2024-08-14 Thread Ethan Furman via Python-list
On 8/14/24 15:56, Alan Gauld via Python-list wrote: > Lots of people care but the ability to influence these > decisions seems to have been removed far from the > general python user community. Python has moved from > the BDFL/Bazaar to the Committee/Cathedral. Probably > an inevitable consequenc

Re: bring back nntp library to python3

2024-08-14 Thread Ethan Furman via Python-list
On 8/14/24 15:32, Left Right via Python-list wrote: > I think the right word for this is "delusional". But people get > offended when other people use the right words. Instead they want a > grotesque round-about way of saying the same thing... > > So, the grotesque round-about way of saying this,

Re: troglodytes

2024-08-14 Thread Ethan Furman via Python-list
On 8/14/24 15:19, Left Right via Python-list wrote: >On 8/14/24 13:26, geodandw via Python-list wrote: >> Why do you have to belittle other people? > Who says I have to? I like to! I like to see people driven by all > sorts of low and reprehensible motives being punished for it. I don't > know i

Re: bring back nntp library to python3

2024-08-14 Thread Ethan Furman via Python-list
On 8/14/24 13:14, Keith Thompson via Python-list wrote: > The rationale for removing nntplib and other modules from the default > installation is explained in PEP 0594 . > > """ > The nntplib tests have been the cause of additional work in the recent > past. Pyt

Re: Couldn't install numpy on Python 2.7

2024-06-13 Thread Ethan Furman via Python-list
Hey, everyone! I believe the original question has been answered, and tempers seem to be flaring in sub-threads, so let's call this thread done and move on to other interesting topics. Thank you for your support! -- ~Ethan~ Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: Already Subscribed and Confirmed, But ....

2024-04-03 Thread Ethan Furman via Python-list
On 4/3/24 07:15, WordWeaver Evangelist via Python-list wrote: > Hello. I already subscribed to this list several days ago. In fact, I did it two times, and > I received the email with the confirmation link in it, which I clicked on and was confirmed. > > Despite this fact, each time that I try

Re: Variable scope inside and outside functions - global statement being overridden by assignation unless preceded by reference

2024-03-06 Thread Ethan Furman via Python-list
On 3/6/24 08:28, Jacob Kruger via Python-list wrote: > C:\temp\py_try>python > Python 3.11.7 (tags/v3.11.7:fa7a6f2, Dec 4 2023, 19:24:49) [MSC v.1937 64 bit (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> from scoping2 import * And it becomes c

Re: Can u help me?

2024-03-05 Thread Ethan Furman via Python-list
On 3/5/24 16:49, MRAB via Python-list wrote: > On 2024-03-06 00:24, Ethan Furman via Python-list wrote: >> On 3/5/24 16:06, Chano Fucks via Python-list wrote: >> >>> [image: image.png] >> >> The image is of MS-Windows with the python installation window

Re: Can u help me?

2024-03-05 Thread Ethan Furman via Python-list
On 3/5/24 16:06, Chano Fucks via Python-list wrote: [image: image.png] The image is of MS-Windows with the python installation window of "Repair Successful". Hopefully somebody better at explaining that problem can take it from here... -- ~Ethan~ -- https://mail.python.org/mailman/listinfo

CoC Warning [was: What is Install-Paths-To in WHEEL file?]

2024-01-02 Thread Ethan Furman via Python-list
On 12/29/23 05:02, Left Right via Python-list wrote: Wow. That place turned out to be the toxic pit I didn't expect. It's a shame that a public discussion of public goods was entrusted to a bunch of gatekeepers with no sense of responsibility for the thing they keep the keys to. Personal atta

[dead thread] Re: What is Install-Paths-To in WHEEL file?

2024-01-02 Thread Ethan Furman via Python-list
This thread is no longer being useful, and is now closed. -- ~Ethan~ Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: Which more Pythonic - self.__class__ or type(self)?

2023-03-03 Thread Ethan Furman
On 3/3/23 03:32, Chris Angelico wrote: > On Fri, 3 Mar 2023 at 20:44, Alan Gauld wrote: >> On 02/03/2023 20:54, Ian Pilcher wrote: >>> Seems like an FAQ, and I've found a few things on StackOverflow that >>> discuss the technical differences in edge cases, but I haven't found >>> anything that ta

Re: Python 3.10 Fizzbuzz

2023-02-27 Thread Ethan Furman
On 2/27/23 12:20, rbowman wrote: > "By using Black, you agree to cede control over minutiae of hand- > formatting. In return, Black gives you speed, determinism, and freedom > from pycodestyle nagging about formatting. You will save time and mental > energy for more important matters." > > Someho

Hen Hanna & google groups

2023-02-27 Thread Ethan Furman
Greetings, all! As has been stated, Hen Hanna is posting through Google Groups, over which the Python List moderators have zero control. The only thing we can do, and which has now been done, is not allow those posts in to the Python List. -- ~Ethan~ Moderator -- https://mail.python.org/mailm

Re: Not receiving posts

2023-02-23 Thread Ethan Furman
On 2/23/23 12:29, Jim Byrnes wrote: > I have been reading the python-list for some time now. At first via gemane and since it's demise via a subscription. > Recently I noticed that I have not received any emails for quite sometime. > > I tried resubscribing but still have received no emails from

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Ethan Furman
This thread has run its course and seems to now be generating more heat than light. It is now closed (at least on the Python List side). Thank you everyone for your participation and understanding. -- ~Ethan~ Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: The Zen of D.E.K.

2023-01-13 Thread Ethan Furman
On 1/13/23 09:06, Stefan Ram wrote: >"Beautiful is better than ugly." - The Zen of Python > >This says nothing. You have to sacrifice something that >really has /value/! > >"[A]esthetics are more important than efficiency." - Donald E. Knuth [okay, falling for the troll bait] Th

Re: To clarify how Python handles two equal objects

2023-01-10 Thread Ethan Furman
On 1/10/23 12:03, Jen Kris via Python-list wrote: > I am writing a spot speedup in assembly language for a short but computation-intensive Python > loop, and I discovered something about Python array handling that I would like to clarify. > But on the next iteration we assign arr1 to something

Re: Possible re bug when using ".*"

2022-12-28 Thread Ethan Furman
On 12/28/22 11:07, MRAB wrote: On 2022-12-28 18:42, Alexander Richert - NOAA Affiliate via Python-list wrote:   In a couple recent versions of Python (including 3.8 and 3.10), the following code: import re print(re.sub(".*", "replacement", "pattern")) yields the output "replacementreplacement".

Friendly Reminder

2022-12-20 Thread Ethan Furman
Greetings, all! I know our stress levels can be higher than normal around the holidays, but let's please be patient with each other. Both conversations and debates will be smoother if we assume other posters are asking/debating in good faith (at least, until proven otherwise). Happy Pythoning

Re: mailbox misbehavior with non-ASCII

2022-07-29 Thread Ethan Furman
On 7/29/22 16:24, Peter Pearson wrote: > ... but if the apostrophe in "a'b" is replaced with a > RIGHT SINGLE QUOTATION MARK, the returned h is of type > "email.header.Header", and seems to contain inscrutable garbage. > > I'd think an exception would be the right answer. > > Is this worth a bug

Async SIG post

2022-04-28 Thread Ethan Furman
Anybody interested in asynchronous programming may want to check out async-...@python.org as it has an interesting post about ASGI and PEPs 3156 and . Sign up at https://mail.python.org/mailman3/lists/async-sig.python.org/ and see the archive at https://mail.python.org/archiv

Re: Style for docstring

2022-04-22 Thread Ethan Furman
On 4/22/22 12:36, Michael F. Stemper wrote:   Tells caller whether or not a permutation is even.   Determines if a permutation is even. (Alternative is that it's odd.)   Returns True if permutation is even, False if it is odd. Third option. -- ~Ethan~ -- https://mail.python.org/mailman/l

Re: Enums and nested classes

2022-04-21 Thread Ethan Furman
On 4/21/22 15:00, Greg Ewing wrote: On 20/04/22 10:57 pm, Sam Ezeh wrote: Has anyone here used or attempted to use a nested class inside an enum? If so, how did you find it? (what did you expect to happen and did your expectations align with resulting behaviour etc.) That's a pretty open-ende

Re: Proposal: Syntax for attribute initialisation in __init__ methods

2022-04-15 Thread Ethan Furman
On 4/15/22 04:19, Sam Ezeh wrote: Elsewhere, the idea of supporting new syntax to automatically initialise attributes provided as arguments to __init__ methods was raised. [...] Good post! You'll want to send this to python-ideas at some point (that's where most new python features are discu

PSA: Linux vulnerability

2022-03-08 Thread Ethan Furman
https://arstechnica.com/information-technology/2022/03/linux-has-been-bitten-by-its-most-high-severity-vulnerability-in-years/ -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

2022-03-03 Thread Ethan Furman
On 3/3/22 5:32 PM, Rob Cliffe via Python-list wrote: > There are three types of programmer: those that can count, and those that can't. Actually, there are 10 types of programmer: those that can count in binary, and those that can't. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/pyt

Re: Aw: PYT - How can I subscribe to a topic in the mailing list?

2022-02-27 Thread Ethan Furman
On 2/21/22 3:19 AM, vanyp wrote: > The option to filter by topic is offered in the mailing list subscription customization page, although > no option list is given. Topics may have been a project that was never implemented. Topics are not currently enabled. I suspect for them to be useful, pe

Re: Best way to check if there is internet?

2022-02-07 Thread Ethan Furman
On 2/7/22 4:27 PM, Greg Ewing wrote: > On 8/02/22 8:51 am, Chris Angelico wrote: >> Some day, we'll have people on Mars. They won't have TCP connections - >> at least, not unless servers start supporting connection timeouts >> measured in minutes or hours - but it wouldn't surprise me if some >>

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Ethan Furman
On 2/4/22 6:28 AM, Cecil Westerhof via Python-list wrote: > It was already not a good name, but I am rewriting the class > completely, so now the name is a complete bumper. (No more timer.) I > am thinking about naming the class repeating_thread, but I cannot say > that I find it a very good name

Re: New assignmens ...

2021-10-23 Thread Ethan Furman
On 10/23/21 6:42 AM, Jon Ribbens via Python-list wrote: > On 2021-10-23, Chris Angelico wrote: >> The onus is on you to show that it needs to be more flexible. > > Is it though? Yes. > It seems to me that the onus is on you to show that > this special case is special enough to be given its own

Re: Posts from gmane no longer allowed?

2021-09-26 Thread Ethan Furman
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 been a >> light weekend). > > We're n

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

2021-09-26 Thread Ethan Furman
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 have >> actually been gmane's decision. Haven't heard anything from the list >> ad

Re: XML Considered Harmful

2021-09-21 Thread Ethan Furman
On 9/21/21 11:12 AM, Michael F. Stemper wrote: > It seems to me that XML is the right approach for this sort of > thing, especially since the data is hierarchical in nature. If you're looking for a format that you can read (as a human) and possibly hand-edit, check out NestedText: https://ne

RFC for PEP 663: Improving and Standardizing Enum str(), repr(), and format() behaviors

2021-07-21 Thread Ethan Furman
PEP: 663 Title: Improving and Standardizing Enum str(), repr(), and format() behaviors Version: $Revision$ Last-Modified: $Date$ Author: Ethan Furman Discussions-To: python-...@python.org Status: Draft Type: Informational Content-Type: text/x-rst Created: 23-Feb-2013 Python-Version: 3.11 Post

Re: Verify independence and uniform distribution of discrete values in Python?

2021-07-09 Thread Ethan Furman
From Tim Peters: > `secrets` is just a wrapper around `random.SystemRandom`, so the > presence or absence of `secrets` doesn't matter. > > As to SystemRandom, all answers depend on the quality of the platform > os.urandom(), which Python has no control over. See my answer here, > and the comments

Re: Neither pdb or print() displays the bug

2021-06-01 Thread Ethan Furman
On 6/1/21 1:42 PM, Rich Shepard wrote: > When I run it this is the output: > $ python activitytypes.py 2021-06-01 13:39:10,219 -DEBUG - Start of Program > 2021-06-01 13:39:15,229 -DEBUG - End of Program Well, you only had two logging statements in that code -- logging is like print: if you want

Re: Neither pdb or print() displays the bug

2021-06-01 Thread Ethan Furman
On 6/1/21 1:18 PM, Rich Shepard wrote: > I'd appreciate recommendations on the process to find where the bug lives > since I can't seem to find it with print() or line-by-line in pdb. Sounds like a console issue. Try using `logging` with a file... you could even use `print` with a file if you

Re: Definition of "property"

2021-05-30 Thread Ethan Furman
On 5/30/21 9:57 AM, Irv Kalb wrote: > I understand what a "property" is, how it is used and the benefits, but apparently my explanation hasn't made the light bulb go on for my editor. My answer from Stackoverflow [1]: > Properties are a special kind of attribute. Basically, when Python encoun

name for new Enum decorator

2021-05-27 Thread Ethan Furman
Greetings! The Flag type in the enum module has had some improvements, but I find it necessary to move one of those improvements into a decorator instead, and I'm having a hard time thinking up a name. What is the behavior? Well, a name in a flag type can be either canonical (it represents on

Typing and Enum and Abstract

2021-05-20 Thread Ethan Furman
Here's a question on SO about typing, enum, and ABC: https://stackoverflow.com/q/67610562/208880 No answers so far. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

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

2021-05-06 Thread Ethan Furman
On 5/6/21 11:05 AM, Jon Ribbens via Python-list wrote: > On 2021-05-06, Stestagg wrote: >> Where's this discussion going? >> >> Which of the practically possible options are best for this list <-> >> newsgroup setup? > > And it appears even the suggestion that > Mailman 3 cannot be used while a g

Re: Transistion from module to package and __init__.py

2021-05-05 Thread Ethan Furman
On 5/4/21 7:20 PM, Chris Nyland wrote: > Here is > where I my primary design question comes in. As organized now as described > to import and use the package I need > > from database import database > > or I have to put in the init file > > from database import * > > Either of these still leaves

Re: [OT] Annoying message duplication, was Re: Unsubscribe/can't login

2021-05-05 Thread Ethan Furman
On 5/5/21 7:39 AM, Peter Otten wrote: > On 05/05/2021 16:10, Ethan Furman wrote: >> I see your messages twice (occasionally with other posters as well). I have no idea how to fix it. :( > > OK, I'll try another option from Thunderbird's context menu: Followup to

Re: Unsubscribe/can't login

2021-05-05 Thread Ethan Furman
On 5/5/21 5:58 AM, Peter Otten wrote: > On 05/05/2021 13:03, Jan van den Broek wrote: >> On 2021-05-05, Peter Otten <__pete...@web.de> wrote: >> Perhaps there's something wrong on my side, but I'm >> seeing this message twice: >> >> Msg-ID: mailman.145.1620211376.3087.python-l...@python.org >> Re

Re: do ya still use python?

2021-04-19 Thread Ethan Furman
On 4/19/21 11:22 AM, Unbreakable Disease wrote: [offensive drivel] List, my apologies -- not sure how that one got through. -- ~Ethan~ Python List Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: How does "__doc__ % globals()" work?

2021-04-12 Thread Ethan Furman
On 4/12/21 3:06 PM, Jaime wrote: > Hi all. Line 102 of https://github.com/python/peps/blob/master/pep2html.py says: > > print(__doc__ % globals(), file=out) > > I realise that globals() is a standard-library > built-in function that returns a dictionary representing the current > global symbol ta

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-03-31 Thread Ethan Furman
On 3/31/21 4:14 PM, Chris Angelico wrote: I think this code makes some sort of argument in the debate about whether Python has too much flexibility or if it's the best metaprogramming toolset in the world. I'm not sure which side of the debate it falls on, though. Well, `__init_subclass__` is t

Re: Why assert is not a function?

2021-03-11 Thread Ethan Furman
On 3/11/21 1:45 PM, dn via Python-list wrote: Is assert so much faster/cheaper than try...except...raise? Infinitely faster when they are not there. ;-) Basically, you are looking at two different philosophies: - Always double check, get good error message when something fails vs - check

editor recommendations?

2021-02-26 Thread Ethan Furman
I'm looking for an editor to use for Python programming, as well as related incidentals such as markdown files, restructured text, etc. I'm currently using vim, and the primary reason I've stuck with it for so long is because I can get truly black screens with it. By which I mean that I have

Re: name for a mutually inclusive relationship

2021-02-25 Thread Ethan Furman
On 2/25/21 7:06 PM, Joe Pfeiffer wrote: Ethan Furman writes: Like I said, at this moment I don't have a good example, only an awareness that such a thing could exist and I don't know the name for it (if it has one). So far I have seen that there are even fewer good use-cases th

Re: name for a mutually inclusive relationship

2021-02-24 Thread Ethan Furman
On 2/24/21 1:54 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: Ethan Furman wrote: I didn't say it was a good example. ;-) Hopefully it gets the idea across. Ditto. ;-) IMO, the whole idea of "my program has two options, and the user has to specify both or neither," isn&

Re: name for a mutually inclusive relationship

2021-02-24 Thread Ethan Furman
On 2/24/21 1:23 PM, 2qdxy4rzwzuui...@potatochowder.com wrote: entangled (none or all): image size override: height width IMO, that's *one* option (-s 640x480 or -s 640,480), not two. In argparse/optparse terms, a required argument with a custom type. (OTOH, in a GUI, it'd be two sepa

Re: name for a mutually inclusive relationship

2021-02-24 Thread Ethan Furman
On 2/24/21 12:40 PM, Alan Gauld via Python-list wrote: On 24/02/2021 16:12, Ethan Furman wrote: I'm looking for a name for a group of options that, when one is specified, all of them must be specified. For contrast, - radio buttons: a group of options where only one can be spec

Re: name for a mutually inclusive relationship

2021-02-24 Thread Ethan Furman
On 2/24/21 8:28 AM, 2qdxy4rzwzuui...@potatochowder.com wrote: Entangled? Hey, I like that one! ;-) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

name for a mutually inclusive relationship

2021-02-24 Thread Ethan Furman
I'm looking for a name for a group of options that, when one is specified, all of them must be specified. For contrast, - radio buttons: a group of options where only one can be specified (mutually exclusive) - check boxes: a group of options that are independent of each other (any number o

Re: Python 2.7 and 3.9

2021-02-16 Thread Ethan Furman
Kevin, please reply to the list (preferably Reply-to-list, or Reply-all), that way others can chime in with help. On 2/16/21 12:55 PM, Kevin M. Wilson wrote: Windows 7 OS, and typically run in conjunction with testing SSD', as for stand alone scripts. Those require: python BogusFile.py. I too

Re: Python 2.7 and 3.9

2021-02-16 Thread Ethan Furman
On 2/16/21 12:09 PM, Kevin M. Wilson via Python-list wrote: My employer has hundreds of scripts in 2.7, but I'm writing new scripts in 3.9! I'm running into 'invalid syntax' errors.I have to maintain the 'Legacy' stuff, and I need to mod the path et al., to execute 3.7 w/o doing damage to the

Re: Mr. Flibble

2021-02-15 Thread Ethan Furman
On 2/15/21 2:02 PM, Grant Edwards wrote: On 2021-02-15, Ben Bacarisse wrote: You said you used Usenet (and your reply here was via Usenet). Usenet posts to comp.lang.python don't go to the mailing list (the "here" that Ethan is talking about). Mails to the list /are/ sent here, but it's one-w

Mr. Flibble

2021-02-15 Thread Ethan Furman
Thank you to those who pointed out this individual to the moderators. As Mr. Flibble accurately noted, he is not on the mailing list -- so his posts won't be here either. -- ~Ethan~ Python List Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: help

2021-01-26 Thread Ethan Furman
On 1/26/21 9:05 AM, Terry Reedy wrote: On 1/26/2021 4:01 AM, Maziar Ghasemi wrote: ... Please do not repost, especially the same day. Maziar Ghasemi appears to be a new user, and had to sign up to the Python List mailing list. Are you seeing his request twice because you use gmane? --

Re: why sqrt is not a built-in function?

2021-01-14 Thread Ethan Furman
On 1/14/21 11:06 AM, Eli the Bearded wrote: "There should be one-- and preferably only one --obvious way to do it." Meanwhile, Alan Gauld pointed out: AG> because pow() is a builtin function and AG> root = pow(x,0.5) AG> is the same as AG> root = math.sqrt(x) Plus the ** operation

Re: why sqrt is not a built-in function?

2021-01-14 Thread Ethan Furman
On 1/14/21 9:44 AM, Denys Contant wrote: I don't understand why sqrt is not a built-in function. Why do we have to first import the function from the math module? I use it ALL THE TIME! And thousands, tens of thousands, and maybe hundreds of thousands don't. That felt good. Thank you. Any

Re: How do you find what exceptions a class can throw?

2020-12-20 Thread Ethan Furman
On 12/20/20 6:06 PM, Julio Di Egidio wrote: You could have taken the chance to pay attention Programming is a *discipline*, while you keep echoing cheap and vile marketing nonsense. I am sure you do, rigour mortis eventually... Mean-spirited and hostile messages are not welcome on this

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

2020-12-16 Thread Ethan Furman
On 12/16/20 3:08 AM, Peter J. Holzer wrote: On 2020-12-15 13:07:25 -0800, Ethan Furman wrote: On 12/15/20 9:07 AM, Mark Polesky via Python-list wrote: D = {'a':1} def get_default(): print('Nobody expects this') return 0 print(D.get('a', get_

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

2020-12-16 Thread Ethan Furman
On 12/16/20 1:44 AM, Chris Angelico wrote: On Wed, Dec 16, 2020 at 8:43 PM Loris Bennett wrote: Paul Bryan writes: On Wed, 2020-12-16 at 10:01 +0100, Loris Bennett wrote: OK, I get the point about when the default value is generated and that potentially being surprising, but in the exampl

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

2020-12-15 Thread Ethan Furman
On 12/15/20 9:07 AM, Mark Polesky via Python-list wrote: > D = {'a':1} > > def get_default(): > print('Nobody expects this') > return 0 > > print(D.get('a', get_default())) Python has short-circuiting logical operations, so one way to get the behavior you're looking for is: D.get

Fwd: Fwd: How to specify JSON parameters in CallBack?

2020-12-13 Thread Ethan Furman
From: Caleb Gattegno Date: Fri, Dec 11, 2020 at 5:02 PM Subject: How to specify JSON parameters in CallBack? Please can you suggest where should I look for advice on converting a old style web app which vends whole pages of html with a cgi-bin/python script invoked bypython3 server.py, into one

Re: Is there a conflict of libraries here?

2020-11-09 Thread Ethan Furman
On 11/8/20 9:20 PM, Chris Angelico wrote: Perhaps, but certainly the confusion is far less when the module is always imported as itself, and then the class is "datetime.datetime" which nicely parallels "datetime.date" and "datetime.time". I find doubled names such as "datetime.datetime" both j

Re: Post request and encoding

2020-11-02 Thread Ethan Furman
On 11/2/20 9:32 AM, Karsten Hilbert wrote: because .encode() does not operate in-place. Yeah, none of the string operations do, and it's embarrassing how many times that still bites me. :-/ -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to determine user's screensize?

2020-10-31 Thread Ethan Furman
On 10/31/20 11:24 AM, Peter J. Holzer wrote: On 2020-10-31 11:58:41 -0500, 2qdxy4rzwzuui...@potatochowder.com wrote: I don't think we're disagreeing too much here, either. IMO, the user should be in control, whether by config file or command line or whatever, Config files and command lines

Re: Best way to determine user's screensize?

2020-10-31 Thread Ethan Furman
On 10/30/20 6:24 PM, Grant Edwards wrote: On 2020-10-30, flaskee via Python-list wrote: but allow the user to alter things, via preferences. If you want to remember when a user resizes the application and re-open with that same geometry, that's OK. Doin't it "via preferences" is right out.

Re: GUI: I am also looking for a nudge into the best (GUI) direction.

2020-10-29 Thread Ethan Furman
On 10/29/20 11:30 AM, Igor Korot wrote: If you have any further questions you can contact me directly. Please do not. By keeping the discussion on the list many people can participate and learn. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Question on ABC classes

2020-10-22 Thread Ethan Furman
On 10/22/20 9:25 AM, Julio Di Egidio wrote: Now, I do read in the docs that that is as intended, but I am not understanding the rationale of it: why only if there are abstract methods defined in an ABC class is instantiation disallowed? IOW, why isn't subclassing from ABC enough? Let's say yo

Re: Puzzling difference between lists and tuples

2020-09-17 Thread Ethan Furman
On 9/17/20 10:43 AM, MRAB wrote: On 2020-09-17 17:47, Ethan Furman wrote: The only time the parentheses are required for tuple building is when they would otherwise not be interpreted that way: They're needed for the empty tuple, which doesn't have a comma. Ah, right. Thanks.

Re: Puzzling difference between lists and tuples

2020-09-17 Thread Ethan Furman
On 9/17/20 8:24 AM, William Pearson wrote: I am puzzled by the reason for this difference between lists and tuples. A list of with multiple strings can be reduced to a list with one string with the expected results: for n in ['first']: print n ['first'] is a list. for n in ('first'

[closed] Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Ethan Furman
This thread is now closed. Thank you for your cooperation. -- ~Ethan~ Python List Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Ethan Furman
On 8/19/20 12:40 PM, Tim Daneliuk wrote: On 8/19/20 2:00 PM, Karen Shaeffer wrote: Considering all your posts on this thread, it is reasonable to infer you have some ideological motivations. My motivation was to demonstrate that if people of your ilk are free to peddle their worldview, Un

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Ethan Furman
On 8/19/20 6:35 AM, Alexandre Brault wrote: What people *are* complaining about is the use of a commit message to stand on a soapbox and preach. The time to preach was when debating the change; commit messages, in many people's opinions, is not the time to espouse non-technical opinions An e

Re: Final statement from Steering Council on politically-charged commit messages

2020-08-19 Thread Ethan Furman
On 8/19/20 2:55 AM, J. Pic wrote: [...] but still, I don't understand how this sentence (changed by the patch): When writing English, follow Strunk and White. Does "uphold relics of white supremacy" (as per the commit message). Thanks in advance for your simple explanation (I'm not a native

Re: Are instances of user-defined classes mutable?

2020-08-06 Thread Ethan Furman
On 8/6/20 7:40 AM, Robin Becker wrote: On 06/08/2020 05:17, ZHAOWANCHENG wrote: So are instances of user-defined classes mutable or immutable? user class instances are clearly mutable, and in my python 3.8 you can do horrid things like this > > [snip buggy/incorrect uses of __hash__] You

Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Ethan Furman
On 7/22/20 2:57 PM, Jeff Linahan wrote: Subscribing to the mailing list as per the bot's request and resending. *beep* *whir* WE ARE NOT *click* *whi* A BOT. *bzzzt* WE ARE *bzzzt* *click* ADVANCED LIFE *whi* FORMS *click* *beep* . -- ~eTHAN~ pYTHON lIST mODERATOR NoT

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-04 Thread Ethan Furman
On 07/04/2020 10:32 AM, Random832 wrote: I said obvious because even if it was not obvious from the commit message itself, it had *already been explained* in the thread on the other mailing list That would require Michael to have been reading the other mailing list to know that. Just becaus

Making and seeing mistakes [was: Formal Question to Steering Council]

2020-07-03 Thread Ethan Furman
On 07/03/2020 11:57 AM, Jon Ribbens via Python-list wrote: On 2020-07-03, Michael Torrie wrote: All you needed to say was, "No, she did not conflate 'White' with race." To say "[I] did," is a very odd thing, and certainly inaccurate. I definitely did not conflate White with race. Why do yo

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-03 Thread Ethan Furman
On 07/02/2020 07:42 PM, Jon Ribbens via Python-list wrote: She didn't - you did. Please keep the discourse civil. Petty taunts are not helpful. -- ~Ethan~ Python List Moderator -- https://mail.python.org/mailman/listinfo/python-list

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-02 Thread Ethan Furman
On 07/02/2020 12:14 PM, Michael Torrie wrote: The fact she would conflate an author's name with some kind of race-related thing is a bit embarrassing, frankly. It seems she has studied literary and English history, at least as related to the 20th century, so I don't think any name conflation

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-02 Thread Ethan Furman
On 07/02/2020 06:39 AM, Rhodri James wrote: We've had the requested 24 hour cooling off, and I don't imagine anyone is surprised that the situation remains unchanged.  The commit message that caused the controversy is still in the PEP repository, and is still controversial.  Whether you think

Re: Can I have a class with property named "from"

2020-06-05 Thread Ethan Furman
On 06/05/2020 03:15 PM, MRAB wrote: On 2020-06-05 22:50, Ethan Furman wrote: There is no workaround that allows a keyword to be used except as a keyword, other than making it a string.  When faced with this kind of situation myself I use a synonym, like "since", or a transla

Re: Can I have a class with property named "from"

2020-06-05 Thread Ethan Furman
On 06/05/2020 02:36 PM, zljubi...@gmail.com wrote: class abc: def __init__(self): self._from = None @property def from(self): return self._from @from.setter def from(self, value): self._from = value I get the error SyntaxError: invalid syn

Re: Enums are Singletons - but not always?

2020-05-23 Thread Ethan Furman
On 05/23/2020 11:57 AM, Richard Damon wrote: I don't think Python anywhere defines that a enum will be a singleton, and you should be checking for equality (==) not identity (is) If you're not sure, please do a little research first. We have enough bad information on the 'nets already. Acco

Re: Strings: double versus single quotes

2020-05-19 Thread Ethan Furman
On 05/19/2020 11:40 AM, Joel Goldstick wrote: I thought triple quotes are for docstrings? It's the recommendation, but double and single quotes work just fine, too -- at least for docstrings that fit an one line. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Sphinx plugin to make easier-to-navigate class documentation

2020-05-18 Thread Ethan Furman
On 05/18/2020 09:46 AM, Kale Kundert wrote: I'm writing to share a Sphinx plugin I wrote, which I think makes the documentation for large classes much easier to navigate and understand.  The plugin is called `autoclasstoc` and you can find the documentation here: https://autoclasstoc.readthedoc

Re: PEP Idea: Multi-get for lists/tuples and dictionaries (inspired in NumPy)

2020-03-19 Thread Ethan Furman
On 03/19/2020 02:09 AM, Terry Reedy wrote: On 3/18/2020 10:28 PM, Santiago Basulto wrote: For dictionaries it'd even be more useful: d = { 'first_name': 'Frances', 'last_name': 'Allen', 'email': 'fal...@ibm.com' } fname, lname = d[['first_name', 'last_n

Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Ethan Furman
On 03/16/2020 01:16 PM, Barry Scott wrote: If you search google for a shop the right hand panel has a popular times sections that tells you how busy the store typically is and the current busyness estimate. Is that what you are after? I suspect that's the general idea, only in real-time. -- ~

Re: Reduce waiting queue at supermarket from Corona with Python-Webapp

2020-03-16 Thread Ethan Furman
On 03/16/2020 01:52 PM, Orges Leka wrote: Following your reasoning, then radar detection apps / wikipedia / facebook, which crucially depend on user generated content should not work Those are global apps, and one user's content can be useful in another user's country. Who's shopping at

Re: [Mostly OT] Feedback on Python homework using Canvas LMS

2020-03-16 Thread Ethan Furman
On 03/16/2020 11:31 AM, Irv Kalb wrote: The problem is that in the feedback section for homework assignments, Canvas eliminates any leading space characters. So, I might write: if x == y: # do thing 1 else: # do thing 2 but when it gets posted and viewed by the student, it shows up

  1   2   3   4   5   6   7   8   9   10   >