as a special restricted
calling syntax, unless you want to actively impede your understanding of the
code.
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/ma
assumption, but instead judge each case on its own
merits, you end up with a language which is better than languages at either
extreme.
There are plenty of cases where Python generalizes beyond most languages (how
many languages use the same feature for async functions and sequence iteration?
or
On Aug 29, 2019, at 05:25, Philippe Prados wrote:
>
> Hello everybody,
> Scala 3 propose the a new syntax for Union type. See here. I propose to add a
> similar syntax in Python.
> # Operator for Union
> assert( int | str == Union[int,str])
> assert( int | str | float =
’s in a function body, this is effectively the same problem as
global or builtin lookups being too slow inside a function body, and can be
solved the same way, with a keyword parameter with a default value. And if the
Python community thinks that _sin=sin is good enough for the uncommon problem
of l
sed the first time around.
But, balanced against the long-standing Python-specific use of tuples for small
numbers of alternatives, including alternative types in places like isinstance,
except, etc.? Maybe that beats the cross-linguistic issue.
Either one seems a lot better than breaking backward compat
son. A
compiled regex isn’t literally a string, but neither is a bytes; it’s still
clearly _similar_ to a string, in important ways. And so is a path, or a URL
(although I don’t know what you’d use the url prefix for in Python, given that
we don’t have a string-ish type like ObjC’s NSURL to ret
On Aug 29, 2019, at 12:54, Chris Angelico wrote:
>> Either one seems a lot better than breaking backward compatibility by adding
>> new operator methods to the type type.
>>
>
> How does that break backward compat?
It doesn’t make Python backward incompatible; it doe
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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org
course you could be trying to add type checking to some weird legacy
codebase that doesn’t do things Pythonically, so you have to use Union returns.
But that’s specific to that one weird codebase.
Meanwhile, Optional return values are common all over Python.
Also, Python’s typing system is a lot
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 -- python-ideas@python.org
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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
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 -- 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/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
On Aug 30, 2019, at 18:40, Pasha Stetsenko wrote:
>> I can’t think of any uses other than Optional.
>
> Also, in IPython and Jupyter Lab `?smth` displays help for symbol `smth`.
Yeah, and probably more Python users regularly use IPython than, say, BASIC, so
maybe a bit more p
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 -- 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/
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 -- python-ideas@python.org
To unsubscribe send an email to python-
t for
>>> a given network protocol.
>>>
>> A text string is a sequence of characters. By "byte", I really mean
>> "octet", but Python prefers to say "byte".
>
> And a character is a byte or sequence of bytes. (Odd-sized bytes are pr
ion of Python, so
you can use it in annotations and still run your code in 3.5 or something (you
can’t type-check it as 3.5 code, but that rarely matters).
* The same value can be passed to `isinstance` and will work as intended in
every version of Python, unlike `Union[int, str]`, which
I raised the issue in the first place.
Using a `?` suffix isn’t just potentially ugly as in your example, it’s also
potentially confusing given languages that use `?=` as null-coalescing
assignment or equality, not to mention forever closing off the possibility of
adding that feature to Python (
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
er to block until a worker is free to handle the
> request. I believe that this would be trivial to implement by passing the
> "block" option through to the Executor's internal Queue.put call
> (https://github.com/python/cpython/blob/242c26f53edb965e9808dd918089e664c02
current39 or whatever backport package on PyPI.
(I assume both you and Chris need this feature now (and can’t afford to wait
1.5 years or longer until you can get away with requiring Python 3.9+), and I
suspect there are multiple others in the same boat, so it seems like there’s a
good chance someon
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
citly queue-based?
After all, it’s a bit wasteful—and a bit more complicated—to put a semaphore in
front of a bounded queue instead of just using the queue bounds. (And the
inefficiency may be even worse in Python, because of its relatively high
function call overhead, if using the semaphore requi
lelizing code that isn’t in a bottleneck, and then adding
locks to it, is a pessimization).
_______
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/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 -- python-ideas@python.org
To unsubscribe send an email to python-i
away if it turns out to be confusing or buggy or whatever usually means
breaking existing code. (Don’t take that past “take that into account and think
twice” into “reject all flexibility without a second thought”, or you’ll end up
in extreme programming dogma land, and then you’ll be forced
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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
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/python-ideas@python.org/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
at I quoted in snipped text].
> isinstance is a wrapper around PyObject_IsInstance(obj, class_or_tuple),
> and if I'm reading the C code correctly, PyObject_IsInstance is roughly
> equivalent to this Python pseudo-code:
>
># Except in C, not Python
>def isinstance(obj
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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
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 -- python-ideas@python.org
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
handling as
>> the second argument of isinstance and issubclass and maybe except
>> statements?
> Union, and unions, are currently types:
> py> isinstance(Union, type)
> True
>
> py> isinstance(Union[int, str], type)
> True
What version of Python are you usi
.
But a magic value that can never be stored in any dict? That sounds nice at
first, but I think once you think it through, it would be a nightmare.
Especially when you consider how fundamental dicts are to all of Python.
Globals is a dict. Locals is a dict in some contexts, not others (and the
>> > py> isinstance(Union[int, str], type)
>> > True
>>
>> What version of Python are you using here?
>
> Ah, I didn't realise that the behaviour has changed! I was using Python
> 3.5, but I just tried again in 3.8:
I didn't even consider that this mig
mes out ragged in your browser, the colons and equal signs are meant
to be vertically aligned.
Rob Cliffe
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman
Currently, C++ has support for atomic types, on which operations like add, sub,
xor, etc can be done atomically, thereby avoiding data races.
Having such a support will be very helpful in Python.
For instance users won't have to use Locks for synchronising shared variables
in ca
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 -- python-ideas@python.org
To unsubscribe send an email to python-ide
a bunch of separate locals.
Well, I suppose you could use locals itself as that namespace:
query_data = {k: v for (k, v) in locals().items() if k in {'max_results',
'active', 'deleted'} and v}
… but that’s pretty horrible.
And I suppose there is something Pyth
e they”. :)
___
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@pyth
rget=func, args=(v, lock)) for i in range(10)]
for p in procs: p.start()
for p in procs: p.join()
print(v.value)
Because as far as I can perceive none of the types or operations you mention
have
any race conditions in multi-threaded Python code, and for multi-process or
async code that
is n
e change, and often even longer to
force all of your users/deployments to upgrade.)
_______
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-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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/pyt
On Sep 12, 2019, at 04:46, Yury Selivanov wrote:
>
> Hi!
>
> I've just published a PEP to add a frozenmap type to Python; it should
> be online shortly.
>
> Read it here:
> https://discuss.python.org/t/pep-603-adding-a-frozenmap-type-to-collections/2318
How doe
ables uses the same C data structure implementation
that’s already in Python surely outweighs the fact that it’s not a
category-killer.
(i assume that either there’s a pure-Python version for PyPy and other
implementations, or that those implementations are expected to already include
some code that’s
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 -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> 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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
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
want to create a new builtin type for unions, rather than
having a bunch of different parts of the Python core import from typing.
* In addition to other benefits, someone (Stephen?) pointed out that builtin
support could mean that, e.g., isinstance(3, int|str) could be just as
efficient as isi
wo-kinded” type system vs. leaning more into “everything
is first-class”.
_______
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
nd
can’t be used in issubclass at all. If you’re changing that some these are now
legal calls, you have to decide which ones, and what those calls return.
> * You will probably want to create a new builtin type for unions, rather
> than having a bunch of different parts of the Python c
l part).
> Even the plain python code is faster than the built in set functions (afaik).
You’re testing pretty small values in a very narrow use case, and testing them
inaccurately by using datetime instead of timeit (the fact that some of your
results are 0 vs. 0 should be a clue…), and
I added a version of your algorithm that works with
arbitrary iterables and also takes a key function (which you always want when
you’re doing anything related to sorting in Python), and it’s about 10-20%
faster than your list version, which shows that you aren’t getting any
performance ben
n+mlogm+n+m) as you’re proposing.
_______
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.p
l part).
>>> Even the plain python code is faster than the built in set functions
>>> (afaik).
>> You’re testing pretty small values in a very narrow use case, and testing
>> them inaccurately by using datetime instead of timeit (the fact that some of
>> your res
you need.
_______
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@python.or
oes not overthrow decades of theoretical proofs
and practical experience. Hash tables really do work.
_______
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mail
)` and maybe checking the len to pick which one.
If you really want to go overboard with micro-optimizing this version, you
might want to also check whether stashing bset.__contains__ and using that
speeds things up (which may be different across recent versions of Python with
changes to method ca
r to a hash table, which is an array of buckets in hash order,
which isn’t the order you’re going to be accessing them in for the b set.
If the values are strings, the pointers point to PyUnicode structs, each of
which holds… well, it’s complicated, but in this case (where they’re all pure
ASCII a
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 -- python-ideas@python.org
To unsubscribe send an email to python-id
list, at which point the choice is
made for you.
So, this already eliminates the possibility of reimplementing set operations
with step-compare as suggested earlier. But it also already makes a compelling
case for adding step-compare functions to Python—but that case needs to be made
clearly.
I thi
> large lists you have to tell them to convert to sets and then back again.
> Forget the new programmers who tried the naive way and quite because "python
> is too slow", they are waiting 20 seconds when we could deliver it to them
> in 1 second.
But today, you can d
d be
a huge win over sets.
_______
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
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 -- python-ideas@python.org
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 -- python-ideas@python.org
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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python
se, don’t work with locals, or require >< to be
handled at compile time. Do you have at least a sketch of how this works?
Also, do you have a real-life use case? Usually when you want the equivalent of
“variable references” in Python, you just stick the value in a list or an
explicit namespa
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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
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 -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mai
or by iterating,
not by an attribute, your algorithm does the wrong thing. Or, if there’s a back
link to the parent that is an attribute, again it does the wrong thing. Not to
mention that, because Python is ridiculously dynamic, you can have classes
where there’s not even a way to get a list of all
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 -- python-ideas@python.org
To unsubscr
ed can be equal: 1 == 1.0 == Fraction(1, 1).
___________
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/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 -- python-ideas@python.org
To unsubscribe send an email to python-ide
Is there are reason why you're using 'getattr' instead of 'hasattr'?
There is a difference here: if some class defines __getitem__ = None, blocks it
from looking like a subscriptable type.
That idiom is used for other things like __hash__, even if it’s not used 100%
consis
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 -- python-ideas@python.org
To unsubscrib
I can subscript it. What did you expect the answer to be?
I think the idea here is that your type follows the “old sequence protocol”,
where you can index it with 0, 1, … until you get an IndexError, without having
to check __len__ first.
Since there are various bits of Python (including the iter
On Sep 30, 2019, at 02:38, Paul Moore wrote:
>
> It's (in my view) sad that the simple hasattr test is no longer
> sufficient, and in particular that if you want robustness, Python has
> changed to the point where a pseudo subclass check is the "right" way
> t
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
times the other.
Python gives you a general framework that lets you define both kinds of
relationships—and more; e.g., you can handle relationships that aren’t quite
structurally (Go-style) checkable, like Sequence, and you can fudge around
legacy issues rather than having to get everything per
(how they are), but because what the function does, and in particular
> that it does two different things (but pretends it is one).
Not really.
If you want to be a purist, Python doesn’t do subtyping—or, at best, subtyping
is defined as “whatever the subclass hooks say”, which is meaningless bec
501 - 600 of 1690 matches
Mail list logo