I believe that anything that doesn’t have a builtin type
does not deserve builtin syntax. And I don’t understand why that isn’t a
near-ubiquitous viewpoint. But it’s not just you; at least three people (all of
whom dislike the whole concept of custom affixes) seem at least in principle
open
s mean that if typing or
mypy relies on it, it becomes incompatible with earlier versions of Python (or
has to fork different code for 3.8+ that relies on type.__or__ being available
and 3.7- that doesn’t have whatever functionality relies on that).
____
On 29/08/2019 22:10:21, Andrew Barnert via Python-ideas wrote:
As I’ve said before, I believe that anything that doesn’t have a builtin type
does not deserve builtin syntax. And I don’t understand why that isn’t a
near-ubiquitous viewpoint.
+1 (maybe that means I'm missing something).
_ror__ wouldn’t handle that, something funky about
type, or about builtin types in general, that I’m forgetting?
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org
r that means union, it’s
used for sum/union types in other languages, it makes perfect sense if you read
it as “int or str”… I cant imagine anyone being confused or put off by it.
___
Python-ideas mailing list -- [email protected]
To unsubscribe s
s ? as an id-cont character, with the Schemeish convention, and
the ?: operator, and in some other contexts it’s a syntax error but in some it
does… whatever that string-or-ord thing is.
___________
Python-ideas mailing list -- [email protected]
On Aug 29, 2019, at 18:10, Guido van Rossum wrote:
>
>> On Thu, Aug 29, 2019 at 5:56 PM Andrew Barnert via Python-ideas
>> wrote:
>> I think {int, str}, which someone proposed in one of the earlier
>> discussions, is nice. What else would a set of types me
if nobody else agrees, fine. But if I could __all__ it, I
could get what I want anyway. :)
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-i
ree. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
_______
Python-ideas mailing list -- python-ideas@pytho
complicated change than that.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/a
onvince people they’re better, and
then implement them in the subclasscheck method. Changing the signature of
isinstance is irrelevant. And that’s all orthogonal to, and almost completely
unrelated to, adding |.
_______
Python-ideas mailing list -- pytho
ng operators, and that was the consensus then, but
don’t quote me on that.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.
pecific PyPA lists, or a
platform-specific mailing list (I’m not sure if there is one for AIX), and only
come to -ideas or -dev if someone thinks it might going to step on unintended
toes or can’t be resolved without getting wider input.
___
Python-ideas
ot;, and I'm not
sure whether that's an argument in favour or against.
ChrisA
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Me
It seems most of the folks on this thread have similar feelings on this, so I
will drop this idea. We'll probably standardize on using glom for now.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-
cts, so you don’t even know which byte
substrings exist in memory at any given time.(Languages with powerful
optimizers or macro systems like Haskell or Rust might actually do that by
translating all your string-function calls into calls directly on the steam of
bytes, but from your perspect
t idea.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/m
higher than
using `~`.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@
On Sep 3, 2019, at 19:45, Steven D'Aprano wrote:
>
> On Thu, Aug 29, 2019 at 06:20:55PM +0100, Rob Cliffe via Python-ideas wrote:
>
>>> isinstance(x, str | int) ==> "is x an instance of str or int"
>>
>> Er, is that necessary when you can alre
On Sep 4, 2019, at 01:29, Inada Naoki wrote:
>
> On Wed, Sep 4, 2019 at 1:15 PM Andrew Barnert via Python-ideas
> wrote:
>>
>>
>> But that implies that you can also write this:
>>
>>isinstance(x, Union[str, int])
>>
>> … because, af
timeouts just because we’re adding blocking.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/ar
e will do it.)
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/
On Sep 4, 2019, at 10:17, Anders Hovmöller wrote:
>
>
>> On 4 Sep 2019, at 18:31, Andrew Barnert via Python-ideas
>> wrote:
>>
>> On Sep 4, 2019, at 04:21, Chris Simmons wrote:
>>
>> I have seen deployed servers that wrap an Executor with a Semapho
tors, and some of them don’t use pools at
all. But the Python API only has two executors: a thread pool and a process
pool, and I think most people know they’re based on queues even if we don’t
explicitly guarantee that anywhere.
_______
Python-ideas maili
lelizing code that isn’t in a bottleneck, and then adding
locks to it, is a pessimization).
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pytho
3 line solution.
Why would it cause complications? It’s dead simple to design and implement,
dead simple to understand, and relies on well-understood and well-rested
behavior that’s been part of the queue and mp modules since long before
concurrent even existed.
________
on where they’re checking types
of a zillion objects, they’re definitely not going to guess that it’s 5x as
slow, so there definitely going to misuse it.
_______________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-i
me. So that’s a real need. Conversely, I
don’t think I’ve ever seen anyone who wanted to use a different kind of queue
for anything else, or anyone who used the more flexible in other libraries like
Ruby’s to add anything but a queue bound and maybe a fail handler flag. So I’m
not sure the flexibi
that uses d.skip, the one that uses type(d).skip (like a
special method lookup), or the one that uses dict.skip?
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.pytho
> On Sep 5, 2019, at 07:46, Sebastian Kreft wrote:
>
> How is this different to the discussion
> https://mail.python.org/archives/list/[email protected]/thread/MFSL3U6V74PZN4AT4JFQMQXSMGOJ6F27/#MFSL3U6V74PZN4AT4JFQMQXSMGOJ6F27
> ?
Well, that discussion started wit
On Sep 5, 2019, at 02:15, Chris Angelico wrote:
>
> On Thu, Sep 5, 2019 at 7:08 PM Andrew Barnert via Python-ideas
> wrote:
>>
>> On Sep 4, 2019, at 20:51, Inada Naoki wrote:
>>
>>>> And you’re right, because int|str _looks_ better than (int, str) her
d syntax for that, and change
typing.Union to take advantage of it”, which sounds conceptually better than
“add syntax to creating typing.Union static types, and then add special support
to just this one kind of static type to make it usable at runtime”, even if
they’re close to equivalent in practi
t in practice, I’m pretty sure either that people only need “block”,
or that they only need “block” and “raise”. I’m just not sure which of those
two.___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
htt
) handles virtually all of the simple cases that I can think of or
that anyone else has suggested, and I don’t think it matters much how many of
the moderate or extremely complicated cases it handles.
___
Python-ideas mailing list -- [email protected]
Two more bits of bikeshedding…
On Sep 5, 2019, at 12:12, Andrew Barnert via Python-ideas
wrote:
>
>> On Sep 5, 2019, at 04:24, Steven D'Aprano wrote:
>>
>> If Union is a built-in, we could have something like this:
>>
>> def isinstance(obj, class_or_t
ing Generic, typing.Union, at all?
> typing.Union will probably just become an alias to the (proposed)
> built-in types.Union.
If `typing.Union` and `typing.Union[int, str]` actually are types as you say,
then there's probably no harm in replacing the existing `typing.Union` with the
n
view
abarnert has 102 repositories available. Follow their code on GitHub.
|
|
|
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pyth
ssubclass` only worked on classes, hence the
name.)
If you try and import a meaning from another language, then sometimes it can
get confusing. But think about it: in, say, Java, "subclass" explicitly means
only a concrete class inheriting implementation from another concrete class;
mes out ragged in your browser, the colons and equal signs are meant
to be vertically aligned.
Rob Cliffe
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman
https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/_005f_005fatomic-Builtins.html#g_t_005f_005fatomic-Builtins
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/p
On 07/09/2019 18:59:49, Chris Angelico wrote:
On Sat, Sep 7, 2019 at 11:27 PM Rob Cliffe via Python-ideas
wrote:
A chance for me to bang the drum on one of my pet themes:
Sometimes the readability of code is improved by breaking the sacred
taboo of 1 statement per line, if it allows similar
for extreme values), and doesn’t
give the same values for float and complex (e.g., for 1/3, they differ by
6ulp). Is that good enough for the stdlib?
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ide
on could do to alleviate the repetitions.
The stalled proposal for magic keyword arguments would let you write something
like this:
query_data = dict(max_results=, active=, deleted=)
… which you could then filter. But I don’t think most people liked that
proposal, and I don’t think this is a
e they”. :)
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@pyth
ent to my problem), was when asking a novice
question on
"how to rename a dict key" - and even them, it felt a bit overkill.
In other words, I may be wrong, but I think you are talking about a non-issue
here.
On Sun, 8 Sep 2019 at 11:33, Vinay Sharma via Python-ideas
wrote:
Cur
e change, and often even longer to
force all of your users/deployments to upgrade.)
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ide
On 08/09/2019 19:34:33, Chris Angelico wrote:
On Mon, Sep 9, 2019 at 4:13 AM Rob Cliffe via Python-ideas
wrote:
On 07/09/2019 18:59:49, Chris Angelico wrote:
On Sat, Sep 7, 2019 at 11:27 PM Rob Cliffe via Python-ideas
wrote:
A chance for me to bang the drum on one of my pet themes
for
it and writing a for_json or as_dict or whatever, you can just use a
SimpleNamespace.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pyt
s easily add something
later).
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/py
an zippers, and harder
to build yourself on top of a library that doesn’t provide it; etc.) Just that
the PEP should make the case for each such decision.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-id
of multiprocessing.
> On 10-Sep-2019, at 2:27 PM, Antoine Pitrou wrote:
>
>
> Hi Vinay,
>
> On Mon, 09 Sep 2019 08:23:48 -
> Vinay Sharma via Python-ideas
> wrote:
>>
>> Also, as far as I know (might be wrong) Value is stored in shared memory and
>
3/09/2019 14:32, Vinay Sharma via Python-ideas wrote:
>> As you said there can be lot of possible use cases for the proposed
>> feature, since there are lot’s of use cases for a lock. I can tell
>> you some cases which I am facing.
>
> I don't in principle object to having la
ould your atomic access work?
>
> --
> Rhodri James *-* Kynesim Ltd
> ___________
> Python-ideas mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/ma
If you want atomicity across processes, you
> need some kind of lock at some level.
>
> --
> Rhodri James *-* Kynesim Ltd
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
building and runtime, and
writing an autoconf test to boot, is good enough for C++, why does your
solution need to be in the stdlib rather than a PyPI library in Python?
Meanwhile:
> On Sep 13, 2019, at 06:32, Vinay Sharma via Python-ideas
> wrote:
>
> Let’s say I have a parent p
On Sep 13, 2019, at 09:31, Vinay Sharma via Python-ideas
wrote:
>
> multiprocessing.Value can be synchronised using a lock, but if I have
> multiple multiprocessing.Value(s) which I want to synchronise between two
> processes, then I will have to pass a lock for each multiproc
e all 12 values or none of them.
But that the proposed mp.AtomicValue wouldn’t help there either.___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pyth
On Sep 13, 2019, at 10:42, Antoine Pitrou wrote:
>
> On Fri, 13 Sep 2019 10:27:10 -0700
> Andrew Barnert via Python-ideas
> wrote:
>>
>> (If you want a shiny modern solution instead, this looks like one of the few
>> cases where hardware TM support can proba
> On Sep 13, 2019, at 12:21, Richard Musil wrote:
>
>> On Fri, Sep 13, 2019 at 7:28 PM Andrew Barnert via Python-ideas
>> wrote:
>
>> First, I’m pretty sure that, contrary to your claims, C++ does not support
>> this. C++ doesn’t even support shared memor
ter than making isinstance work with unions and creating them with |.
* Mentioning the wide variety of other languages’ typing systems that use |
for related features would probably make it more compelling.
_______
Python-ideas mailing list -- python-idea
wo-kinded” type system vs. leaning more into “everything
is first-class”.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org
complicated and they don’t have a compelling use in mind for it.
I haven’t followed the discussion around PEP 585, but I suspect that when you
take this PEP to the typing-sig people, these questions are going to be more
relevant to them than the bikeshedding stuff about how to spell ~ and how othe
or is
obvious; here, it’s not obvious, and if you want it to be a choice you have to
add another flag argument.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.pytho
or anything else you’re arguing.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.p
n+mlogm+n+m) as you’re proposing.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.p
er things that you
haven’t even thought of and therefore aren’t even trying to correct for. And of
course it’s been tested through decades of widespread use.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-i
you need.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]
oes not overthrow decades of theoretical proofs
and practical experience. Hash tables really do work.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mail
ready have pre-sorted
lists, and if you do have that case, I’m not sure pressing further with this
artificial benchmark will tell you much anyway.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ideas-l
any dups that could get shuffled out of order), so it’s still
giving the list code an unfair advantage that it wouldn’t have in a real life
unsorted case.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ideas-l
of CPUs because they were fooling the computer into
thinking they were never going to read past the end of the current page so it
didn’t prefetch the next one.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-id
icro
benchmarks aren’t going to help resolve any of those questions.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
h
er come across another step and compare.
People do this all over the place. For example look at the merge step of any
merge sort: it’s a step-compare union, possibly in-place, possibly n-ary
instead of binary, but recognizably the same thing.
In C++, the stdlib has all of these algorithms, abstr
d be
a huge win over sets.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org
already in memory, I’ll bet there’s some kind of pandas/HDF way to do it
that buffers up large chunks and optimizes the hell out of everything and blows
my code away.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email
mance in some cases, but that’s hard
to generalize about. Overall, you probably want them when you need to preserve
input order, or use a key function, etc., not when sets aren’t fast enough.
_______
Python-ideas mailing list -- [email protected]
To uns
d it seems
like there are useful things you can do with it. Or maybe almost all such
things are worth specifializing differently for random-access vs.
inherently-logarithmic data structures, or maybe it’s just too hard to come up
with a proper useful abstraction?
____
think most humans don’t internalize the exact rules for when
tuples do and don’t require parens, etc.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python
pected), or something that looks like a
plain-old dict but if you assign to its `a` you also change `b`, or something
that looks like a plain-old dict but if you assign to its `a` you unlink it?
_______
Python-ideas mailing list -- python-ideas@
On Sep 22, 2019, at 02:08, Nutchanon Ninyawee wrote:
>
> More in detail on this link
> https://dev.to/circleoncircles/python-ideas-link-bidirectional-aliasing-in-python-3f20
After reading the whole thing…
In “explicitly not-copy assignment”: assignment in Python never copies. D
On Sep 22, 2019, at 18:15, Chris Angelico wrote:
>
> On Mon, Sep 23, 2019 at 10:42 AM Andrew Barnert via Python-ideas
> wrote:
>>
>>> On Sep 22, 2019, at 02:08, Nutchanon Ninyawee wrote:
>>>
>>> Link is a language feature that allows multiple varia
Just answering one of them and ignoring the rest doesn’t really help much to
clarify the proposal.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3
from a filesystem that
guarantees sorted order and it supports iterdir, iterators should help quite a
bit.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mai
ite that
pretty easily, and it might give you everything you’re looking for.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.pyt
sing it (and doing it explicitly as raise e3 rather than just
raise) means you get the same effect as with leaving it disabled, but less
efficiently and less friendly to debugging?
___
Python-ideas mailing list -- [email protected]
To unsubscr
ed can be equal: 1 == 1.0 == Fraction(1, 1).
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/arc
t for merging it into the stdlib (and leaving it on PyPI
as a backport). If it turned out to be tricky to implement without modifying
dataclass itself, explaining why could also be a good argument for moving it
into the stdlib. ___________
Python-ideas maili
not be much cost—and may not even be
unintentional?).
Or I may be missing something that makes (Sequence, Mapping) inappropriate, of
course.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to python-ide
tently for all protocols.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.
automated tools (or dataclass-like libraries)
into thinking you’re declaring slots named _, a, u, t, and o?
(I don’t think there’s any danger of confusing human readers, at least.)
_______
Python-ideas mailing list -- [email protected]
To unsubscrib
than they expected (a TypeError a few lines down,
most likely), who cares? That seems like a consenting adults issue.
___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python
uld have been a decades-long project like the one C++ is still fighting over
for bounding its generics…)
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3
On Sep 30, 2019, at 23:46, Ben Rudiak-Gould wrote:
>
> On Mon, Sep 30, 2019 at 10:08 AM Andrew Barnert via Python-ideas
> wrote:
>> Also, what we’re checking for really is subtyping.
>
> Is it? Subtyping in type theory satisfies some axioms, one of which is
> transitiv
top of that to help its
ABCs test for methods properly (because it’s not as simple as it should be).
But the real magic is making issubclass a protocol that’s overridable the same
as everything else in Python.
_______
Python-ideas mailing list -- python-i
ble. (I
don’t know that these are very compelling arguments, but at least they’re
conceivable ones.) But I can’t see an argument that something called
Subscriptable could (or should) actually mean indexable rather than
subscriptable.___
Python-i
ible pile of unusable crap. But in practice, they actually work pretty
nicely in a wide range of code that people read every day.
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/m
But that’s
just the start of the discussion, not the end.___________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
is-a test for object are going to violate LSP.
(Obviously that’s not the actual design history of Python—Guido didn’t decide
to add object.__hash__ only after imagining the future of multiple inheritance
and decorators, and comparing how the three different design choices would
impact all the dict
at most of the complexity is due to the
existing complicated interface of __getitem__ and keywords don’t make it much
different. But I’m not sure that would be true. And I think many of the
objections are from people who suspect the opposite.___
Python-ide
bly want to go back to that, come up with answers to the
objections and open questions, and start over
_______
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.pytho
501 - 600 of 1693 matches
Mail list logo