[Python-ideas] Re: int.to_base, int.from_base

2022-05-01 Thread Simon de Vlieger
ebase where you 'often' do these kinds of > conversions? Is it in a performance-critical area? I can't but it hasn't been performance critical. Regards, Simon https://tools.ietf.org/id/draft-msporny-base58-01.html [1] https://datatracker.ietf.org/doc/draft-faltstrom-base45

[Python-ideas] int.to_base, int.from_base

2022-05-01 Thread Simon de Vlieger
ibilities. The signature(s) I had in mind for now are akin to: > int.from_base(x, alphabet, padding_character) and > int.to_base(alphabet, padding_character) Has any discussion on this been had previously (I searched around a bit), and if not would this ma

[Python-ideas] Re: Adding additionnal common request handlers to http.server

2020-08-25 Thread Simon
ib. There are just too many different ways to do it. (For example, what if the user isn't familiar with flask?) On Mon, Aug 24, 2020 at 1:45 PM Simon wrote: > > Fair enough. I guess the real question is, how much advantage is > > RESTRequestHandler over directly subclassing Bas

[Python-ideas] Re: Adding additionnal common request handlers to http.server

2020-08-24 Thread Simon
> Fair enough. I guess the real question is, how much advantage is > RESTRequestHandler over directly subclassing BaseHTTPRequestHandler? > Maybe it'd be worth it just to simplify that case. > > ChrisA Well, maybe an example would be more telling. Below is a basic usage of the handler I wrote :

[Python-ideas] Re: Adding additionnal common request handlers to http.server

2020-08-24 Thread Simon
> > > The standard library module http.server already has 2 request handlers, > with SimpleHTTPRequestHandler and CGIHTTPRequestHandler, the first serves > files from a directory, and the second executes CGI scripts. > > > > Two new handlers could be included in the standard library : > > > > - Web

[Python-ideas] Adding additionnal common request handlers to http.server

2020-08-24 Thread Simon
The standard library module http.server already has 2 request handlers, with SimpleHTTPRequestHandler and CGIHTTPRequestHandler, the first serves files from a directory, and the second executes CGI scripts. Two new handlers could be included in the standard library : - WebhookRequestHandler : Wou

[Python-ideas] New use for the 'in' keyword.

2019-03-10 Thread Simon
Python's 'in' keyword has already several use cases, whether it's for testing inclusion in a set, or to iterate over that set, nevertheless, I think we could add one more function to that keyword. It's not uncommon to see star imports in some sources. The reason that people use star imports are ma

[Python-ideas] PEP 8 update on line length

2019-02-18 Thread Simon
Hello, I'd like to propose an update to PEP8. Indeed, the 80 characters per line guideline is, I feel, outdated. I understand the need for it, back when monitors were small, and everyone coded on terminals, but nowadays, I feel like that guideline is more of a hinderance, and that it promotes poo

[Python-ideas] Possible PEP regarding the use of the continue keyword in try/except blocks

2019-01-05 Thread Simon
I was writing some python code earlier, and I noticed that in a code that looks somwhat like this one : try: i = int("string") print("continued on") j = int(9.0) except ValueError as e: print(e) >>> "invalid literal for int() with base 10: 'string'" this c

Re: [Python-ideas] AMEND PEP-8 TO DISCOURAGE ALL CAPS

2019-01-04 Thread Noah Simon
Looking at the arguments regarding rendering existing code non-PEP-8-compliant, I think if we were to make this change it should be made in Python 4.0, or whatever the next backwards-incompatible version will be. However, personally I disagree with the fundamental assertion that ALL_CAPS is alw

Re: [Python-ideas] Asynchronous friendly iterables

2018-08-20 Thread Simon De Greve
Ok, as I thought I was missing something quite important in the process. Thanks to everybody in here. Le lun. 20 août 2018 à 15:53, Joao S. O. Bueno a écrit : > On Mon, 20 Aug 2018 at 04:49, Chris Angelico wrote: > > > > On Mon, Aug 20, 2018 at 5:34 PM, Simon De Greve > w

Re: [Python-ideas] Asynchronous friendly iterables

2018-08-20 Thread Simon De Greve
tant feature of the lib (which is apparently the case here). Le lun. 20 août 2018 à 09:29, Nathaniel Smith a écrit : > On Mon, Aug 20, 2018 at 12:19 AM, Simon De Greve > wrote: > > Hello everyone, > > > > I'm quite new working with asyncio and thus maybe missing som

[Python-ideas] Asynchronous friendly iterables

2018-08-20 Thread Simon De Greve
Hello everyone, I'm quite new working with asyncio and thus maybe missing some things about it, but wouldn't it be quite easier to have some iterables to support async for loops "natively", since asyncio is now part of the Stdlib? I've tried to work with asyncio while using discord.py, and has so

Re: [Python-ideas] Async Lambda syntax

2018-05-18 Thread Noah Simon
Hello all, I was developing a script using an asyncio-based API, when I came across the need to define an asynchronous lambda. I found this syntax does not currently exist. Obviously I could have (and did) just write a regular coroutine, but for simple one-line functions and such, I think an asy

Re: [Python-ideas] JavaScript-Style Object Creation in Python (using a constructor function instead of a class to create objects)

2017-05-14 Thread Simon Ramstedt
On Sunday, May 14, 2017 at 3:05:46 AM UTC-4, Steven D'Aprano wrote: > > On Sun, May 14, 2017 at 04:07:44AM +, Simon Ramstedt wrote: > > Hi, do you have an opinion on the following? > > Hi, and welcome, and of course we have an opinion! This is Python-Ideas, &

Re: [Python-ideas] JavaScript-Style Object Creation in Python (using a constructor function instead of a class to create objects)

2017-05-14 Thread Simon Ramstedt
Hi, thanks a lot for your feedback! On Sun, May 14, 2017, 00:54 Brendan Barnwell wrote: > On 2017-05-13 21:07, Simon Ramstedt wrote: > > Hi, do you have an opinion on the following? > > My general opinion is that imitating JavaScript is almost always a > bad > idea

[Python-ideas] JavaScript-Style Object Creation in Python (using a constructor function instead of a class to create objects)

2017-05-13 Thread Simon Ramstedt
y return z return self or alternatively *multiline lambdas*: def MyClass(x): self = ParentClass() self.my_method = (y): z = x + y return z return self Cheers, Simon ___ Python-ideas m

Re: [Python-ideas] What about regexp string litterals : m".*" ?

2017-03-29 Thread Simon D.
* Simon D. [2017-03-28 09:56:05 +0200]: > The str integrated one also, but maybe confusing, which regexp lib is > used ? (must be the default one). > Ok, this was a mistake, based on JavaScript memories… There is no regexp aware functions around str, but some hint to go find your hap

Re: [Python-ideas] What about regexp string litterals : m".*" ?

2017-03-28 Thread Simon D.
a JavaScript-like syntaxe would be great, and I feel it as asking too much… : - it would naturally be highlihted differently ; - it would not be the first (happy) similarity (https://hackernoon.com/javascript-vs-python-in-2017-d31efbb641b4#.ky9it5hph) - its a working integration, including flag matte

Re: [Python-ideas] What about regexp string litterals : re".*" ?

2017-03-28 Thread Simon D.
teral notation. And if only the default one does, it would still be won for the beginers, and the majority of persons using the stdlib. -- Simon Descarpentries +336 769 702 53 http://s.d12s.fr ___ Python-ideas mailing list Python-ideas@python.org htt

[Python-ideas] What about regexp string litterals : re".*" ?

2017-03-27 Thread Simon D.
e slower than string-based workflow (like .startswith) but regexps can do the most and the least, so they are rapide to come up with, once you started to think with them. As Python philosophy is to spare brain-cycles, sacrificing CPU-cycles, allowing to easily use regexps is a brain-cycle savior t

[Python-ideas] How to respond to trolling (Guido van Rossum)

2017-01-11 Thread Simon Lovell
I feel I have to respond to this one. More than half of what I suggested could have and should be implemented. In particular the truthiness of non-boolean data and the lack of a reasonable SQL syntax. Several other points have been discussed endlessly on the internet but without a satisfactor

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Simon Lovell
Oh one last thing (I hope), the argument for having the current slice notation by Dijkstra, that it looks messy to have a loop where the contents are never executed or can no longer be executed is ridiculous! That *should* look messy. for range(1,1): means executing once to me. If you had 1 bas

Re: [Python-ideas] Python Reviewed

2017-01-09 Thread Simon Lovell
Hi Kyle, I don't see the harm caused from having a do-while construct. Not the most used construct but it is sometimes useful and not having it means you need to either have a first time through marker or a break at the end of a "while True:" loop. I would say that None should also be non-b

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Simon Lovell
o have the block closing delimiters this way, is the need for a keyword (could be a command line option) really the objection? I'll have a detailed look at your colon link a bit later. On 10/01/17 09:26, Chris Barker wrote: On Mon, Jan 9, 2017 at 5:12 PM, Simon Lovell <mailto:simo

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Simon Lovell
Thanks for the feedback guys. A few quick comments: Re: Colons. I'm sure I've seen that FAQ before. I may be arrogant but I can't take it seriously. Being "slightly" easier to read is hardly a reason for a mandatory structure. Re: PEP249. I thought I'd detailed quite a bit of what I thought s

Re: [Python-ideas] Python reviewed

2017-01-09 Thread Simon Lovell
than "Re: Contents of Python-ideas digest..." Today's Topics: 1. Re: PEP 540: Add a new UTF-8 mode (INADA Naoki) 2. Python Reviewed (Simon Lovell) 3. Re: Python Reviewed (Chris Angelico) -- Message

[Python-ideas] Python Reviewed

2017-01-09 Thread Simon Lovell
Python Reviewed Having used a lot of languages a little bit and not finding satisfactory answers to these in some cases often asked questions, I thought I'd join this group to make a post on the virtues and otherwise of python. The Good: Syntactically significant new lines Syntactical

Re: [Python-ideas] Easily remove characters from a string.

2016-10-22 Thread Simon Mark Holland
. Thank you all for your time. On 23 October 2016 at 02:45, David B wrote: > I would use list comprehension even if there were some other way to > translate as it is straight forward. > > On 10/22/16, Simon Mark Holland wrote: > > Having researched this as heavily as I am capabl

[Python-ideas] Easily remove characters from a string.

2016-10-22 Thread Simon Mark Holland
ve not seen discussion of this before, but if there is such a discussion I would welcome being directed to it. Thank you for your time. Simon ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/