Re: PEP 594 cgi & cgitb removal

2019-05-25 Thread Jon Ribbens via Python-list
On 2019-05-25, Michael Torrie wrote: > On 05/24/2019 04:27 AM, Jon Ribbens via Python-list wrote: >> Sorry, in what sense do you mean "Serverless is CGI"? >> >> As far as I can tell, it's just a script to automatically upload >> bits of code into various c

Re: PEP 594 cgi & cgitb removal

2019-05-23 Thread Jon Ribbens via Python-list
On 2019-05-23, Paul Rubin wrote: > dieter writes: >> Should "cgi" disappear from the standard library > > It's also a concern that cgi may be disappearing from web servers. Last > I heard, nginx didn't support it. That's part of why I still use > apache, or (local only) even CGIHTTPServer.py.

Re: PEP 594 cgi & cgitb removal

2019-05-24 Thread Jon Ribbens via Python-list
On 2019-05-23, Gunnar Þór Magnússon wrote: >> nginx is the current hotness. CGI has not been hotness since the >> mid 90s. > > Serverless is the new hotness, and serverless is CGI. Technology is > cyclical. Sorry, in what sense do you mean "Serverless is CGI"? As far as I can tell, it's just a

Re: Automate extract domain

2019-05-12 Thread Jon Ribbens via Python-list
On 2019-05-12, Birdep wrote: > I am trying to extract domain name from a adblock rule , so what > pattern should i used to extract domain name only? > > import re > domains = ['ru', ' fr' ,'eu', 'com'] with open('easylist.txt', 'r') as f: > a=f.read()

Re: Handle foreign character web input

2019-06-29 Thread Jon Ribbens via Python-list
On 2019-06-28, Chris Angelico wrote: > On Sat, Jun 29, 2019 at 6:31 AM Tobiah wrote: >> A guy comes in and enters his last name as RÖnngren. >> >> So what did the browser really give me; is it encoded >> in some way, like latin-1? Does it depend on whether >> the name was cut and pasted from a

Re: Web framework for static pages

2019-08-13 Thread Jon Ribbens via Python-list
On 2019-08-13, Morten W. Petersen wrote: > Ok. Isn't it a bit splitting of hairs to talk about static site generators > and their templates? No, not even slightly. You appear to be thinking that static site generators come with a pre-made set of design templates, and as far as I am aware they

Re: Web framework for static pages

2019-08-12 Thread Jon Ribbens via Python-list
On 2019-08-12, Morten W. Petersen wrote: > What I guess I'm looking for, is something that will help create a > static website, in a simple and efficient manner. Without being bloated. > > I don't have a lot of hair on my head, but I would be pulling it out > because of some of the websites I

Re: Web framework for static pages

2019-08-13 Thread Jon Ribbens via Python-list
On 2019-08-13, Morten W. Petersen wrote: > Ideally I'd want a static site generator that makes it easy and quick to > create a website which is pretty, accessible, works across browsers and > standards compliant and doesn't freeze the browser on a low-end phone. That isn't what they do. All

Re: _unquote

2019-08-04 Thread Jon Ribbens via Python-list
On 2019-08-04, Hongyi Zhao wrote: > See the following code excerpted from https://github.com/shichao-an/ > homura/blob/master/homura.py: > > --- > def unquote(s): > res = s > if not PY3: > if isinstance(res, six.text_type): > res = s.encode('utf-8') > return

Re: if bytes != str:

2019-08-04 Thread Jon Ribbens via Python-list
On 2019-08-04, Hongyi Zhao wrote: > I read and learn the the following code now: > > https://github.com/shadowsocksr-backup/shadowsocksr-libev/blob/master/src/ > ssrlink.py > > In this script, there are the following two customized functions: > > -- > def to_bytes(s): > if bytes !=

Re: How do you insert an item into a dictionary (in python 3.7.2)?

2019-06-28 Thread Jon Ribbens via Python-list
On 2019-06-28, Larry Martell wrote: > On Fri, Jun 28, 2019 at 11:10 AM CrazyVideoGamez > wrote: >> >> How do you insert an item into a dictionary? For example, I make a >> dictionary called "dictionary". >> >> dictionary = {1: 'value1', 2: 'value3'} >> >> What if I wanted to add a value2 in the

Re: SSL/TLS in Python using STARTTLS and ssl/ssltelnet and telnetlib

2019-11-07 Thread Jon Ribbens via Python-list
On 2019-11-07, Veek M wrote: > Could someone suggest some introductory reading material that will allow > me to use 'telnetlib' with 'ssl' or 'ssltelnet'. > (currently using Pan since Knode is dropped on Debian) > > I'm trying to write something that will download the NNTP headers over > TLS.

