been worked on at the Core dev sprint that's currently winding down.
But the quoting won't change.
--
--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-c
t; To unsubscribe send an email to python-ideas-le...@python.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/MJ7JHYKHKB2T4SCFV4TX4IMKUANUAF5B/
> Code of Conduct: http://p
deas@python.org
> To unsubscribe send an email to python-ideas-le...@python.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/H5252OAGH2IWEVQ26F2OWNQZC
kwargs inside functions and methods:
>
>
> def method(self, **kwargs):
> spam, eggs, **kw = **kwargs
> process(spam, eggs)
> super().method(**kw)
>
>
> --
> Steve
> ___
>
On Sat, Jul 18, 2020 at 9:11 PM Christopher Barker
wrote:
>
>
> On Sat, Jul 18, 2020 at 1:43 PM Guido van Rossum wrote:
>
>> Yes please.
>>
>
> Yes to what, exactly?
>
> -CHB
>
> FWIW, IIRC the “bundle values in a single parameter” predates the demise
Yes please.
FWIW, IIRC the “bundle values in a single parameter” predates the demise of
__getslice__. It probably was meant for dict keys primarily (no surprise
there). The bundling would have been easier for the C API — __getitem__ is
as old as Python there.
On Sat, Jul 18, 2020 at 10:49 Steven
That seems pretty clear — presumably it follows the lead of frozenset and
tuple.
On Tue, Jul 21, 2020 at 21:45 Todd wrote:
> What, exactly, is frozen? My understanding is that one problem with
> frozen dicts in the past is deciding exactly what is mutable and what is
> immutable. Can you
A philosophical problem with this is proposal is that it takes a notation
that is processed by the bytecode compiler and makes it dependent on user
code to be imported from the stdlib. We only do that in rare cases — IIRC
the only other case is ‘import’ calling ‘__import__()’. This reversal of
ill talking
> about implementing this using a new class. However, most people who
> support the use of labelled indexing.and expressed an opinion support a
> keyword argument-based approach.
> ___
> Python-ideas mailing list -- python-i
:
> On Fri, Jul 31, 2020 at 7:34 AM Guido van Rossum wrote:
>
>> So maybe we need to add dict.ordered() which returns a view on the items
>> that is a Sequence rather than a set? Or ordereditems(), orderedkeys() and
>> orderedvalues()?
>>
>
> I'm still
On Mon, Aug 3, 2020 at 2:35 PM Todd wrote:
> On Mon, Aug 3, 2020, 17:13 Guido van Rossum wrote:
>
>> On Mon, Aug 3, 2020 at 1:49 PM Christopher Barker
>> wrote:
>>
>>>
>>> Yes, that would be correct. However, the function could instead be
>>>
class C:
def __getitem__(self, index): ...
c = C()
then presumably calling `c[1, index=2]` would just be an error (since it
would be like attempting to call the method with two values for the `index`
argument), and ditto for `c[1, 2, 3, index=4]`. The only odd case might be
`c[index=
Maybe get-type-hints can be refactored to make writing such a function
simpler. IIRC the part that takes a single annotation and evaluates it is a
private function.
On Tue, Aug 4, 2020 at 12:57 David Mertz wrote:
> This definitely feels to me like though if an oddball case that "write
> your
On Wed, Aug 5, 2020 at 6:42 PM Steven D'Aprano wrote:
> On Wed, Aug 05, 2020 at 06:15:22PM -0700, Guido van Rossum wrote:
> > On Wed, Aug 5, 2020 at 5:55 PM Steven D'Aprano
> wrote:
>
> > > That require two different rules for decorators:
> > >
> > > @
is includes making up your
own dunders), which means that technically the implementation could do
whatever it wants -- but since this is Python we probably want to accept
that it's called for every attribute, whether it smells like a descriptor
or not, and it would be nice to fix the docs.
ted.
>
Alas, it hasn't. Language design is not an exact science, and my gut still
tells me that inline exceptions are a bad idea.
--
--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-ca
On Fri, Aug 7, 2020 at 6:02 PM Greg Ewing
wrote:
> On 4/08/20 9:12 am, Guido van Rossum wrote:
> > then presumably calling `c[1, index=2]` would just be an error (since it
> > would be like attempting to call the method with two values for the
> > `index` argument),
>
On Fri, Aug 7, 2020 at 10:44 AM Rob Cliffe
wrote:
>
> On 07/08/2020 16:58, Guido van Rossum wrote:
>
> On Fri, Aug 7, 2020 at 8:15 AM David Mertz wrote:
>
>> I think getting Guido on board would be a huge step. Python has added
>> quite a bit of new syntax si
This thread seems light on real use cases. I know there are people eager to
have integer generics, since they are essential for typing numpy, pandas,
tensorflow and friends. And so there are good proposals floating around for
this on typing-sig; I expect implementations within a year.
But integer
So maybe we need to add dict.ordered() which returns a view on the items
that is a Sequence rather than a set? Or ordereditems(), orderedkeys() and
orderedvalues()?
On Fri, Jul 31, 2020 at 05:29 Ricky Teachey wrote:
> On Fri, Jul 31, 2020, 2:48 AM Wes Turner wrote:
>
>> # Dicts and DataFrames
ition, addition, linear problem solving, determinant.")
On Thu, Aug 13, 2020 at 9:04 PM Stephen J. Turnbull <
turnbull.stephen...@u.tsukuba.ac.jp> wrote:
> Guido van Rossum writes:
>
> > I was going to say that such a matrix module would be better of in
> > PyPI, but
d an email to python-ideas-le...@python.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/FARJRNHNLNGRVJA3ITSUSAJCXOUUYKA2/
> Code of Conduct: http://python.or
On Wed, Aug 5, 2020 at 12:25 AM Dominik Vilsmeier
wrote:
> On 04.08.20 22:05, Guido van Rossum wrote:
>
> Maybe get-type-hints can be refactored to make writing such a function
> simpler. IIRC the part that takes a single annotation and evaluates it is a
> private function.
&g
Maybe I’m lacking context, but I don’t understand the proposal. Can you
explain the semantics and syntax you have in mind in more detail? How do
you get from the first example (@my_property etc.) to the second (def name,
def set_name)?
—Guido
On Thu, Aug 6, 2020 at 01:13 wrote:
> I think a
On Thu, Aug 6, 2020 at 01:00 Stephen J. Turnbull <
turnbull.stephen...@u.tsukuba.ac.jp> wrote:
> However, we would probably not want to burden all loops with the
> exception-handling machinery, so the compiler would have to do some
> hacky backtracking (I doubt that the arbitrary lookahead needed
be useful -- if it's infrequently, Chris B's own solution using islice() on
the items() view looked pretty decent to me, and not that hard to come up
with for someone who made it that far. For the former I expect that sooner
or later someone will write a PEP and it will be accepted (assuming the PEP
doe
.
Another solution could be to make dict.ordered() fail if there are deleted
keys. But that's not a great experience either.
All in all I retract this idea.
On Fri, Jul 31, 2020 at 5:31 PM Stestagg wrote:
> On Sat, 1 Aug 2020 at 00:32, Guido van Rossum wrote:
>
>> If true this wou
Cs. I don't want to get into a similar situation with Set and
Sequence, ever.
And even though currently they *don't* have overlapping operations, the
concrete types `list` and `set` *do* run into this kind of thing for
comparison operators -- lists (and tuples) compare itemwise until a
difference is foun
On Fri, Jul 31, 2020 at 7:59 PM Steven D'Aprano wrote:
> On Fri, Jul 31, 2020 at 04:08:43PM -0700, Guido van Rossum wrote:
> [...]
> > I'm guessing that indexing by 0, if it were possible, would be a
> convenient
> > idiom to implement the "first item" op
: if the decorator raises, the name
remains unbound.)
> @decorator over a binding `target = expression`:
>
> - bind `target = decorator("target", expression)`
>
> So we're adding significant complexity to the concept of "decorator".
>
(That said, I'm not a
On Mon, Jun 29, 2020 at 21:30 MRAB wrote:
> On 2020-06-30 02:14, Steven D'Aprano wrote:
> [snip]
> > Counter-proposal: hex escapes allow optional curly brackets, similar to
> > unicode name escapes. You could even allow spaces within the braces, for
> > grouping:
> >
> > # Existing:
> >
thon.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/BZTYVERLYDWPMW2QKSMDWXRRL3DUBSDC/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
&
I think you all should get together and come up with a good implementation,
and then petition Raymond Hettinger. Or maybe there is an existing open
source 3rd party project that has code you can copy? I don’t recall if
random has a C accelerator, but if it does, you should come up with C code
as
e and energy be better aimed at fixing the standard rather than
> making Python's JSON encoder broken by default?
>
You're kidding, right?
--
--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-singul
On Sun, Jun 21, 2020 at 02:53 M.-A. Lemburg wrote:
> On 21.06.2020 01:47, Guido van Rossum wrote:
> > Hm, I remember Greg's free threading too, but that's not the idea I was
> > trying to recall this time. There really was something about bytecode
> > objects being lo
Steven just likes an argument. Nobody has ever taken the idea of a standard
for language in comments seriously. It Just doen come up.
On Fri, Jun 26, 2020 at 18:35 Bernardo Sulzbach <
berna...@bernardosulzbach.com> wrote:
> On Fri, Jun 26, 2020 at 9:43 PM Steven D'Aprano
> wrote:
>
>> I dislike
Please read PEP 505 before rehashing this old idea.
On Sat, Jun 27, 2020 at 06:35 Daniel. wrote:
> When I need to traverse nested dicts, is a common pattern to do
>
> somedict.get('foo', {}).get('bar', {})
>
> But there is no such equivalent for arrays, wouldn't be nice if we can
> follow
>
>
n-ideas-le...@python.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/CB7AS43PNVNVGCR4VLE3ML76UMMFMS2P/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Gu
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@python.org
To unsubscrib
I like where this is going. It would be nice if certain constants could
also be loaded from RO memory.
On Mon, Jun 22, 2020 at 00:16 Inada Naoki wrote:
> On Mon, Jun 22, 2020 at 12:00 AM Guido van Rossum
> wrote:
> >
> >
> > I believe this was what Greg Stein's idea
rently stops at the first matching block it comes
> to, not the best match out of all blocks. This is meant to make it easier
> to understand the “flow” of the statement, but it might be preferable to
> execute the block associated with the best match, though this would
>
the platform with the fastest
> locking primitive (Windows at the time) it slowed down single-threaded
> execution nearly two-fold.
>
> Guido also referenced this write-up from Greg:
> https://mail.python.org/pipermail/python-dev/2001-August/017099.html
>
> I hope this helps
= (len "abc")
^
SyntaxError: invalid syntax
>>>
I think that strikes a reasonable balance between usability and reduced
detection of common errors.
I could also dial it back a bit, e.g. maybe it's too much to allow 'C().foo
x' and we should only allow dotted names
n how to best structure your gradual
migration within asyncio's current limitations, rather than trying to
propose deep changes to the standard library.
Sorry the news is not better, but you will be better off this way.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is
ad, so we can lay this
one to rest.)
All in all, it's clear that there's no future for this idea, and I will
happily withdraw it.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-us
would seem to have no choice
but to print the returned value -- the REPL has no indication that it came
from `del`.
--
--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
ntaxError in statement mode, it
> would simply produce a different ast node:
>
> * `del x` -> `Delete(x)` (as `x := 0` -> SyntaxError)
> * `(del x)` -> `Expr(DeleteExpr(x))` (as `(x := 0)` ->
> `Expr(NamedExpr(...))`)
>
> Eric
>
> On Fri, 12 Jun 2020 at 17:21,
-le...@python.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/RYMLY4IVTCTIXZRXQAVLBKO4ZQAEH3WG/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Ro
But adding an optional parameter to an existing dunder is pretty much the
worst choice. Every existing method of that name would have to be altered,
or you’d end up with horrible code to cope with it — either catching
exceptions or introspection.
On Fri, Jul 24, 2020 at 10:35 Bernat Gabor wrote:
interesting idea. It has always vaguely bothered me that `*args`
gives a tuple while `**kwds` gives a dict. Unfortunately it's impossible to
change without breaking tons of existing code, since things like
`kwds.pop("something")` have become a pretty standard idiom to use it.
--
--Guido
Hello Hans,
This list is more for ideas related to Python the language.
For the website, each page on python.org has a link at the bottom to the
tracker where you can submit requests for improvements and PRs for the
website itself.
—Guido
On Thu, Jul 16, 2020 at 04:31 Hans Ginzel wrote:
>
I think it’s a reasonable idea and encourage you to start working on a
design for the API and then a PRP. It would help if someone looked into a
prototype implementation as well (once a design has been settled on).
On Thu, Jul 16, 2020 at 03:31 Steven D'Aprano wrote:
> On Wed, Jul 15, 2020 at
On Tue, Jul 28, 2020 at 05:42 Thiago Carvalho D' Ávila <
thiagocav...@gmail.com> wrote:
> The idea here is to use the same operator already used to type-hint the
> return of functions `->` to define the return of a Callable.
>
> * Current syntax:
>
> Callable[[ArgumentList], ReturnType]
>
> eg.
>
Rest assured this is not a problem. In any case it’s the compiler, not the
parser, that generates the bytecode, from the AST. The compiler always has
the full AST available before it is asked to generate any bytecode. The new
parser just allows more flexible syntactic constructs, esp. “soft
On Wed, Jul 29, 2020 at 02:51 Mathew Elman wrote:
>
> .
>
>> If it *is* useful, it occurs to me that (1) this looks a lot like the
>> try ... except ... pattern, and (2) breaks are generally perceived as
>> exceptional exits from a loop. Instead of "if break [LABEL]", "except
>> [LABEL]" might
On Wed, Jul 29, 2020 at 07:01 Mathew Elman wrote:
>
>
> On Wed, 29 Jul 2020 at 14:42, Guido van Rossum wrote:
>
>> On Wed, Jul 29, 2020 at 02:51 Mathew Elman
>> wrote:
>>
>>>
>>> .
>>>
>>>> If it *is* useful, it occurs to
ved at
>> https://mail.python.org/archives/list/python-ideas@python.org/message/MLRFS6RO7WF2UAEOS4YMH2FXRQHJUGWU/
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
> ___
> Python-ideas mailing list -
t;What's the difference between def and fun?
> Which should I use?", doesn't make life easier for teachers.
>
>
> --
> Steven
> ___________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...
3 is most likely "no" due to the
> costs, but it would be nice if someone could weigh in on this part. Maybe
> there's some workaround.
>
If you were asking me to weigh in *now* I'd say "no", if only because you
haven't explained the reason why this is needed. And if you ha
as been done before for C/C++ (
> https://people.cs.umass.edu/~emery/pubs/dthreads-sosp11.pdf), but for
> different reasons.
>
> On Mon, Jul 20, 2020 at 8:16 PM Guido van Rossum wrote:
>
>> On Mon, Jul 20, 2020 at 4:09 PM Wenjun Huang
>> wrote:
>>
>>>
What purpose do you have in mind for making this distinction? Even if it
could be done easily (which I doubt), why would this be useful?
On Sun, Jul 19, 2020 at 19:01 wrote:
> Hello,
>
> The API provided by PEP 445 makes it possible to intercept allocation
> requests through hooks, but it seems
You have to find a core dev who is willing to act as a Sponsor. I recommend
asking Steven d’Aprano (but I do not know if he’s interested). Until then,
hash out the precise spec for the idea here. Coming up with a solid
motivation is also important.
On Tue, Jul 21, 2020 at 01:15 Stefano Borini
I think this cannot just be considered a bug fix, and it seems somewhat
fundamental (catching arbitrary exceptions is controversial), so I
recommend finding a core dev to sponsor a PEP. (Or finding one who thinks
it is obviously a bug and will approve a PR.)
On Tue, Jul 21, 2020 at 04:43 Dominik
Did you study PEP 416 (frozendict) and PEP 603 (frozenmap)?
--
--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-wo
On Thu, Jul 30, 2020 at 22:23 Greg Ewing
wrote:
> On 31/07/20 4:04 am, Christopher Barker wrote:
> > (Side note: why ARE the views provided by methods, rather than
> > properties?)
>
> Probably because they construct objects, and are therefore
> somewhat more expensive than is usually expected
On Mon, Jul 20, 2020 at 03:22 Jonathan Fine wrote:
> This is a continuation of my previous post to this thread.
>
> Python's FOR ... ELSE ... , Raymond Hettinger has told us, has origins in
> some ideas of Don Knuth.
>
That’s news to me (both that it’s due to Knuth and that Raymond said so). I
Also, let me be clear that this feature will never be added to the language.
On Mon, Jul 20, 2020 at 07:36 Guido van Rossum wrote:
> On Mon, Jul 20, 2020 at 03:22 Jonathan Fine wrote:
>
>> This is a continuation of my previous post to this thread.
>>
>> Python's FO
es based on that.
FWIW in my example I sorted the keywords, so that `d[x=1, y=2]` and `d[y=2,
x=1]` construct the same internal key. But for some use cases it might be
better if these constructed *different* internal keys. For example, Caleb's
Struct class, when used to construct a dataclass, woul
that for xarray it is important to distinguish between
`d[day=3, detector=4]` and `d[detector=4, day=3]`? If we just passed the
keyword args to `__getitem__` as an extra `**kwds` argument (which
preserves order, since Python 3.6 at least), that should work, right? If
not, can you clarify?
--
can already do with a class definition and annotations). And without static
checking this isn't going to be very popular.
If and when we have `__getitem__` with keyword args we can start thinking
about how to best leverage it in type annotations -- I would assume that
describing axes of objects like
quot; is a naughty term. (I find
"runtime use of annotations" much naughtier. :-)
--
--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/>
__
On Sun, Aug 16, 2020 at 5:45 AM Steven D'Aprano wrote:
> On Mon, Aug 17, 2020 at 12:32:08AM +1200, Greg Ewing wrote:
> > On 16/08/20 11:49 am, Guido van Rossum wrote:
> > >SEMANTICS OF NO ARGUMENTS
> > >I can see two basic ways of
On Sat, Aug 15, 2020 at 10:00 PM Steven D'Aprano
wrote:
> On Sat, Aug 15, 2020 at 08:26:10PM -0700, Guido van Rossum wrote:
>
> > Are you saying that for xarray it is important to distinguish between
> > `d[day=3, detector=4]` and `d[detector=4, day=3]`? If we just passed th
will probably prefer `obj.__dict__` over `vars(obj)` too :-)
>
Not a valid analogy.
--
--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/>
___
On Mon, Dec 28, 2020 at 11:36 PM Christopher Barker
wrote:
> On Mon, Dec 28, 2020 at 12:33 PM Guido van Rossum
> wrote:
>
>> On Mon, Dec 28, 2020 at 12:15 PM Christopher Barker
>> wrote:
>>
>>> Though frankly, I would rather have had it use .items() -- see
he caller didn't bind it to keep hold of it.
>
Sounds like one of you is describing current semantics and the other is
explaining the proposed new semantics. :-)
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using
t; Inada Naoki
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://m
er problems, in addition to
giving us a cleaner way to solve the value capture problem.
--
--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@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas
gt; https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/VKHB722PLUMZJPCMHEM2MB4HBEDI463Y/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.or
on-ideas@python.org/message/WJXFEVKR3IU7BAI57DFUUZZYS6UA3P6N/
> 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-using-they-as-a-singular-pronoun-can-change-the
Maybe you could start by writing this as a separate decorator, to be
applied on top of the data class decorator?
On Wed, Dec 9, 2020 at 05:38 sam bland wrote:
> In response to the additional work required to convert the new python
> dataclass using the json encoder I propose an __encode__
y familiar with that
field to be able to point you to examples. Hopefully there are readers here
who can. (Nate?)
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as
Council (not me).
(Why do I propose "let" and not "const"? It seems "let" has become the
industry standard language. The other day I saw a reference to a LET()
function in Excel. :-)
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)
I recommend taking this to typing-sig...
On Mon, Nov 23, 2020 at 19:18 David Foster wrote:
> On 11/22/20 10:15 AM, Guido van Rossum wrote:
> > - We intentionally don't support things like `isinstance(x, List[str])`
> > because that would require checking all the items with `
r I think because it encourages python users to
> annotate their functions.
>
Indeed. Shantanu did some quick counting and found that after 'Any' and the
types covered by PEP 585, Callable is by far the most used:
https://bugs.python.org/issue42102#msg381155
--
--Guido van Rossum (python.org/~guid
ality.
>
Hm, but using Protocol you can already express every callable type. We
could duplicate all of the complexity of 'def' parameter lists into the
type notation, but it would be very complex. So this requirement is at
least debatable (I'm not actually sure how I feel about it).
--
--G
; readable when lots of nesting is involved, but I suspect that's just
> because the type is just complicated. :) )
>
You could simplify it by judicious application of type aliases.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<ht
were to drive this through quickly enough we could even make it apply to
pattern matching captures. (Or maybe pattern matching could get these
semantics anyway.)
My bus is here, so that's it,
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministin
common
case). The rule would be something like "if there's no /, a / is assumed at
the end", and also "in positional args, the syntax is [name ':'] type_expr
['=' default_expr]."
Gotta go,
On Sun, Nov 29, 2020 at 12:02 AM Andrew Svetlov
wrote:
> On Sun, Nov 29, 2020 at 1:49 AM G
g/archives/list/python-ideas@python.org/message/6UAJRDKVJNZ7EACXUTUCKSGAEYPJHME5/
> 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-using-they-as-
harm inflicted by dropping support for "__init__" in module names will
> be more than compensated by long-term benefits of enabling turnkey Python
> application distribution. But that's my personal take and I have no solid
> evidence to justify that claim. The evidence that PathFind
g this either. Can you give an example of something that
doesn't work with Enum (and shouldn't work) but should work with
NamedValues?
Finally, why the plural in the name, where Enum and friends all have
singular names?
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why
uated values when get_type_hints is
> called?
>
> 2. Something I haven't considered? Please let me know.
>
>
> Paul
> ___
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@py
On Thu, Dec 10, 2020 at 1:22 PM Steven D'Aprano wrote:
> On Thu, Dec 10, 2020 at 10:57:32AM -0800, Guido van Rossum wrote:
>
> > All I have to add is that I am appalled that people actually write `from
> > foo import __init__`
>
> I too would be appalled if that w
a few times.) I
can't comment on the exact semantics or implementation (though I'd prefer
it if it didn't have to run a subprocess).
IDLE should probably monkey-patch this so it does something reasonable in
its shell window.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(w
It’s a usability issue; mappings are used quite differently than sequences.
Compare to class patterns rather than sequence patterns.
On Sat, Nov 14, 2020 at 22:04 David Foster wrote:
> From PEP 636 (Structural Pattern Matching):
> > Mapping patterns: {"bandwidth": b, "latency": l} captures
David Foster wrote:
> On 11/14/20 10:17 PM, Guido van Rossum wrote:
> > It’s a usability issue; mappings are used quite differently than
> > sequences. Compare to class patterns rather than sequence patterns.
>
> I just found the following explanation from the superceded PEP
Go for it. This is a pretty minor issue but we want to get it right. Data
is helpful.
On Tue, Nov 17, 2020 at 06:58 David Foster wrote:
> On 11/15/20 12:11 AM, Steven D'Aprano wrote:
> > It would be good if the PEP gave a survey of the practical experience of
> > other languages with pattern
thread on
typing-sig and we'll discuss it.
--
--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 m
601 - 700 of 827 matches
Mail list logo