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/K6ZOKOHBJQLCRDDWARTIPYGZB3IN25SG/
> Code of Conduct: http://pytho
it's a dumb idea :-)
>
At the very least it might lead to a recommendation based on which
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
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) t
I would also like 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
lists/python-ideas.python.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
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 you
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 t
r lists because 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/~gui
efinitely not dead (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 -
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 Ro
; a, b = 3, 5
> > 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?
er's
scope. It's no different than a function defined in the caller. I don't
think it would be a good substitute for late-binding default arguments.
(You could make something up that uses dynamic scoping, but that's a whole
different can of worms.)
--
--Guido van Rossum (p
reaking
new ground. 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
Oct 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 re
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/4OHZ6QZWDI3U2ADI5A36UU73OOXFOGJE/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~g
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 __defa
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
> > oth
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 deprecated
+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
>> > """Docstr
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 section,
__iadd__ pairwise. But I am not so keen,
because the ambiguity of `a, b, c += x`.
Perhaps someone can do some research and unearth real code that contains
series of += assignments that would become more readable by collapsing them
into a single line using the proposed construct.
--
--Guido van
llow top-level function calls to be written without parentheses,
but it was too hard to make it unambiguous (e.g. would "foo +1" mean
"foo(+1)" or "foo + 1"?)
--
--Guido van Rossum (python.org/~guido)
___
Python-idea
On Fri, Aug 31, 2018 at 4:04 AM, David Mertz wrote:
> On Thu, Aug 30, 2018 at 9:41 PM Guido van Rossum wrote:
>
>> On Fri, Aug 31, 2018 at 3:19 AM, Michael Selik wrote:
>>
>>> On Thu, Aug 30, 2018 at 5:31 PM James Lu wrote:
>>>
>>>> It would
nadian
actress named Samantha Quan.
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
elp prospective
authors based on the text they show us.
I have to admit that I've not followed the full context, but I recommend
that you try to see that other posters in this thread are trying to help
with kindness, not judging you or your skills
Gah! You are overthinking it. This idea is only worth it if it's dead
simple, and the version that Eric posted to start this thread, where !d
uses the repr() of the expression, is the only one simple enough to bother
implementing.
--
--Guido van Rossum (python.org/~
to
> the empty coffee pot.
>
> --
> Jonathan
>
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
_
k
> with YAML or perhaps something even simpler than either one.
>
I feel the same way. (Somebody was requesting extensive TOML support for
mypy and was also waving those PEPs in front of us.)
--
--Guido van Rossum (python.org/~guido)
__
lement new objects (without
> dependency to "Path")
> that are implementing the __fspath__ protocol.
>
> robert
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/pytho
dlock.
Nathaniel, would you be able to elaborate more on the issue of
backpressure? I think a lot of people here are not really familiar with the
concepts and its importance, and it changes how you have to think about
queues and the like.
--
--Guido van Rossum (python.org/~
ause
because there's no trouble with switching between expression-mode and
statement-mode. Also note that syntactically it is clearly a special form
of `def` statement -- it can even be decorated!
So let's review the proposal as a shorthand for defining a function and
immediate
e") the use case is just much narrower.
So unless we find more use cases, or until we can convince ourselves that
we can use `def (args): block` in all expression contexts, I guess it'll
have to remain an idea. Thank you though! It was a fascinating one.
--
--Guido van Rossum (python.org/~guido
ed with static type checking (PEPs 484, 526, 544, 561) it may be
PEP-worthy.
As a compromise, perhaps some discussion can take place in the issue
tracker of the repo (https://github.com/guettli/python-name2type-mapping)
Thomas created? If someone with PEP experience is interested they can guide
T
ns "__subclasses__() -> list of
> immediate subclasses"
>
> To fully figure out what it did, I had to read the source code to Python
> -- which really is not the best way to figure out what a function does;
> hence the request to document it (and indicate it's fut
ed
> with as.
>
> Thanks,
>
> David
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
The two are less connected than you seem to think.
On Thu, Nov 1, 2018 at 7:08 PM Alex Shafer wrote:
> I had actually managed to miss collections.defaultdict!
>
> I'd like to instead propose that a reference to that be added to the
> dict.setdefault docs. I can't imagine I'm the only one that ha
instance is created, while
setdefault() is used when inserting a value.
A major issue IMO with defaultdict is that if you try to *read* a
non-existing key it will be inserted.
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Pyt
them, I think other stdlib libraries are
not beholden to that behavior.)
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
dea. After all, we have
`list.extend(x)` ~~ `list += x`. The key conundrum that needs to be solved
is what to do for `d1 + d2` when there are overlapping keys. I propose to
make d2 win in this case, which is what happens in `d1.update(d2)` anyways.
If you want it the oth
x27; + 'a'.
For non-numbers we only require + to be associative, i.e. a + b + c == (a +
b) + c == a + (b + c).
That is satisfied for this proposal.
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.
x27;b': 3})
>
> At first I worried that changing base dict would cause confusion for the
> subclass, but Counter seems to share the idea that update and + are
> synonyms.
>
Great, this sounds like a good argument for + over |. The other argument is
that | for sets
erested in
sponsoring the PEP. And I'm not it. Is there a core dev who is interested
in sponsoring or co-authoring this PEP?
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman
x27;t in d2.
>
>
>
> --
> Steven
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (p
On Wed, Feb 27, 2019 at 11:18 PM Serhiy Storchaka
wrote:
> 27.02.19 20:48, Guido van Rossum пише:
> >
> > On Wed, Feb 27, 2019 at 10:42 AM Michael Selik
> > > <mailto:m...@selik.org>> wrote > The dict subclass
> collections.Counter overrides the
e of Conduct: http://python.org/psf/codeofconduct/
> >
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido
is highly non-obvious except if you've already encountered that
pattern before, while d1+d2 is what anybody familiar with other Python
collection types would guess or propose. And the default semantics for
subclasses of dict that don't override these are
d list + list, so this seems an unwarranted worry to me.
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
On Mon, Mar 4, 2019 at 12:12 PM Neil Girdhar wrote:
> On Mon, Mar 4, 2019 at 2:26 PM Guido van Rossum wrote:
> >
> > * Dicts are not like sets because the ordering operators (<, <=, >, >=)
> are not defined on dicts, but they implement subset comparisons for s
Honestly I would rather withdraw the subtraction operators than reopen the
discussion about making dict more like set.
On Mon, Mar 4, 2019 at 12:33 PM Neil Girdhar wrote:
> On Mon, Mar 4, 2019 at 3:22 PM Guido van Rossum wrote:
> >
> > On Mon, Mar 4, 2019 at 12:12 PM Neil G
g naming conventions or type annotations.
> Those two points make me uncomfortable with "+=" strictly behaving
> like ".update()".
>
And yet that's how it works for lists. (Note that dict.update() still has
capabilities beyond +=, since you can also invoke it with keyword args.)
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
gs):
> self.update(*argv, **kwargs)
> return self
>
> def copy(self):
> return self.__class__(self)
>
> A DIRTY HACK
> Not tested, using an assignment expression.
>dict_arg = (tmp := defaults.copy(), tmp.update(optio
nted
without hashing, e.g. using a balanced tree, so that it could support
unhashable keys).
If there's doubt about this anywhere, we could add an example to the docs
and to the PEP.
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
t as long as they are
*strings* such keys should be allowed.
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
rst, none of the other situations I listed
above raises for conflicts. Second, there's the experience of str+unicode
in Python 2, which raises if the str argument contains any non-ASCII bytes.
In fact, we disliked it so much that we changed the language incompatibly
to deal with it.
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
y
> > other obvious meaning that + and * could have for sets.
>
> The language SETL (the language of sets) also uses + and * for set
> operations.¹
>
So the secret is out: Python inherits a lot from SETL, through ABC -- ABC
was heavily influenced by SETL.
> ¹ https://www.li
e better.
NOTE: I'm not picking on you specifically Chris! I see this a lot, and I do
it myself too (and regularly regret it).
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/m
recall, in SGML the first value "original" is the one that is
> in effect. This is what happens with the LaTeX command
> \providecommand.
>
> FURTHER LINKS
> [6]
> https://docs.python.org/3/reference/expressions.html#dictionary-displays
> [7] https://cwe.mitre.org/data/definitions/561.html # CWE-561: Dead Code
>
&
ibed)
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
___
> In the spirit of full disclosure:
> Of these, 2 is already implemented and widely used, so we don't need
> to use dict.__add__ for that. I've never seen 4 in the mathematical
> literature (union of relations is not the same thing). 3, however, is
> very common both for mappings with small domain and sparse
> representation of mappings with a default value (possibly computed
> then cached), and "|" is not suitable for expressing that sort of
> addition (I'm willing to say it's "wrong" :-).
>
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
On Fri, Mar 8, 2019 at 3:33 PM Greg Ewing
wrote:
> Guido van Rossum wrote:
> > I guess this explains the behavior of removing results <= 0; it makes
> > sense as multiset subtraction, since in a multiset a negative count
> > makes little sense. (Though the name Counter c
r me this is the default assumption (even at
Dropbox -- our most performance critical code has already been rewritten in
ugly Python or in Go). For the few cases where performance concerns are
paramount, it's easy to transform the operator version to something else --
*once you've confirmed i
On Fri, Mar 15, 2019 at 9:19 PM Inada Naoki wrote:
> On Sat, Mar 16, 2019 at 2:51 AM Guido van Rossum wrote:
> >
> > But I think that the folks who point out "there is already a way to do
> this" are missing the point that it really is easier to grasp the meaning
&
elling, then I think
> this proposal is the best: explicit, unambiguous, immediately
> understandable and easy to remember.
>
I don't find it easy to understand or remember that d1.update(d2) modifies
d1 in place, while d1.merge(d2) first copies d1.
Maybe the name can
not much of a
reason to try and introduce a mechanism to disable type hints. Sorry.
PS. This particular syntax was introduced by PEP 526, and introduced in
Python 3.6.
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas
nd
> many more bugs.
>
> SUMMARY
>
> I have argued that Python's core design decisions and coding principles
> can, at least in part, be reduced to a system of AXIOMS that can be useful
> applied. I have argued mainly based on analogy with the Hindu-Arabic
> numeral system, and the life and work of Gauss.
>
>
>
>
>
>
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
ategory error.
>
I assume the whole proposal was a pastiche of the proposal to add a +
operator for dictionaries. Jonathan needs to come clean before more people
waste their time discussing this.
--
--Guido van Rossum (python.org/~guido)
___
Pyt
sing as the main candidate that fits this bill.
>>>>
>>>> What do you say?
>>>>
>>>> Thanks!
>>>> Nam
>>>> ___
>>>> Python-ideas mailing list
>>>> Python-ideas@py
Let’s please leave this alone. As Serhiy says run() covers everything.
On Thu, Apr 4, 2019 at 3:03 AM Oleg Broytman wrote:
> On Thu, Apr 04, 2019 at 07:44:29PM +1100, Chris Angelico
> wrote:
> > On Thu, Apr 4, 2019 at 7:12 PM Nathaniel Smith wrote:
> > >
> > > On Thu, Apr 4, 2019 at 12:48 AM G
a list of
comma-separated items for the last comma, a fully-qualified module name for
the last period, and some ad-hoc parsing of other things. The "last
separator" use cases are the most common and here rindex() sounds very
useful.
-
lman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
___
irst time posting an idea to python-ideas. So apologies if i
> am not following some conventions that i might not be aware of.
> Vaibhav Karve
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinf
re = data[max(0, index - 1)]
after = data[min(len(data) - 1, index)]
return (before + after) / 2.0
where `data` is a sorted array. Essentially we use the average of the two
values nearest the cutoff point, except for edge cases. (I think we could
do better, but this is the code I found in our
y-value pairs.
> Uses __iter__() instead of keys() for iterating keys, and can take an
> optional iterable of keys. Equals to {k: m[k] for k in m} or {k: m[k]
> for k in keys}.
> * dict.fromitems() -- accepts only key-value pairs. Equals to {k: v for
> k, v in iterable}.
>
> ____
On Mon, May 6, 2019 at 11:14 AM Serhiy Storchaka
wrote:
> 06.05.19 17:49, Guido van Rossum пише:
> > 20-25 years ago this might have been a good idea. Unfortunately there's
> > so much code (including well-publicized example code) that I'm not sure
> > it's a
ed in other languages (e.g.
Scala) and notational systems (https://en.wikipedia.org/wiki/Subtyping).
Overloading '<=' would be easier to implement, but would also cause enough
confusion that I think we should avoid it at all cost.
--
--Guido van Rossum (python.org/~guido)
*Pron
On Mon, Jun 17, 2019 at 7:23 AM Rhodri James wrote:
> On 16/06/2019 03:34, Guido van Rossum wrote:
> > I don't actually know how viable this proposal is, but given that it's
> > being debated at some length, I'd like to put in my opinion that *if*
> > we
On Mon, Jun 17, 2019 at 12:54 PM Andrew Barnert wrote:
> On Jun 17, 2019, at 07:47, Guido van Rossum wrote:
>
> On Mon, Jun 17, 2019 at 7:23 AM Rhodri James wrote:
>
>> On 16/06/2019 03:34, Guido van Rossum wrote:
>> > I don't actually know how viable this
t;
> Symbols CAN be searched for, both in Google and in many documentation
> tools.
>
It's still harder. E.g. the wikipedia article on subtyping does not show in
the search results for "<:", and searching for "<: wikipedia" ignores the
"<:" entire
r a server to return a response which just
isn't ever going to come, but the connection somehow is kept open by the
other side?
--
--Guido van Rossum (python.org/~guido)
Pronouns: he/him/his (why is my pronoun here?)
___
Python-ideas mailing list -
ch can be interrupted --
IIRC Victor spent a lot of time making this work). There's a workaround
(specify a timeout) but this is still something that would have to be
solved for this to be useful.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun here?)*
&l
il 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/QE5OTQSEQHBBWWAQVIA66YUKGK5M6QDL/
> Code of Conduct: http://python.org/psf/codeofconduct/
deas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/46U433BTSAKCZKCNFUQGYDSC6GV5S35A/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun here?)*
<h
python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/2WFZPWUSW3CKGGP7P623GIHG5AK3NVCC/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun h
has been
> available for a very long time. I emailed the author, Paul McGuire, a few
> times about this python-ideas thread too but never got a response.
>
> On Fri, Jul 19, 2019 at 9:36 AM Guido van Rossum wrote:
>
>> Have you looked into pyparsing (https://github.com/pyparsing/py
my key message here is to Anders: stay on topic or start
a new thread. You're welcome to discuss your idea in a separate thread. But
don't steal existing threads.
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun here?)*
<http://feministing.com/2
ata in stream:
> try:
> write(data)
> except OSError:
> handle_write_error()
> except OSError:
> handle_read_error()
> except OSError:
> handle_connection_error()
> __
k I recall encountering one in the past decade or so).
Batuhan, if you still want to continue to debate this, please show some
real use cases of programs where itertools.product() makes it hard for the
human reader to understand the code. Examples like {1, 2, 3} * {"a", "b",
"c
Before we go too far down this route, let's consider whether these can't be
solved with lambda rather than introducing new special cases to partial().
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-
python.org/archives/list/python-ideas@python.org/message/NBILWWRZ46G2WUB3EHSZMII5V7B4IYD6/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-t
__
> 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
or..else prematurely; it would never be
accepted now. But at this point there would be a cost at removing it as
well and I don't think that's worth considering. But if the bar is about as
high for with...except as it would be if for...else was proposed today,
then I think it's clear we
On Mon, Jul 29, 2019 at 3:51 PM Eric Fahlgren
wrote:
> On Mon, Jul 29, 2019 at 2:58 PM Guido van Rossum wrote:
>
>> I am *guessing* the problem here is something like this:
>>
>> with open(filename) as f:
>> data = f.read()
>>
>> raises an exception
ng. The successor of namedtuple is typing.NamedTuple which
supports this syntactically. From the [docs](
https://docs.python.org/3/library/typing.html#typing.NamedTuple):
```
class Employee(NamedTuple):
name: str
id: int
```
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his
ep 2 need to be
> clarified, probably a cleaner way to fix this)
> - it is totally transparent for the end user, as synchronous callback are
> totally compatible with asynchronous ones
> ___
> Python-ideas mailing list -- python-ideas@python.o
or` had optional `except`
clauses. (Alternatively, you can write little wrappers that turn OSError
into different exceptions so you can use a single try/except/except/except
statement to handle them all.)
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/h
ved at
> https://mail.python.org/archives/list/python-ideas@python.org/message/OEXGSBYWG5JGR4G2ELFVJUGUVWWIN52Q/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his *
I wonder if Nathaniel has something to add? Trio has a different approayto
cancellation. Of course it is also an entirely new library...
On Tue, Jul 30, 2019 at 9:51 PM wrote:
> Oh only now it appears in the list ! I thought the post hadn't working, so
> I posted again :/.
>
> I've fixed my "lib
On Wed, Jul 31, 2019 at 2:06 AM Rob Cliffe via Python-ideas <
python-ideas@python.org> wrote:
>
>
> On 31/07/2019 00:35:59, Eric V. Smith wrote:
> >> On Jul 30, 2019, at 11:38 AM, Guido van Rossum
> wrote:
> >>
> > ..
> >
> >> with
ven has an option to limit its size (and silently drop older values as new
ones are added), let alone that the case of setting the size to zero is
optimized in the C code. But more importantly, I don't think I've ever
needed either of those features, so maybe I was better off not knowing
ild
a red house.
I don't want Python to become the modern-day Lego. The craft of programming
includes being able to combine pieces in all sorts of ways. Now, it's fine
for 3rd party packages to have a different philosophy. (Pandas seems to
cater to the crowd that wants a function for ev
101 - 200 of 910 matches
Mail list logo