Re: strptime for different languages

2019-12-17 Thread Jon Ribbens via Python-list
On 2019-12-17, Ulrich Goebel wrote: > I need to interpret a date string to get a datetime object. That should > be done with strptime from the module datetime. > > But I don't know enough about the locale settings from where the date > sting comes. Actually the date_string cames from different

Re: from ./.. import

2019-10-04 Thread Jon Ribbens via Python-list
On 2019-10-04, Hongyi Zhao wrote: > See this file: > https://github.com/hongyi-zhao/dotbot/blob/master/dotbot/messenger/ > messenger.py > > It has the following codes: > > from ..util.singleton import Singleton > from ..util.compat import with_metaclass > from .color import Color > from .level

Re: Technical debt - was Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-12 Thread Jon Ribbens via Python-list
On 2020-02-12, Chris Angelico wrote: > But you CAN rewrite code such that it reduces technical debt. You can > refactor code to make it more logical. ... but if doing so costs more than the debt, you shouldn't do it. -- https://mail.python.org/mailman/listinfo/python-list

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-10 Thread Jon Ribbens via Python-list
On 2020-02-10, Python wrote: > So far, so good. However, when you go to use this object, the time it > represents is in fact wrong. Unsurprisingly for a language feature that's been around for nearly 17 years, no it isn't. > For example: > print dt.strftime("%s") > 1580452245 That's

Re: Mental model of lookahead assertions

2020-02-28 Thread Jon Ribbens via Python-list
On 2020-02-27, Stefan Ram wrote: > One can count overlapping occurences as follows. > >|>>> print(len(findall('(?=aa)','cb'))) >|3 > > Every web page says that lookahead assertions do > not consume nor move the "current position". > > But what mental model can I make of the regex >

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, Pieter van Oostrum wrote: > Jon Ribbens writes: >> On 2020-03-06, moi wrote: >>> Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a écrit : moi writes: 'ÿ'.encode('utf-8') > b'\xc3\xbf' 'ÿ'.encode('utf-16-le') > b'\xff\x00'

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, moi wrote: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a écrit : >> moi writes: >> 'ÿ'.encode('utf-8') >> > b'\xc3\xbf' >> 'ÿ'.encode('utf-16-le') >> > b'\xff\x00' >> 'ÿ'.encode('utf-32-le') >> > b'\xff\x00\x00\x00' > >> That all looks as expected. > Yes >

Re: JavaScript's void operator in Python?

2020-02-02 Thread Jon Ribbens via Python-list
On 2020-02-02, Stefan Ram wrote: > JavaScript has a void operator that maps everything to > undefined. E.g., > > JavaScript console > >|< void( console.log( 2 ) ) >| 2 >|> undefined > > I can easily write a corresponding function in Python. > > main.py > > def void( x ): > pass > >

Re: JavaScript's void operator in Python?

2020-02-02 Thread Jon Ribbens via Python-list
On 2020-02-02, Stefan Ram wrote: > Greg Ewing writes: >>If the functions you're calling all return None, you can >>do this: >> >>> print(2); print(3) > > »print(2); print(3)« is not an expression anymore but an stmt_list. > It cannot be used in all places where an expression is allowed. Why

Re: JavaScript's void operator in Python?

2020-02-02 Thread Jon Ribbens via Python-list
On 2020-02-02, Stefan Ram wrote: > Jon Ribbens writes: >>Why does it matter if the return value is None? > > In a lambda, a return value of None sometimes would be > convenient as by convention it indicates that the return > value does not carry any information and the function is >

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-11 Thread Jon Ribbens via Python-list
On 2020-02-11, Chris Angelico wrote: > On Tue, Feb 11, 2020 at 10:01 PM Jon Ribbens via Python-list > wrote: >> So while it's been about 6 years since anyone should have been >> starting any new projects using Python 2, there are plenty of >> projects that are older

Re: datetime seems to be broken WRT timezones (even when you add them)

2020-02-11 Thread Jon Ribbens via Python-list
On 2020-02-11, Chris Angelico wrote: >> That's the key piece of info. This does appear to work, though still >> not on python2. That, as you say, is my problem. But thankfully Jon >> Ribbens has the save: > > Isn't it time to stop going to great effort to support Python 2? That depends on

Re: Sandboxing eval() (was: Calculator)

