[Python-ideas] Re: Custom string prefixes

2019-08-29 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-29 Thread Andrew Barnert via Python-ideas
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). ____

[Python-ideas] Re: Custom string prefixes

2019-08-29 Thread Rob Cliffe via Python-ideas
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).

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-29 Thread Andrew Barnert via Python-ideas
_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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-29 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-29 Thread Andrew Barnert via Python-ideas
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]

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-29 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Custom string prefixes

2019-08-29 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-29 Thread Rob Cliffe via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-30 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-30 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-08-30 Thread Andrew Barnert via Python-ideas
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.

[Python-ideas] Re: Adding support for adequately tagging AIX (pep425) to support distributed wheels

2019-09-01 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-03 Thread Rob Cliffe via 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

[Python-ideas] Re: Add a `dig` method to dictionaries supporting the retrieval of nested keys

2019-09-03 Thread James Livermont via Python-ideas
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-

[Python-ideas] Re: Custom string prefixes

2019-09-03 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-03 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-03 Thread Andrew Barnert via Python-ideas
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@

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-03 Thread Andrew Barnert via 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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-04 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add a "block" option to Executor.submit

2019-09-04 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add a "block" option to Executor.submit

2019-09-04 Thread Andrew Barnert via Python-ideas
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/

[Python-ideas] Re: Add a "block" option to Executor.submit

2019-09-04 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add a "block" option to Executor.submit

2019-09-04 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add a "block" option to Executor.submit

2019-09-04 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add a "block" option to Executor.submit

2019-09-04 Thread Andrew Barnert via Python-ideas
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. ________

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-05 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add a "block" option to Executor.submit

2019-09-05 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Conditional dict declarations

2019-09-05 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Conditional dict declarations

2019-09-05 Thread Andrew Barnert via Python-ideas
> 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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-05 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-05 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: [OT] Designing for Concurrency (was: Add a "block" option to Executor.submit)

2019-09-05 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: [OT] Designing for Concurrency (was: Add a "block" option to Executor.submit)

2019-09-05 Thread Andrew Barnert via Python-ideas
) 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]

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-05 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-06 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Conditional dict declarations

2019-09-06 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Inspired by Scala, a new syntax for Union type

2019-09-06 Thread Andrew Barnert via Python-ideas
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;

[Python-ideas] Re: Conditional dict declarations

2019-09-07 Thread Rob Cliffe via Python-ideas
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

[Python-ideas] Support for atomic types in Python

2019-09-08 Thread Vinay Sharma via Python-ideas
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

[Python-ideas] Re: Conditional dict declarations

2019-09-08 Thread Rob Cliffe via Python-ideas
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

[Python-ideas] Re: Add gamma function to cmath module

2019-09-08 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Conditional dict declarations

2019-09-08 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add gamma function to cmath module

2019-09-08 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-09 Thread Vinay Sharma via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-09 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Conditional dict declarations

2019-09-09 Thread Rob Cliffe via Python-ideas
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

[Python-ideas] Re: Conditional dict declarations

2019-09-09 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: PEP-603: Adding a frozenmap type to collections

2019-09-12 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: PEP-603: Adding a frozenmap type to collections

2019-09-12 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Vinay Sharma via Python-ideas
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 >

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Vinay Sharma via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Vinay Sharma via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Vinay Sharma via Python-ideas
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]

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Andrew Barnert via Python-ideas
> 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

[Python-ideas] Re: Need a core developer sponsor for a PEP

2019-09-17 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Need a core developer sponsor for a PEP

2019-09-17 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Need a core developer sponsor for a PEP

2019-09-19 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-19 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-19 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-19 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-19 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-19 Thread Andrew Barnert via Python-ideas
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]

[Python-ideas] Re: Set operations with Lists

2019-09-19 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-20 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-20 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-20 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-20 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-20 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-22 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-22 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-22 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-22 Thread Andrew Barnert via Python-ideas
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? ____

[Python-ideas] Re: Multiple items for each loop in comprehension

2019-09-22 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Link: Bidirectional Aliasing in Python

2019-09-22 Thread Andrew Barnert via Python-ideas
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@

[Python-ideas] Re: Link: Bidirectional Aliasing in Python

2019-09-22 Thread Andrew Barnert via 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

[Python-ideas] Re: Link: Bidirectional Aliasing in Python

2019-09-22 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Link: Bidirectional Aliasing in Python

2019-09-22 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Set operations with Lists

2019-09-23 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add a generic object comparison utility

2019-09-25 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Error handling toggle / levels

2019-09-26 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add a generic object comparison utility

2019-09-26 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add __slots__ to dataclasses to use less than half as much RAM

2019-09-27 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-09-27 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-09-27 Thread Andrew Barnert via Python-ideas
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.

[Python-ideas] Re: Add __slots__ to dataclasses to use less than half as much RAM

2019-09-27 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-09-29 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-09-30 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-10-01 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-10-01 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-10-01 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-10-01 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-10-01 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Add Subscriptable ABC

2019-10-01 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-07 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-07 Thread Andrew Barnert via Python-ideas
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

<    1   2   3   4   5   6   7   8   9   10   >