[Python-ideas] Re: writelines2?

2021-07-13 Thread Guido van Rossum
/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/2SYIBL275IIHMSPAT6J4K3TIA7HXEKV5/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-24 Thread Guido van Rossum
On Fri, Sep 24, 2021 at 19:49 Christopher Barker wrote: > Alternatively, take the approach taken with distutils and setuptools— > officially accept that a full featured test framework will be left to third > parties. > I think this is by far the best option. Pytest can evolve much faster than

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-25 Thread Guido van Rossum
On Fri, Sep 24, 2021 at 22:07 Stephen J. Turnbull < stephenjturnb...@gmail.com> wrote: > Guido van Rossum writes: > > > I think this is by far the best option. Pytest can evolve much faster > than > > the stdlib. > > Is there no room for making it easier to do

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-25 Thread Guido van Rossum
On Sat, Sep 25, 2021 at 00:56 Steven D'Aprano wrote: > On Fri, Sep 24, 2021 at 11:23:00PM -0700, Guido van Rossum wrote: > > > > Is there no room for making it easier to do this with less invasive > > > changes to the stdlib, or are Steven d'A's "heroic mea

[Python-ideas] Re: PEP Draft: Power Assertion

2021-09-25 Thread Guido van Rossum
he Groovy community, also used by > projects such as `Spock`_. > > On top of that, it is very much needed in the Python community as well: > > * `Power Assertion was explicitly requested`_ as a feature in the > `Nimoy`_ testing framework > * There's a `similar feature

[Python-ideas] Re: Implementing string unary operators

2021-10-12 Thread Guido van Rossum
ke to remind various other posters that sarcasm is *not* a good way to welcome newbies. The name of the list is python-ideas, not python-ideas-to-shoot-down-sarcastically. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/

[Python-ideas] Re: Implementing additional string operators

2021-10-13 Thread Guido van Rossum
ython.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/UGRD4QCDGRPOOCDMLPZ7EXWJFKM22AGO/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)*

[Python-ideas] Re: dict_items.__getitem__?

2021-10-10 Thread Guido van Rossum
You have to check the C code to be sure, but IIRC the latest dict implementation has a dense array of the values in insert order, and the hash table (which has gaps) contains indexes into the values array. So you could easily index into the values array (which I believe also has the keys) in O(1)

[Python-ideas] Re: Unpacking in tuple/list/set/dict comprehensions