2020-01-19 Thread Jon Ribbens via Python-list
On 2020-01-19, mus...@posteo.org wrote: > Is it actually possible to build a "sandbox" around eval, permitting it > only to do some arithmetic and use some math functions, but no > filesystem acces or module imports? > > I have an application that loads calculation recipes (a few lines of >

Re: Clarification on Immutability please

2020-01-21 Thread Jon Ribbens via Python-list
On 2020-01-21, Chris Angelico wrote: > On Wed, Jan 22, 2020 at 8:01 AM Jon Ribbens via Python-list > wrote: >> On 2020-01-21, Chris Angelico wrote: >> > On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker >> > wrote: >> >> I am left concluding that mytup

Re: Clarification on Immutability please

2020-01-21 Thread Jon Ribbens via Python-list
On 2020-01-21, Chris Angelico wrote: > On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker wrote: >> I am left concluding that mytup is not actually a tuple (even though type >> (mytup) tells me that it is). > > If type(mytup) is tuple, then mytup really truly is a tuple. There is > no other

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, Pieter van Oostrum wrote: > Jon Ribbens writes: >> On 2020-03-06, moi wrote: >>> Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄCcritâ : moi writes: 'Ä¿'.encode('utf-8') > b'\xc3\xbf' 'Ä¿'.encode('utf-16-le') > b'\xff\x00'

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, Pieter van Oostrum wrote: > Jon Ribbens writes: >> On 2020-03-06, moi wrote: >>> Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄäCcritÄø : moi writes: 'Ääâ¿'.encode('utf-8') > b'\xc3\xbf' 'Ääâ¿'.encode('utf-16-le') > b'\xff\x00'

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, moi wrote: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄCcritâ : >> moi writes: >> 'Ä¿'.encode('utf-8') >> > b'\xc3\xbf' >> 'Ä¿'.encode('utf-16-le') >> > b'\xff\x00' >> 'Ä¿'.encode('utf-32-le') >> > b'\xff\x00\x00\x00' > >> That all looks as expected. >

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, moi wrote: > Le jeudi 5 mars 2020 13:20:38 UTC+1, Ben Bacarisse a ÄäCcritÄø : >> moi writes: >> 'Ääâ¿'.encode('utf-8') >> > b'\xc3\xbf' >> 'Ääâ¿'.encode('utf-16-le') >> > b'\xff\x00' >> 'Ääâ¿'.encode('utf-32-le') >> > b'\xff\x00\x00\x00' > >> That all looks as

Re: ÿ in Unicode

2020-03-06 Thread Jon Ribbens via Python-list
On 2020-03-06, Jon Ribbens wrote: > What's the bug, or source of amusement? Oh, that's fun. There's a Russian Fidonet gateway, that somehow still exists, that's re-injecting usenet posts back into the group. -- https://mail.python.org/mailman/listinfo/python-list

Re: link to venv python sees a different sys.path

2020-03-11 Thread Jon Ribbens via Python-list
On 2020-03-11, Robin Becker wrote: > I'm trying to understand why python 3.8.2 venv behaves differently > when it is executed va a link Because site.py contains a function called venv() which looks up the path of the executed python binary, and searches for the virtual environment relative to

Re: php to python code converter

2020-05-14 Thread Jon Ribbens via Python-list
On 2020-05-14, MRAB wrote: > Look at the date of the original post. It says "8 May 2009". That's over > 11 years ago! > > Since then, Google Code has ceased to exist. Disgraceful, all URLs should continue to work for at least as long as this one has:

Re: "1,+2,", but not "(1,)+2,"

2020-07-31 Thread Jon Ribbens via Python-list
On 2020-07-31, Stefan Ram wrote: > You can write > >|>>> 1,+2, >|(1, 2) > > , but not > >|>>> (1,)+2, >|TypeError: can only concatenate tuple (not "int") to tuple > > . Why? (Python 3.9) For the obvious reason, as indicated by the error message? What are you expecting these expressions to

Re: "1,+2,", but not "(1,)+2,"

2020-07-31 Thread Jon Ribbens via Python-list
On 2020-07-31, Bart wrote: > Not sure about the trailing commas on each. It seems Python ignores > trailing commas on tuple constructors, so that the A,B, would be a > 2-tuple, and A+B, would have been a 1-tuple if A+B had been legal. It's not just tuples, it's lists, sets, dictionaries, etc.

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

2020-07-02 Thread Jon Ribbens via Python-list
On 2020-07-02, Michael Torrie wrote: > Agreed. She just needs to fix her commit message to remove the sentence > about the relics of white supremacy. The fact she would conflate an > author's name with some kind of race-related thing is a bit > embarrassing, frankly. She didn't - you did. --

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

2020-07-03 Thread Jon Ribbens via Python-list
On 2020-07-03, Ethan Furman wrote: > 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. Sorry, I don't understand what you are getting at. My comment was not a "petty taunt&q

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

2020-07-03 Thread Jon Ribbens via Python-list
On 2020-07-02, Michael Torrie wrote: > On 7/2/20 1:26 PM, Jon Ribbens via Python-list wrote: >> On 2020-07-02, Michael Torrie wrote: >>> Agreed. She just needs to fix her commit message to remove the sentence >>> about the relics of white supremacy. The fact she wou

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

2020-07-03 Thread Jon Ribbens via Python-list
On 2020-07-03, Michael Torrie wrote: > On 7/3/20 10:57 AM, Jon Ribbens via Python-list wrote: >> On 2020-07-03, Ethan Furman wrote: >>> On 07/02/2020 07:42 PM, Jon Ribbens via Python-list wrote: >>>> She didn't - you did. >>> >>> Please keep th

Re: Access last element after iteration

2020-07-07 Thread Jon Ribbens via Python-list
On 2020-07-07, Frank Millman wrote: > After iterating over a sequence, the final element is still accessible. > In this case, the variable 'i' still references the integer 4. ... > Is this guaranteed in Python, or should it not be relied on? It is guaranteed, *except* if the sequence is empty

Re: Bulletproof json.dump?

2020-07-06 Thread Jon Ribbens via Python-list
On 2020-07-06, Chris Angelico wrote: > I think that even in non-strict mode, round-tripping should be > achieved after one iteration. That is to say, anything you can > JSON-encode will JSON-decode to something that would create the same > encoded form. Not sure if there's anything that would

Re: Bulletproof json.dump?

2020-07-06 Thread Jon Ribbens via Python-list
On 2020-07-06, J. Pic wrote: > Well I made a suggestion on python-ideas and a PyPi lib came out of it, but > since you can't patch a lot of internal types it's not so useful. > > Feel free to try it out: > > https://yourlabs.io/oss/jsonlight/ While I applaud your experimentation, that is not

Re: Bulletproof json.dump?

2020-07-06 Thread Jon Ribbens via Python-list
On 2020-07-06, Chris Angelico wrote: > On Mon, Jul 6, 2020 at 8:36 PM Adam Funk wrote: >> Is there a "bulletproof" version of json.dump somewhere that will >> convert bytes to str, any other iterables to list, etc., so you can >> just get your data into a file & keep working? > > That's the PHP

Re: Bulletproof json.dump?

2020-07-06 Thread Jon Ribbens via Python-list
On 2020-07-06, Frank Millman wrote: > On 2020-07-06 3:08 PM, Jon Ribbens via Python-list wrote: >> On 2020-07-06, Frank Millman wrote: >>> On 2020-07-06 2:06 PM, Jon Ribbens via Python-list wrote: >>>> While I agree entirely with your point, there is however pe

Re: Bulletproof json.dump?

2020-07-06 Thread Jon Ribbens via Python-list
On 2020-07-06, Chris Angelico wrote: > On Mon, Jul 6, 2020 at 10:11 PM Jon Ribbens via Python-list > wrote: >> While I agree entirely with your point, there is however perhaps room >> for a bit more helpfulness from the json module. There is no sensible >> reason I can

Re: Bulletproof json.dump?

2020-07-06 Thread Jon Ribbens via Python-list
On 2020-07-06, Frank Millman wrote: > On 2020-07-06 2:06 PM, Jon Ribbens via Python-list wrote: >> While I agree entirely with your point, there is however perhaps room >> for a bit more helpfulness from the json module. There is no sensible >> reason I can think of that it

Re: Bulletproof json.dump?

2020-07-06 Thread Jon Ribbens via Python-list
On 2020-07-06, Chris Angelico wrote: > On Mon, Jul 6, 2020 at 11:06 PM Jon Ribbens via Python-list > wrote: >> The 'json' module already fails to provide round-trip functionality: >> >> >>> for data in ({True: 1}, {1: 2}, (1, 2)): >> ...

Re: Bulletproof json.dump?

2020-07-06 Thread Jon Ribbens via Python-list
On 2020-07-06, Chris Angelico wrote: > On Tue, Jul 7, 2020 at 12:01 AM Jon Ribbens via Python-list > wrote: >> I think what you're saying is, if we do: >> >> json1 = json.dumps(foo) >> json2 = json.dumps(json.loads(json1)) >> assert json1 == json2 &

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

2020-07-03 Thread Jon Ribbens via Python-list
On 2020-07-03, Rhodri James wrote: > On 02/07/2020 23:46, Random832 wrote: >> On Thu, Jul 2, 2020, at 18:29, Michael Torrie wrote: >>> Come again? I can see no other link in the verbage with the >>> "relics of white supremacy" that she referred to. If there are >>> other links, they should be

Re: Letter replacer - suggestions?

2020-12-07 Thread Jon Ribbens via Python-list
On 2020-12-07, Chris Angelico wrote: > On Tue, Dec 8, 2020 at 6:41 AM Grant Edwards > wrote: >> On 2020-12-07, MRAB wrote: >> > Avoid a 'bare' except unless you _really_ mean it, which is >> > virtually never. Catch only those exceptions that you're going to >> > handle. >> >> And sometimes

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Jon Ribbens via Python-list
On 2020-10-31, Stefan Ram wrote: > Siddhharth Choudhary writes: >>I want to know why x+=1 does not return the value of the variable. > > Which value? The old or the new one? > > Expressions never return values. Except when they're assignment expressions, when they do. --

Re: Why x+=1 doesn't return x value instead of an object

2020-10-30 Thread Jon Ribbens via Python-list
On 2020-10-31, Chris Angelico wrote: > On Sat, Oct 31, 2020 at 1:51 PM Jon Ribbens via Python-list > wrote: >> >> On 2020-10-31, Stefan Ram wrote: >> > Siddhharth Choudhary writes: >> >>I want to know why x+=1 does not return the value of the var

Re: Replacement for Mailman

2021-06-08 Thread Jon Ribbens via Python-list
On 2021-06-08, 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? There is always Mailman 3... -- https://mail.python.org/mailman/listinfo/python-list

Re: Replacement for Mailman

2021-06-08 Thread Jon Ribbens via Python-list
On 2021-06-08, Grant Edwards wrote: > 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. I'm pretty sure that's out of date. --

Re: Replacement for Mailman

2021-06-08 Thread Jon Ribbens via Python-list
On 2021-06-08, Terry Reedy wrote: > On 6/8/2021 4:36 PM, Jon Ribbens via Python-list wrote: >> On 2021-06-08, Grant Edwards wrote: >>> On 2021-06-08, Paul Bryan wrote: >>>> How about Mailman 3.x on Python 3.x? >>> >>> According to https:

Re: Writers [Was: Re: Standarize TOML?]

2021-05-18 Thread Jon Ribbens via Python-list
On 2021-05-18, Michael F. Stemper wrote: > On 17/05/2021 18.48, Terry Reedy wrote: >> I disagree.  Rehashing *opinions* is pretty useless. The issues were >> already discussed on >> https://discuss.python.org/t/adopting-recommending-a-toml-parser/4068 >> >> There are multiple packages.  There

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

2021-05-05 Thread Jon Ribbens via Python-list
On 2021-05-06, Richard Damon wrote: > On 5/5/21 9:40 PM, Jon Ribbens via Python-list wrote: >> On 2021-05-06, Paul Bryan wrote: >>> What's involved in moderating c.l.p? Would there be volunteers willing >>> to do so? >> Nothing at all is involved, apart from

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

2021-05-05 Thread Jon Ribbens via Python-list
On 2021-05-06, Chris Angelico wrote: > On Thu, May 6, 2021 at 10:32 AM Paul Bryan wrote: >> >> 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

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

2021-05-05 Thread Jon Ribbens via Python-list
On 2021-05-06, Paul Bryan wrote: > What's involved in moderating c.l.p? Would there be volunteers willing > to do so? Nothing at all is involved, apart from changing the status of the group. The moderation would be done by the same people, in the same way, as the moderation of the list is done

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

2021-05-06 Thread Jon Ribbens via Python-list
On 2021-05-06, Richard Damon wrote: > On 5/5/21 10:44 PM, Jon Ribbens via Python-list wrote: >> On 2021-05-06, Richard Damon wrote: >>> As someone with a long usenet background, converting the existing group >>> to moderated would be practically impossible. It just is

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

2021-05-06 Thread Jon Ribbens via Python-list
On 2021-05-06, Skip Montanaro wrote: >> Are you unaware that the group is already gatewayed to a moderated >> mailing list for which all of that work is already done? > > What is this moderation of which you speak? I'm one of the Python > postmasters (I maintain the SpamBayes setup) and am aware

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

2021-05-06 Thread Jon Ribbens via Python-list
On 2021-05-06, Richard Damon wrote: > On 5/6/21 6:12 AM, Jon Ribbens via Python-list wrote: >> I think you're fundamentally missing the point that the newsgroup is >> *already gatewayed to the mailing list*. Marking the group moderated >> will not result in any more wo

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

2021-05-06 Thread Jon Ribbens via Python-list
On 2021-05-06, Richard Damon wrote: > On 5/6/21 9:12 AM, Jon Ribbens via Python-list wrote: >> Are you saying that the messages that appear occasionally from people >> such as Ethan Furman claiming to be moderators and alleging that >> particular people have been banned

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

2021-05-06 Thread Jon Ribbens via Python-list
On 2021-05-06, Skip Montanaro wrote: >> Are you saying that the messages that appear occasionally from people >> such as Ethan Furman claiming to be moderators and alleging that >> particular people have been banned or suspended are lies? And that the >> message I received once saying that my

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

2021-05-06 Thread Jon Ribbens via Python-list
On 2021-05-06, Richard Damon wrote: > On 5/6/21 9:44 AM, Jon Ribbens via Python-list wrote: >> Sounds like nearly all moderated lists/forums then. > > Then perhaps you have never been on a real Moderated mailing list or > Forum. Ah, the "no true scotsforum" argum

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

2021-05-06 Thread Jon Ribbens via Python-list
On 2021-05-06, Stestagg wrote: > Where's this discussion going? > > Let's not get too caught up on definitions or the sizes of everyone's > respective .. newsgroups. > > Which of the practically possible options are best for this list <-> > newsgroup setup? As before I'd suggest that changing

Re: Standarize TOML?

2021-05-16 Thread Jon Ribbens via Python-list
On 2021-05-15, Jason C. McDonald wrote: > During the Steering Committee presentation at PyCon, it was mentioned > that no one has formally proposed TOML be added to the standard library > (emphasis on formal). THe joke went forth that there would be a flood > of proposals to that end. > > So,

Re: learning python ...

2021-05-24 Thread Jon Ribbens via Python-list
On 2021-05-24, Alan Gauld wrote: > On 24/05/2021 16:54, Michael F. Stemper wrote: > >> In my early days of writing python, I created lists named "list", >> dictionaries named "dict", and strings named "str". I mostly know better >> now, but sometimes still need to restrain my fingers. > > I think

Re: string storage [was: Re: imaplib: is this really so unwieldy?]

2021-05-26 Thread Jon Ribbens via Python-list
On 2021-05-26, Alan Gauld wrote: > On 25/05/2021 23:23, Terry Reedy wrote: >> In CPython's Flexible String Representation all characters in a string >> are stored with the same number of bytes, depending on the largest >> codepoint. > > I'm learning lots of new things in this thread! > > Does

Re: Definition of "property"

2021-05-31 Thread Jon Ribbens via Python-list
On 2021-05-30, Terry Reedy wrote: > Note: at least one person says a property *pretends* to be an attribute. No, I said it pretends to be a *data* attribute. It is effectively several methods in a trenchcoat pretending to be a variable. -- https://mail.python.org/mailman/listinfo/python-list

Re: Definition of "property"

2021-05-30 Thread Jon Ribbens via Python-list
On 2021-05-30, 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. The editor is asking for a definition of property. I've > looked at many articles on line and a number of books,

Re: Definition of "property"

2021-06-01 Thread Jon Ribbens via Python-list
On 2021-06-01, Greg Ewing wrote: > On 1/06/21 2:34 am, Jon Ribbens wrote: >> From the outside, it's just a *data* attribute. Which, from the inside, >> it isn't. Hence "pretending". > > But what is it about the external appearance that would make > you think it's a data attribute, rather than

Re: Definition of "property"

2021-06-01 Thread Jon Ribbens via Python-list
On 2021-05-31, Greg Ewing wrote: > On 31/05/21 9:13 am, Jon Ribbens wrote: >> No, I said it pretends to be a *data* attribute. > > I don't think it's pretending to be anything. From the outside, > it's just an attribute. >From the outside, it's just a *data* attribute. Which, from the inside, it

Re: UTF-16 or something else?

2021-02-09 Thread Jon Ribbens via Python-list
On 2021-02-09, Skip Montanaro wrote: > I downloaded US hospital ICU capacity data this morning from this page: > > https://healthdata.gov/dataset/covid-19-reported-patient-impact-and-hospital-capacity-facility > > (The download link is about halfway down the page.) > > Trying to read it using my

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread Jon Ribbens via Python-list
On 2021-03-30, Loris Bennett wrote: > If I have dict of dicts, say > > dod = { > "alice": > { > "lang": "python", > "level": "expert" > }, > "bob": > { > "lang": "perl", > "level": "noob" > } > } > > is there a

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread Jon Ribbens via Python-list
On 2021-03-30, Chris Angelico wrote: > On Tue, Mar 30, 2021 at 11:01 PM Jon Ribbens via Python-list > wrote: >> >> On 2021-03-30, Chris Angelico wrote: >> > I dunno about "canonical", but here's how I'd do it: >> > >> > lod = [info | {&qu

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread Jon Ribbens via Python-list
On 2021-03-30, Chris Angelico wrote: > I dunno about "canonical", but here's how I'd do it: > > lod = [info | {"name": name} for name, info in dod.items()] > > You could use {"name":name}|info instead if you prefer to have the > name show up first in the dictionary. It's probably worth noting

Re: .title() - annoying mistake

2021-03-20 Thread Jon Ribbens via Python-list
On 2021-03-20, Cameron Simpson wrote: > On 20Mar2021 12:53, Sibylle Koczian wrote: >>Am 20.03.2021 um 09:34 schrieb Alan Bawden: >>>The real reason Python strings support a .title() method is surely >>>because Unicode supports upper, lower, _and_ title case letters, and >>>tells you how to map

Re: Current thinking on required options

2021-04-19 Thread Jon Ribbens via Python-list
On 2021-04-19, Paul Bryan wrote: > Calling them options—when they're required—seems like a problem.  The option is what the value is, not whether there is a value at all. If you order a coffee then you may have an option as to what temperature it is, that doesn't mean the coffee having a

Re: do ya still use python?

2021-04-19 Thread Jon Ribbens via Python-list
On 2021-04-20, Paul Rubin wrote: > Ethan Furman writes: >> List, my apologies -- not sure how that one got through. > > It was trollishly written but was a reasonable observation on the state > of the Usenet group. I didn't realize it had come through (or reached) > the mailing list. Anyway

Re: basic auth request

2021-08-18 Thread Jon Ribbens via Python-list
On 2021-08-18, Robin Becker wrote: > On 17/08/2021 22:47, Jon Ribbens via Python-list wrote: > ... >> That's only true if you're not using HTTPS - and you should *never* >> not be using HTTPS, and that goes double if forms are being filled >> in and double agai

Re: basic auth request

2021-08-17 Thread Jon Ribbens via Python-list
On 2021-08-17, Barry wrote: >> That's usually irrelevant, since the alternative is most likely to be >> form fill-out, which is exactly as secure. If you're serving over >> HTTPS, the page is encrypted, and that includes the headers; if you're >> not, then it's not encrypted, and that includes

Re: basic auth request

2021-08-25 Thread Jon Ribbens via Python-list
On 2021-08-25, Chris Angelico wrote: > On Wed, Aug 25, 2021 at 5:20 PM Barry Scott wrote: >> Only if this threat model matters to you or your organisation. >> Personal its low down of the threats I watch out for. >> >> The on-line world and the real-world are the same here. >> >> If a business

Re: basic auth request

2021-08-25 Thread Jon Ribbens via Python-list
On 2021-08-25, Chris Angelico wrote: > On Thu, Aug 26, 2021 at 12:16 AM Jon Ribbens via Python-list > wrote: >> There are so many trusted CAs these days that the chances of them all >> being secure approaches zero - they are not all equal yet they are all >> equally truste

Re: basic auth request

2021-08-25 Thread Jon Ribbens via Python-list
On 2021-08-25, Chris Angelico wrote: > On Thu, Aug 26, 2021 at 12:48 AM Jon Ribbens via Python-list > wrote: >> Another attempt at combatting this problem is DNS CAA records, >> which are a way of politely asking all CAs in the world except the >> ones you choose "ple

Re: Decoding of EmailMessage text

2021-08-23 Thread Jon Ribbens via Python-list
On 2021-08-23, Loris Bennett wrote: > If instead of > > mail.set_content(body) > > I do > > mail.set_content(body, cte="quoted-printable") Try print(mail.get_content()) rather than print(mail.as_string()) -- https://mail.python.org/mailman/listinfo/python-list

Re: basic auth request

2021-08-25 Thread Jon Ribbens via Python-list
On 2021-08-25, Eli the Bearded <*@eli.users.panix.com> wrote: > In comp.lang.python, Jon Ribbens wrote: >> Another attempt at combatting this problem is DNS CAA records, >> which are a way of politely asking all CAs in the world except the >> ones you choose "please don't issue a certificate for

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Jon Ribbens via Python-list
On 2021-08-03, Michael Torrie wrote: > On 8/2/21 1:43 PM, Sven R. Kunze wrote: >> maybe, I am missing something here but is it possible to specify a >> delimiter for list arguments in argparse: >> >> https://docs.python.org/3/library/argparse.html >> >> Usually, '--' is used to separate two

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Jon Ribbens via Python-list
On 2021-08-03, Roel Schroeven wrote: > Jon Ribbens via Python-list schreef op 3/08/2021 om 17:48: >> On 2021-08-03, Michael Torrie wrote: >> > On 8/2/21 1:43 PM, Sven R. Kunze wrote: >> >> maybe, I am missing something here but is it possible to specify a >

Re: Ask for help on using re

2021-08-06 Thread Jon Ribbens via Python-list
On 2021-08-06, jak wrote: > Il 06/08/2021 16:17, jak ha scritto: >> Il 06/08/2021 12:57, Jach Feng ha scritto: >>> That's an interest solution! Where the '|' operator in re.compile() >>> was documented? >> >> I honestly can't tell you, I've been using it for over 30 years. In any >> case you

Re: XML Considered Harmful

2021-09-24 Thread Jon Ribbens via Python-list
On 2021-09-24, Chris Angelico wrote: > On Sat, Sep 25, 2021 at 8:53 AM dn via Python-list > wrote: >> On 25/09/2021 06.59, Peter J. Holzer wrote: >> > CSV: Good for tabular data of a single data type (strings). As soon as >> > there's a second data type (numbers, dates, ...) you leave standard >>

Re: XML Considered Harmful

2021-09-25 Thread Jon Ribbens via Python-list
On 2021-09-25, Peter J. Holzer wrote: > On 2021-09-24 23:32:47 -0000, Jon Ribbens via Python-list wrote: >> JSON Schema provides a way to denote composite types. > > I probably wasn't clear what I meant. In XML, every element has a tag, > which is basically its type. So by look

Re: Inheriting from str

2021-09-20 Thread Jon Ribbens via Python-list
On 2021-09-20, ast wrote: > Hello > > class NewStr(str): > def __init__(self, s): > self.l = len(s) > > Normaly str is an immutable type so it can't be modified > after creation with __new__ > > But the previous code is working well > > obj = NewStr("qwerty") > obj.l > 6 > > I don't

Re: XML Considered Harmful

2021-09-21 Thread Jon Ribbens via Python-list
On 2021-09-21, Pete Forman wrote: > CSV is quite good as a lowest common denominator exchange format. I say > quite because I would characterize it by 8 attributes and you need to > pick a dialect such as MS Excel which sets out what those are. XML and > JSON are controlled much better. You can

Re: XML Considered Harmful

2021-09-21 Thread Jon Ribbens via Python-list
On 2021-09-21, Michael F. Stemper wrote: > On the prolog thread, somebody posted a link to: > > > One thing that it tangentially says is "XML is not the answer." > > I read this page right when I was about to write an XML parser > to get

Re: XML Considered Harmful

2021-09-23 Thread Jon Ribbens via Python-list
On 2021-09-23, Stefan Ram wrote: > The real problem with CSV is that there is no CSV. > > This is not a specific data language with a specific > specification. Instead it is a vague designation for > a plethora of CSV dialects, which usually dot not even > have a specification. Indeed.

Re: Proliferation of Python packaging formats

2021-11-17 Thread Jon Ribbens via Python-list
On 2021-11-17, Skip Montanaro wrote: > Is the proliferation of packaging formats in Python as nutzo as this author > believes? > > https://drewdevault.com/2021/11/16/Python-stop-screwing-distros-over.html > > Asking because I've never been in the business of releasing "retail" Python >

Re: copy.copy

2021-11-22 Thread Jon Ribbens via Python-list
On 2021-11-22, ast wrote: > Hi, > > >>> a = 6 > >>> b = 6 > >>> a is b > True > > ok, we all know that Python creates a sole instance > with small integers, but: > > >>> import copy > >>> b = copy.copy(a) > >>> a is b > True > > I was expecting False Why did you expect False? For immutable

Re: Avoid nested SIGINT handling

2021-11-10 Thread Jon Ribbens via Python-list
On 2021-11-10, Paulo da Silva wrote: > Hi! > > How do I handle a SIGINT (or any other signal) avoid nesting? I don't think you need to. Python will only call signal handlers in the main thread, so a handler can't be executed while another handler is running anyway. --

  1   2   >