[Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-06-27 Thread Bernardo Sulzbach
On Sat, Jun 27, 2020 at 6:40 AM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > Keara Berlin writes: > > I wouldn't object to > > When writing English, write clearly and understandably. Consider > your audience -- many readers of your comments in Python sources > w

[Python-ideas] Re: Amend PEP-8 to require clear, understandable comments instead of Strunk & White Standard English comments

2020-06-26 Thread Bernardo Sulzbach
On Fri, Jun 26, 2020 at 9:43 PM Steven D'Aprano wrote: > I dislike Strunk and White, and don't follow it myself (except by > accident, as it were) but I've worked with neuro-atypical programmers > who found it really useful to have a common standard that they could > follow and reduce the uncerta

[Python-ideas] Re: Allow signal suppression

2020-06-25 Thread Bernardo Sulzbach
On Thu, Jun 25, 2020 at 5:09 PM Yonatan Zunger via Python-ideas < python-ideas@python.org> wrote: > Hey everyone, > > I've been developing code which (alas) needs to operate in a runtime > environment which is quite *enthusiastic* about sending SIGTERMs and the > like, and where there are critical

[Python-ideas] Re: Bringing the print statement back

2020-06-09 Thread Bernardo Sulzbach
If f and g are unary functions, f g 0 is evaluated as f(g(0))? Asking because you didn't mention composition. That is, could we have `print "hello", input "Name:"` instead of `print "hello", input("Name:")`? Overall, I am against this because I like the "explicitness" of using parenthesis for func

[Python-ideas] Re: len(path) == len(str(path))

2020-05-24 Thread Bernardo Sulzbach
"So I implemented `PurePath.__len__` as `str(len(path))`." Sure you meant len(str(path)), right? "Serhiy and Remi objected, because it might not be obvious that the length of the path would be the length of string." I find this _really_ unintuitive. If anything, I would expect len(p) to be the "de

[Python-ideas] Re: type hints : I'd like to suggest allowing unicode → as an alternative to ->

2020-05-22 Thread Bernardo Sulzbach
> > I believe I speak for a significant majority of professional programmers > when I say that eye-candy like this adds no value to the language for me. > It gives me no new capabilities, I don't see it making me more productive, > and we have syntax that works quite well already. > This speaks fo

[Python-ideas] Re: type hints : I'd like to suggest allowing unicode → as an alternative to ->

2020-05-17 Thread Bernardo Sulzbach
> > I would like to comment that the graphical presentation, at least in > IDEs/where the font can be controlled, can be achieved using fonts: > Precisely. Nicer than the arrow symbol, it would be to type "-" + ">" and get an arrow visually. The same can be done about getting >= as a single symbol

[Python-ideas] Re: IDEA: Allow override of all assignments of a built in type to be a different type

2020-03-05 Thread Bernardo Sulzbach
I've written my share of mathematical and physics software by now and arbitrary-precision rational numbers are hardly ever a good solution to problems you might be having. Paul Moore has mentioned how few keystrokes this syntax would actually save: add to this the fact that there are probably very

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

2019-01-04 Thread Bernardo Sulzbach
I disagree. Changing this in the PEP will make an absurd amount of code which is PEP-8 compliant no longer so. Also, the refactoring may not always be trivial as the lowercase names may already be in use. I'd suggest violating PEP-8 instead of trying to change it. _

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-10 Thread Bernardo Sulzbach
If the discussion gets to which SHA-2 should be used, I would like to point out that SHA-512 is not only twice the width of SHA-256 but also faster to compute (anecdotally) on most 64-bit platforms. ___ Python-ideas mailing list Python-ideas@python.org ht

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-07 Thread Bernardo Sulzbach
Would this change actually help people who need to use FIPS? Other than that this change would only decrease the already very small probability of a corrupted download hashing the same, which isn't a bad thing. If it could make some users' jobs easier, even if it by no means helps guaranteeing the

Re: [Python-ideas] Should Python have user-defined constants?

2017-11-21 Thread Bernardo Sulzbach
that if an object were mutable you would still be able to change its internal state. -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogiga...@gmail.com ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listi

Re: [Python-ideas] Run length encoding

2017-06-10 Thread Bernardo Sulzbach
On 2017-06-11 00:13, David Mertz wrote: Bernardo Sulzbach posted a much prettier version than mine that is a bit shorter. But his is also somewhat slower (and I believe asymptotically so as the number of equal elements in subsequence goes up). He needs to sum up a bunch of 1's repea

Re: [Python-ideas] Run length encoding

2017-06-10 Thread Bernardo Sulzbach
: [(k, sum(1 for _ in g)) for k, g in groupby(sequence)] However, it is slower than a "dedicated" solution. Additionally, I don't know if what you are proposing is generic enough for the standard library. -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogi

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

2017-05-13 Thread Bernardo Sulzbach
On 05/14/2017 01:53 AM, Brendan Barnwell wrote: On 2017-05-13 21:07, Simon Ramstedt wrote: Here are the pros and cons I could come up with for the proposed method: (+) Simpler and more explicit. I don't really see how that's simpler or more explicit. In one respect it's clearly less e

Re: [Python-ideas] Allow random.choice, random.sample to work on iterators

2016-11-30 Thread Bernardo Sulzbach
. -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogiga...@gmail.com ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Allow random.choice, random.sample to work on iterators

2016-11-30 Thread Bernardo Sulzbach
y choose to replace one of the "held" ones by it (with a diminishing probability). Assume this does not offer the same performance as loading everything into memory. But it isn't meant to do so, as if you need / can / want, you could just shove it all into a list and use wh

Re: [Python-ideas] Allow random.choice, random.sample to work on iterators

2016-11-30 Thread Bernardo Sulzbach
the idea, as long as it does not add too much overhead to currently existing code. It could be a special code path for reservoir sampling (I assume) for both functions (the first taking only one sample from the stream). -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogiga

Re: [Python-ideas] (no subject)

2016-11-28 Thread Bernardo Sulzbach
Overall, I already find Python's exceptions quite readable, and your suggestions propose some VERY long lines which would certainly wrap at a terminal. Maybe this should be an optional feature. -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogiga...@gmail.com ___

Re: [Python-ideas] Reverse assignment operators (=+, =-, =*, =/, =//, =**, =%)

2016-11-12 Thread Bernardo Sulzbach
On 2016-11-12 18:08, João Matos wrote: a =- c is the same as a = c - a This would break compatibility. a =- c is a = -c -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogiga...@gmail.com ___ Python-ideas mailing list Python

Re: [Python-ideas] PythonOS

2016-11-06 Thread Bernardo Sulzbach
that in a touchscreen? -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogiga...@gmail.com ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Leave off "else" in ternary expression

2016-10-28 Thread Bernardo Sulzbach
On 10/28/2016 01:28 PM, Todd wrote: The idea would be to allow this syntax: x = a if b Which would be equivalent to: x = a if b else x What if x has not been defined yet? -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogiga...@gmail.com

Re: [Python-ideas] INSANE FLOAT PERFORMANCE!!!

2016-10-11 Thread Bernardo Sulzbach
bout "Relevant performance improvement when sorting floating point numbers", a subject which is much clearer, less intrusive, and more professional than the one you used. Thanks for your efforts, nonetheless. -- Bernardo Sulzbach http://www.mafagafogigante.org/ mafagafogi

Re: [Python-ideas] if-statement in for-loop

2016-09-11 Thread Bernardo Sulzbach
On 09/11/2016 06:36 AM, Dominik Gresch wrote: So I asked myself if a syntax as follows would be possible: for i in range(10) if i != 5: body Personally, I find this extremely intuitive since this kind of if-statement is already present in list comprehensions. What is your opinion on this?

Re: [Python-ideas] Shuffled

2016-09-06 Thread Bernardo Sulzbach
On 09/06/2016 03:37 PM, Sven R. Kunze wrote: Besides being a silly argument, it's an interesting solution. Does it really work? I remember Microsoft utilizing a similar approach for their browser selection tool which led to a skewed probability distribution. Maybe, I wrong here though. Yes.

Re: [Python-ideas] Shuffled

2016-09-05 Thread Bernardo Sulzbach
On 09/05/2016 10:03 PM, Steven D'Aprano wrote: from random import shuffle shuffle(mylist) Why is that so important that it needs to be a built-in? In 15+ years of using Python, I've probably used shuffle() three or four times. Just adding to this. Sorting is a problem that comes up in almost

Re: [Python-ideas] From mailing list to GitHub issues

2016-08-13 Thread Bernardo Sulzbach
On 08/13/2016 03:44 PM, David Mertz wrote: I find email list VASTLY easier to deal with than any newfangled web-based custom discussion forum. Part of that is that it is a uniform interface to every list I belong too, and I can choose my own MUA. With all those web things, every site works a litt