2021-10-16 Thread Guido van Rossum
ause unlike lists the over-allocation isn't permanent." Finally, the bytecode generated for (*a, *b) creates a list first and then turns that into a tuple (which will be allocated with the right size since it's known at that point). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(

[Python-ideas] Re: Accessing target name at runtime

2021-10-15 Thread Guido van Rossum
I suspect there won’t be enough support for this proposal to ever make it happen, but at the very least could you think of a different token? The three left arrows just look too weird (esp. in the REPL examples, where they strongly seem to suggest a false symmetry with the ‘>>>’ prompt. How did

[Python-ideas] Re: Unpacking in tuple/list/set/dict comprehensions

2021-10-16 Thread Guido van Rossum
Seems sensible to me. I’d write the equivalency as for x in y: answer.extend([…x…]) On Sat, Oct 16, 2021 at 07:11 Erik Demaine wrote: > Extended unpacking notation (* and **) from PEP 448 gives us great ways to > concatenate a few iterables or dicts: > > ``` > (*it1, *it2, *it3) # tuple with

[Python-ideas] Re: Unpacking in tuple/list/set/dict comprehensions

2021-10-17 Thread Guido van Rossum
as you seemed to imply). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> ___ Python-ideas mailing list -- python-ideas@py

[Python-ideas] Re: Shorthand syntax for lambda functions that have a single parameter

2021-09-29 Thread Guido van Rossum
ython.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/K6ZOKOHBJQLCRDDWARTIPYGZB3IN25SG/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum

[Python-ideas] Re: Typing Callable Ellipsis -- support for type hints a la Callable[[int, float, ...], None]

2021-09-22 Thread Guido van Rossum
hon.org/archives/list/python-ideas@python.org/message/L6BTMIIMNSXX37YQA7J5VCOI7TOKOX5O/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how

[Python-ideas] Re: More efficient list copying

2021-10-02 Thread Guido van Rossum
ich operation is implemented most efficiently. Though you should just measure it for various N. Are you actually observing that people are doing this with regular lists? Don't people working with Big Data usually use Pandas, which is built on NumPy arrays and custom data structures? -- --Guido va

[Python-ideas] Re: Syntax for late-bound arguments

2021-10-24 Thread Guido van Rossum
lt arguments. (You could make something up that uses dynamic scoping, but that's a whole different can of worms.) -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-

[Python-ideas] Re: PEP7 may need to add a info

2021-12-03 Thread Guido van Rossum
Good catch! You can submit a PR or issue to the peps project in the Python organization on GitHub. On Fri, Dec 3, 2021 at 00:24 wrote: > Hi! > When I read PEP7 and check Cpython source code, I found a deficiency that > in https://www.python.org/dev/peps/pep-0007/#code-lay-out. > In this

[Python-ideas] Re: Runtime-accessible attribute docstrings

2021-11-18 Thread Guido van Rossum
+1 On Thu, Nov 18, 2021 at 09:31 Michael Foord wrote: > > > On Thu, 18 Nov 2021 at 04:38, Steven D'Aprano wrote: > >> On Wed, Nov 17, 2021 at 02:26:16PM -, tmkehrenb...@gmail.com wrote: >> >> > @dataclass >> > class A: >> > """Docstring for class A.""" >> > x: int >> >

[Python-ideas] Re: Adding pep8-casing-compliant aliases for the entire stdlib

2021-11-11 Thread Guido van Rossum
One thought: No. On Thu, Nov 11, 2021 at 05:41 Matt del Valle wrote: > So I was reading the docs for the `threading` module and I stumbled upon > this little note: > > Note: > > In the Python 2.x series, this module contained camelCase names for some > methods and functions. These are

[Python-ideas] Re: Add __len__ to ipaddress._BaseNetwork

2021-10-26 Thread Guido van Rossum
ssage archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/4OHZ6QZWDI3U2ADI5A36UU73OOXFOGJE/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing

[Python-ideas] Re: PEP 671 proof-of-concept implementation

2021-10-29 Thread Guido van Rossum
I’m with Steven. On Fri, Oct 29, 2021 at 06:22 Chris Angelico wrote: > On Fri, Oct 29, 2021 at 11:52 PM Steven D'Aprano > wrote: > > > Except that that's still backward-incompatible, since None is a very > > > common value. > > > > How is it backwards incompatible? Any tool that looks at

[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-10-25 Thread Guido van Rossum
und. Everywhere else in Python, undefined names are runtime errors (NameError or UnboundLocalError). -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-sing

[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-11-01 Thread Guido van Rossum
Agreed, class namespaces are weird. :-) On Sun, Oct 31, 2021 at 23:38 Chris Angelico wrote: > On Mon, Nov 1, 2021 at 5:15 PM Greg Ewing > wrote: > > > > On 1/11/21 4:59 am, David Mertz, Ph.D. wrote: > > > b = b > > > > I don't want to live in a universe where this could be anything > >

[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-10-25 Thread Guido van Rossum
t 25, 2021 at 10:49 AM Chris Angelico wrote: > On Tue, Oct 26, 2021 at 4:36 AM Guido van Rossum wrote: > > > > On Mon, Oct 25, 2021 at 10:28 AM Chris Angelico > wrote: > >> > >> [...] The two options on the table are: > >> > >> 1) Allow referen

[Python-ideas] Re: Syntax for late-bound arguments

2021-10-23 Thread Guido van Rossum
I like that you're trying to fix this wart! I think that using a different syntax may be the only way out. My own bikeshed color to try would be `=>`, assuming we'll introduce `(x) => x+1` as the new lambda syntax, but I can see problems with both as well :-). -- --Guido van Rossum (pyth

[Python-ideas] Re: PEP 671: Syntax for late-bound function argument defaults

2021-10-23 Thread Guido van Rossum
> fn2(defer: x) # look for local a, b within fn2() if needed > > # ... other stuff > > return x # return 8 here > > > > How would it know to look for a and b inside fn2's scope, instead of > looking for x inside fn2's scope? > I am worried that this si

[Python-ideas] Re: A memory map based data persistence and startup speedup approach

2022-02-20 Thread Guido van Rossum
> 严懿宸(文极) via Python-ideas writes: > > Currently, we’ve made it a third-party library and have been > > working on open-sourcing. Stephen J. Turnbull wrote: > Thank you! I guess "working on" means "the lawyers have it" so we'll > be patient. :-) > I'm not sure whether your purpose is to get

<    4   5   6   7   8   9