Re: [Python-Dev] PEP 567 v2

2017-12-28 Thread Guido van Rossum
Keep MISSING. On Dec 28, 2017 8:44 AM, "Yury Selivanov" wrote: > On Thu, Dec 28, 2017 at 4:51 AM, Victor Stinner > wrote: > > Hi, > > > > I like the new version of the PEP using "read only mapping" and > > copy_context(). It's easier to understand. > > Thanks, Victor! > > > > > I'm ok with seei

Re: [Python-Dev] 'continue'/'break'/'return' inside 'finally' clause

2017-12-28 Thread Guido van Rossum
I don't think the language definition should be judgmental here. The semantics are unambiguous. On Dec 28, 2017 11:38 AM, "Serhiy Storchaka" wrote: > 28.12.17 16:38, Guido van Rossum пише: > >> Looks to me the prohibition was to prevent a crash. It makes more sen

Re: [Python-Dev] Is static typing still optional?

2017-12-29 Thread Guido van Rossum
y the category killer on PyPI. So we are IMO taking the best course possible given that we want something in the stdlib but not exactly attrs. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.

Re: [Python-Dev] Concerns about method overriding and subclassing with dataclasses

2017-12-29 Thread Guido van Rossum
But you always inherit __repr__, from object. The base class might also itself be a dataclass. I think it should only skip when the decorated class itself defines __repr__. On Dec 29, 2017 3:47 AM, "Antoine Pitrou" wrote: > On Fri, 29 Dec 2017 02:23:56 -0800 > Ethan Smith wrote: > > > > In a fe

Re: [Python-Dev] Concerns about method overriding and subclassing with dataclasses

2017-12-29 Thread Guido van Rossum
I still think it should overrides anything that's just inherited but nothing that's defined in the class being decorated. On Dec 29, 2017 5:43 PM, "Nathaniel Smith" wrote: > On Fri, Dec 29, 2017 at 12:30 PM, Ethan Furman wrote: > > Good point. So auto-generate a new __repr__ if: > > > > - one

Re: [Python-Dev] Concerns about method overriding and subclassing with dataclasses

2017-12-29 Thread Guido van Rossum
M, "Ethan Smith" wrote: > > > On Fri, Dec 29, 2017 at 4:52 PM, Guido van Rossum > wrote: > >> I still think it should overrides anything that's just inherited but >> nothing that's defined in the class being decorated. >> >> > Could y

Re: [Python-Dev] [ssl] The weird case of IDNA

2017-12-29 Thread Guido van Rossum
This being a security issue I think it's okay to break 3.6. might even backport to 3.5 if it's easy? On Dec 29, 2017 1:59 PM, "Christian Heimes" wrote: > Hi, > > tl;dr > This mail is about internationalized domain names and TLS/SSL. It > doesn't concern you if you live in ASCII-land. Me and a co

Re: [Python-Dev] Concerns about method overriding and subclassing with dataclasses

2018-01-01 Thread Guido van Rossum
I was wondering is if the child will know about all the fields in the > parent -- so it could make a full __repr__. > Yes, there's a class variable (__dataclass_fields__) that identifies the parent fields. The PEP doesn't mention this or the fact that special methods (like

Re: [Python-Dev] PEP 567 v2

2018-01-02 Thread Guido van Rossum
by var.get(), when get() is called without the > default parameter." > > Victor > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/m

Re: [Python-Dev] PEP 567 v2

2018-01-02 Thread Guido van Rossum
ntext", there is only a "current context data" in >> the current Python thread. There is no need for a concrete context instance >> to store variable variables values. It's also hard to understand that in >> the PEP. >> >> >

Re: [Python-Dev] PEP 567 v2

2018-01-02 Thread Guido van Rossum
On Tue, Jan 2, 2018 at 4:45 PM, Victor Stinner wrote: > Le 2 janv. 2018 18:57, "Guido van Rossum" a écrit : > > Oh, the "Specification" section in the PEP is too brief on several of > these subjects. It doesn't really specify what var.get() does if the

Re: [Python-Dev] PEP 567 v2

2018-01-02 Thread Guido van Rossum
t manager that sets and restores a context variable (like in `with decimal.localcontext()`). Handling double resets is about as useful as specifying what happens if __exit__ is called twice. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailin

Re: [Python-Dev] PEP 567 v2

2018-01-02 Thread Guido van Rossum
_ >> Python-Dev mailing list >> Python-Dev@python.org >> https://mail.python.org/mailman/listinfo/python-dev >> Unsubscribe: https://mail.python.org/mailman/options/python-dev/ >> yselivanov.ml%40gmail.com >> > -- --Guido van Rossum

Re: [Python-Dev] PEP 567 v2

2018-01-03 Thread Guido van Rossum
the *first* example in the doc. But here contextvars is different > since there is no API to get the current API. The lack of API to access > directly the current contextvars context is the main difference with > decimal context, and I'm fine with that. > > It's easy to see a parallel since decimal context can be copied using > Context.copy(), it has also multiple (builtin) "variables", it's just that > the API is different (decimal context variables are modified as > attributes), and it's possible to set a context using > decimal.setcontext(). > > Victor > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 567 v2

2018-01-03 Thread Guido van Rossum
On Wed, Jan 3, 2018 at 12:32 PM, Glenn Linderman wrote: > On 1/3/2018 11:16 AM, Guido van Rossum wrote: > > Maybe I should clarify again what run() does. Here's how I think of it in > pseudo code: > > def run(self, func, *args, **kwds): > old = _get_current_cont

Re: [Python-Dev] 'continue'/'break'/'return' inside 'finally' clause

2018-01-03 Thread Guido van Rossum
> Neil > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > -- --Guido van Ros

Re: [Python-Dev] PEP 567 v2

2018-01-03 Thread Guido van Rossum
t (in the thread state). I don't have time right now to respond in more detail, sorry for shedding darkness. :-( Hopefully I'll have time Friday. On Wed, Jan 3, 2018 at 4:25 PM, Victor Stinner wrote: > 2018-01-03 23:01 GMT+01:00 Guido van Rossum : > > Heh, you're right, I fo

Re: [Python-Dev] PEP 567 v2

2018-01-03 Thread Guido van Rossum
assertNotIn(name, context) > > def func2(): > assert name.get() == 'yury' > assert context[name] == 'yury' > > context = contextvars.copy_context() > > assert name.get() == 'name' > assertNotIn(name, context) > > context.run(func1) >

Re: [Python-Dev] PEP 567 v2

2018-01-04 Thread Guido van Rossum
On Thu, Jan 4, 2018 at 3:25 AM, Paul Moore wrote: > On 4 January 2018 at 00:17, Greg Ewing > wrote: > > Guido van Rossum wrote: > >> > >> contextvars.copy_context().run(func, ) > > > > If contexts are immutable, why is there something > > called c

Re: [Python-Dev] PEP 567 v2

2018-01-04 Thread Guido van Rossum
that I didn't say anything about HAMTs here, because that's > orthogonal implementation detail. It would make perfect sense to have > Context be an opaque wrapper around a regular dict; it would just give > different performance trade-offs.) > Agreed, that's how the PEP pseud

Re: [Python-Dev] PEP 567 v2

2018-01-04 Thread Guido van Rossum
On Thu, Jan 4, 2018 at 9:27 AM, Paul Moore wrote: > On 4 January 2018 at 15:56, Guido van Rossum wrote: > > It was get_context() in an earlier version of PEP 567. We changed it to > > copy_context() believing that that would clarify that you get a clone > that > > is

Re: [Python-Dev] PEP 567 v2

2018-01-04 Thread Guido van Rossum
On Thu, Jan 4, 2018 at 4:56 PM, Greg Ewing wrote: > Guido van Rossum wrote: > >> It was get_context() in an earlier version of PEP 567. We changed it to >> copy_context() believing that that would clarify that you get a clone that >> is unaffected by subsequent ContextVar

Re: [Python-Dev] PEP 567 v2

2018-01-04 Thread Guido van Rossum
18 PM, Nathaniel Smith wrote: > On Thu, Jan 4, 2018 at 8:30 AM, Guido van Rossum wrote: > > On Wed, Jan 3, 2018 at 6:35 PM, Nathaniel Smith wrote: > >> - Context is a mutable object representing a mapping > >> - BUT it doesn't allow mutation through the MutableMap

Re: [Python-Dev] 'continue'/'break'/'return' inside 'finally' clause

2018-01-04 Thread Guido van Rossum
We should interview you for the paper we may be writing for HOPL. On Wed, Jan 3, 2018 at 6:05 PM, Neil Schemenauer wrote: > On 2018-01-03, Guido van Rossum wrote: > > I'm sorry, I don't think more research can convince me either way. > > I want all three of return/brea

Re: [Python-Dev] PEP 567 (contextvars) idea: really implement the current context

2018-01-04 Thread Guido van Rossum
that I suspect answers to questions like this will be obvious. > In the other thread I think we've clarified what the (im)mutability status of Context is. I don't think we need Victor's implementation either and I agree with Paul that the PEP just needs a better specification / d

Re: [Python-Dev] PEP 567 (contextvars) idea: really implement the current context

2018-01-04 Thread Guido van Rossum
do for asyncio.Task -- constructing the task calls copy_context() _step() is always wrapped in a run() call for that context. (This was a good question because it teases out more of the semantics of Context.run().) -- --Guido van Rossum (python.org/~guido) ___

Re: [Python-Dev] PEP 567 v2

2018-01-04 Thread Guido van Rossum
tasks. But I don't see a use case for mutating a Context object that's not the current context, and when it is the current context, ContextVar.set() is more direct. I also don't see use cases for other MutableMapping methods like pop() or update(). (And clear()

Re: [Python-Dev] PEP 567 v2

2018-01-04 Thread Guido van Rossum
On Thu, Jan 4, 2018 at 7:58 PM, Nathaniel Smith wrote: > On Thu, Jan 4, 2018 at 6:09 PM, Guido van Rossum wrote: > > However you've not convinced me that it would be better to make Context > > implement the full MutableMapping interface (with `__delitem__` always > &g

Re: [Python-Dev] Whatever happened to 'nonlocal x = y'?

2018-01-05 Thread Guido van Rossum
r on the tracker). It was never implemented and I think it shouldn't be. So we might as well update the PEP. It wouldn't be particularly useful, since (by definition) the function that declares the nonlocal variable is not its owner, and hence it's unlikely to make sense to initia

Re: [Python-Dev] Concerns about method overriding and subclassing with dataclasses

2018-01-05 Thread Guido van Rossum
On Fri, Jan 5, 2018 at 5:08 AM, Eric V. Smith wrote: > On 1/2/2018 12:01 AM, Guido van Rossum wrote: > >> Yes, there's a class variable (__dataclass_fields__) that identifies the >> parent fields. The PEP doesn't mention this or the fact that special >> method

Re: [Python-Dev] PEP 567 v2

2018-01-05 Thread Guido van Rossum
() is inherited from Mapping.get(); if you want it to raise use Context.__getitem__() (i.e. ctx[var]). Lots of classes define get() methods with various behaviors. Context.get() and ContextVar.get() are just different -- ContextVar is not a Mapping. -- --Gui

Re: [Python-Dev] PEP 567 v2

2018-01-05 Thread Guido van Rossum
On Fri, Jan 5, 2018 at 2:41 AM, Paul Moore wrote: > On 4 January 2018 at 23:58, Guido van Rossum wrote: > > Do you have a specific proposal for a wording change? PEP 567 describes > > Context as "a read-only mapping, implemented using an immutable > dictionary." >

Re: [Python-Dev] PEP 567 v2

2018-01-05 Thread Guido van Rossum
... you need to use the > ContextVar.set() method from Context.run()" would be OK, although I > don't want the summary to get too long. > (Sorry, I wrote my previous response before seeing this part of the exchange.) Maybe "... you need to use the ContextVar.set() method, which

Re: [Python-Dev] PEP 567 v2

2018-01-05 Thread Guido van Rossum
d Tries (HAMT). They allow for O(log N) > > ``set`` operation, and for O(1) ``copy_context()`` function, where > > *N* is the number of items in the dictionary. For a detailed > > analysis of HAMT performance please refer to :pep:`550` [1]_. > > Would it be

Re: [Python-Dev] Concerns about method overriding and subclassing with dataclasses

2018-01-05 Thread Guido van Rossum
ede I have no use case so I'll drop it. On Fri, Jan 5, 2018 at 8:43 AM, Eric V. Smith wrote: > On 1/5/2018 11:24 AM, Guido van Rossum wrote: > >> On Fri, Jan 5, 2018 at 5:08 AM, Eric V. Smith > <mailto:e...@trueblade.com>> wrote: >> >> On 1/2/2018

Re: [Python-Dev] Whatever happened to 'nonlocal x = y'?

2018-01-05 Thread Guido van Rossum
5, 2018, at 10:47, Guido van Rossum wrote: > > I don't recall (though someone with more time might find the discussion > in > > the archives or on the tracker). It was never implemented and I think it > > shouldn't be. So we might as well update the PEP. It wouldn't

Re: [Python-Dev] Concerns about method overriding and subclassing with dataclasses

2018-01-05 Thread Guido van Rossum
I'm normally no big fan of things that take either a class or an instance, but since fields() does this, I think is_dataclass() should to. And that's the name I'd choose. OK on the pseudo-fields. On Fri, Jan 5, 2018 at 11:06 AM, Eric V. Smith wrote: > On 1/5/2018 12:58 PM

Re: [Python-Dev] Whatever happened to 'nonlocal x = y'?

2018-01-05 Thread Guido van Rossum
ri, Jan 5, 2018 at 7:47 AM, Guido van Rossum wrote: > > I don't recall (though someone with more time might find the discussion > in > > the archives or on the tracker). It was never implemented and I think it > > shouldn't be. So we might as well update the

Re: [Python-Dev] PEP 567 v2

2018-01-05 Thread Guido van Rossum
On Fri, Jan 5, 2018 at 2:43 PM, Chris Jerdonek wrote: > On Fri, Jan 5, 2018 at 8:29 AM, Guido van Rossum wrote: > > On Fri, Jan 5, 2018 at 2:05 AM, Victor Stinner > > > wrote: > >> > >> Currently, Context.get(var) returns None when "var in cont

Re: [Python-Dev] Whatever happened to 'nonlocal x = y'?

2018-01-06 Thread Guido van Rossum
ython.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org

Re: [Python-Dev] subprocess not escaping "^" on Windows

2018-01-07 Thread Guido van Rossum
:^) tis...@stackless.com > Software Consulting : http://www.stackless.com/ > Karl-Liebknecht-Str. 121 : https://github.com/PySide > 14482 Potsdam: GPG key -> 0xFB7BEE0E > phone +49 173 24 18 776 fax +49 (30) 700143-0023 > > > ___ > P

Re: [Python-Dev] subprocess not escaping "^" on Windows

2018-01-07 Thread Guido van Rossum
te_shell=True?) > to match the normal user expectations without using the shell? > That feels like a terrible idea to me. How do you define "normal user expectations" here? If people want shell builtins they should just use shell=True

Re: [Python-Dev] Concerns about method overriding and subclassing with dataclasses

2018-01-07 Thread Guido van Rossum
e are cases where a user did write an explicit __ne__ that needs to be overridden) I would recommend the following rule: - If there's an __eq__, don't do anything (regardless of whether there's an __ne__) - If there no __eq__ but there is an __ne__, generate __eq__ but

Re: [Python-Dev] subprocess not escaping "^" on Windows

2018-01-07 Thread Guido van Rossum
rst one being 'a b' and the second one 'c'. At this point I can understand that Christian recommends against shell=True -- it's totally messed up! But the fix should really be to fix this, not inventing a new feature. -- --Guido van Rossum (python.org/~guido)

Re: [Python-Dev] PEP 567 pre v3

2018-01-08 Thread Guido van Rossum
27;m +1 for this one. > > > 5. PEP language. > > I agree that PEP is vague about some details and is incorrect in some > places (like calling Context objects immutable, which is not really > true, because .run() can modify them). I'll fix the language in v3 > once I'm

Re: [Python-Dev] PEP 567 pre v3

2018-01-08 Thread Guido van Rossum
> Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > -- --Guido van Rossum (python.org/~guido) _

Re: [Python-Dev] PEP 567 pre v3

2018-01-09 Thread Guido van Rossum
sn't create a variable, only "x = None". >> >> It's not possible to define a thread local variable without specifying >> a "default" value neither. >> >> Victor >> > > _______ > Py

Re: [Python-Dev] Thoughts on "contexts". PEPs 550, 555, 567, 568

2018-01-10 Thread Guido van Rossum
lier >> discussions). However, at this point, I'd probably need a lot of help to >> make that happen for 3.7. >> >> -- Koos >> >> ___ >> Python-Dev mailing list >> Python-Dev@python.org >> https://mail.python.org/mailman/listinfo/python-dev >> Unsubscribe: https://mail.python.org/mailman/options/python-dev/yselivano >> v.ml%40gmail.com >> > > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Thoughts on "contexts". PEPs 550, 555, 567, 568

2018-01-10 Thread Guido van Rossum
t; —Koos > > > On Wed, Jan 10, 2018 at 6:21 PM, Guido van Rossum > wrote: > >> The current status of PEP 555 is "Withdrawn". I have no interest in >> considering it any more, so if you'd rather see a decision from me I'll be >> happy to change it

Re: [Python-Dev] PEP 567 pre v3

2018-01-12 Thread Guido van Rossum
uot;variable" or "name", the > current design makes sense (at least to me). > > Paul > _______ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https:/

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Guido van Rossum
r reset() I wouldn't know what the use case for idempotency would be.) -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Guido van Rossum
;s like the old RPC transparency problem, which was never solved IIRC. There are just too many things you need to be aware of before you can successfully offload something to a different process. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev m

Re: [Python-Dev] PEP 567 v3

2018-01-16 Thread Guido van Rossum
ant) version -- it makes it clear to the human reader of the code which variable is being reset. And it's not like it's going to be used that much -- it'll be likely hidden inside a context manager. -- --Guido van Rossum (python.org/~guido)

Re: [Python-Dev] Positional-only parameters in Python

2018-01-17 Thread Guido van Rossum
_ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > > -- --Guido van Rossum (python.org/~guido) _

Re: [Python-Dev] PEP 567 v3

2018-01-17 Thread Guido van Rossum
Perhaps you can update the PEP with a summary of the rejected ideas from this thread? On Jan 17, 2018 7:23 AM, "Yury Selivanov" wrote: > On Wed, Jan 17, 2018 at 6:03 AM, Antoine Pitrou > wrote: > > On Tue, 16 Jan 2018 17:18:06 -0800 > > Nathaniel Smith wrote: > >> On Tue, Jan 16, 2018 at 5:06

[Python-Dev] Intention to accept PEP 567 (Context Variables)

2018-01-19 Thread Guido van Rossum
ked before then. Please don't rehash issues that have already been debated -- we're unlikely to reach a different conclusion upon revisiting the same issue (read the Rejected Ideas section first). -- --Guido van Rossum (python.org/~guido) ___ Pyt

Re: [Python-Dev] Unexpected bytecode difference

2018-01-19 Thread Guido van Rossum
v mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Positional-only parameters in Python

2018-01-19 Thread Guido van Rossum
Not so fast. I think a PEP is still needed. This change has more repercussions than argument clinic, e.g. it affects 3rd party tooling and bytecode. On Jan 19, 2018 17:00, "Terry Reedy" wrote: > On 1/19/2018 4:49 PM, Mario Corchero wrote: > >> I am happy to put some work into this (and Pablo Gal

Re: [Python-Dev] Positional-only parameters in Python

2018-01-19 Thread Guido van Rossum
ctions in the curses module) don't inspire a lot of copy-cat APIs. OTOH the more plain positional-only arguments are a pretty common need -- for example, for methods that are conventionally used that way, and overridden with disregard for argument names. (IOW I agree with you here. ;-) -- -

Re: [Python-Dev] Positional-only parameters in Python

2018-01-20 Thread Guido van Rossum
On Sat, Jan 20, 2018 at 1:25 AM, Mario Corchero wrote: > OK, if no one has anything against, Pablo and I can start a PEP just for > the ‘/‘ simple syntax (without the argument group part). > Go for it! Note that your target will be Python 3.8. -- --Guido van Rossum (python.o

Re: [Python-Dev] sys.settrace does not produce events for C functions

2018-01-21 Thread Guido van Rossum
t; Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Intention to accept PEP 567 (Context Variables)

2018-01-22 Thread Guido van Rossum
Yury, I am hereby *accepting* the latest version of PEP 567[1]. Congrats! --Guido [1] https://github.com/python/peps/commit/a459539920b9b8c8394ef61058e88a076ef8b133#diff-9d0ccdec754459da5f665cc6c6b2cc06 On Fri, Jan 19, 2018 at 9:30 AM, Guido van Rossum wrote: > There has been useful

Re: [Python-Dev] inconsistency in annotated assigned targets

2018-01-25 Thread Guido van Rossum
inferred trivially. > > >> >> ___ >> Python-Dev mailing list >> Python-Dev@python.org >> https://mail.python.org/mailman/listinfo/python-dev >> Unsubscribe: https://mail.python.org/mailman/options/python-dev/jell

Re: [Python-Dev] Guido's Python 1.0.0 Announcement from 27 Jan 1994

2018-01-27 Thread Guido van Rossum
> My fellow Pythonistas, ask not what our language can do for you, ask > what you can do for our language. > > Mark Lawrence > > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/

Re: [Python-Dev] [python-committers] Welcome the 3.8 and 3.9 Release Manager - Łukasz Langa!

2018-01-27 Thread Guido van Rossum
https://mail.python.org/mailman/listinfo/python-committers >> Code of Conduct: https://www.python.org/psf/codeofconduct/ >> >> > ___ > python-committers mailing list > python-committ...@python.org > https://mail.python

Re: [Python-Dev] [python-committers] Welcome the 3.8 and 3.9 Release Manager - Łukasz Langa!

2018-01-27 Thread Guido van Rossum
Cool trick! Works on Sierra too. I guess it's all part of Apple's drive to merge iOS and OS X... On Sat, Jan 27, 2018 at 2:12 PM, Barry Warsaw wrote: > On Jan 27, 2018, at 17:04, Guido van Rossum wrote: > > > Hardly a surprising choice! Congrats, Łukasz. (And never forg

Re: [Python-Dev] Guido's Python 1.0.0 Announcement from 27 Jan 1994

2018-01-27 Thread Guido van Rossum
Dalke from usenet posts. > > Read on, this is pretty fascinating: https://twitter.com/dabeaz/status/ > 934590421984075776 > > - Ł > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.p

Re: [Python-Dev] Is static typing still optional?

2018-01-28 Thread Guido van Rossum
the > wild (on PyPI or some such), it behooves us to think through all the > usability issues. To me at least, the tri-state hashability was entirely > unexpected and hard to debug -- I had to do a close reading of the source > to figure-out what was happening. > > > Raymond &g

Re: [Python-Dev] Making "-j0" the default setting for the test suite?

2018-01-28 Thread Guido van Rossum
> Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > -- --Guido van Rossum (python.org/~guido) _

Re: [Python-Dev] Making "-j0" the default setting for the test suite?

2018-01-29 Thread Guido van Rossum
I was going to argue, but it's not worth it. What you propose is fine. On Sun, Jan 28, 2018 at 10:03 PM, Nick Coghlan wrote: > On 29 January 2018 at 14:43, Guido van Rossum wrote: > > So why can't you just run "make test" if that's faster? > > I can (and

Re: [Python-Dev] Is static typing still optional?

2018-01-29 Thread Guido van Rossum
nt, setting hash=False or hash=True is much quicker than trying to understand the rules. But the rules *are* deterministic and reasonable. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/ma

Re: [Python-Dev] cls for metaclass?

2018-01-29 Thread Guido van Rossum
___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido% > 40python.org > -- --Guido van Rossum (python.org/~guid

Re: [Python-Dev] Deprecate crypt module and revert PR 3854

2018-02-02 Thread Guido van Rossum
.com/scan.php?page=news_item&px=Fedora- > 28-libxcrypt-Plans > [3] https://github.com/besser82/libxcrypt > [4] https://bugs.python.org/issue32635 > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/ma

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-02 Thread Guido van Rossum
ython-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Deprecate crypt module and revert PR 3854

2018-02-03 Thread Guido van Rossum
what your desired outcome is anyway? On Sat, Feb 3, 2018 at 4:07 AM, Christian Heimes wrote: > On 2018-02-02 17:18, Guido van Rossum wrote: > > I'm all for nudging people in the direction of xcrypt. I assume we can't > > just switch the C-level crypt with xcrypt and

[Python-Dev] Immutability vs. hashability

2018-02-04 Thread Guido van Rossum
e *not* equivalent (consider a tuple containing a list) I'm not at all convinced that any API in the core language should "reflect" this misconception, depending on how you meant that. -- --Guido van Rossum (python.org/~guido) ___ P

Re: [Python-Dev] Immutability vs. hashability

2018-02-04 Thread Guido van Rossum
b 4, 2018 at 5:54 PM, Nick Coghlan wrote: > On 5 February 2018 at 08:31, Guido van Rossum wrote: > > On Sun, Feb 4, 2018 at 11:59 AM, Chris Barker - NOAA Federal > > wrote: > >> > >> I think the folks that are concerned about this issue are quite right > >

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-04 Thread Guido van Rossum
n from StackOverflow anyway. The docs can point to frozen=True and explain the danger. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-05 Thread Guido van Rossum
I'm sorry, but a solution that requires __class__ assignment is way too fragile for my taste. On Mon, Feb 5, 2018 at 6:28 AM, Nick Coghlan wrote: > On 5 February 2018 at 15:49, Guido van Rossum wrote: > > My point is that once you have one of those patterns in place, changing &

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-05 Thread Guido van Rossum
If there's going to be an API for it, it should be in the class, not something that mutates the class afterwards. On Mon, Feb 5, 2018 at 1:59 AM, Kirill Balunov wrote: > On Sun, Feb 4, 2018, 9:50 PM Guido van Rossum <https://mail.python.org/mailman/listinfo/python-dev>> wrote:

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-05 Thread Guido van Rossum
Yes, that's what I meant -- "afterwards" meaning after the @dataclass decorator is applied. On Mon, Feb 5, 2018 at 11:09 AM, Kirill Balunov wrote: > > 2018-02-05 20:47 GMT+03:00 Guido van Rossum : > >> If there's going to be an API for it, it should be

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-06 Thread Guido van Rossum
an burden all uses of the hash > parameter, good and bad, with the unsafe label. > > > -- > Steve > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://ma

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-06 Thread Guido van Rossum
). It will also disregard fields declared using field(compare=False, hash=False|None). On Tue, Feb 6, 2018 at 10:11 AM, Ethan Furman wrote: > On 02/06/2018 09:38 AM, Guido van Rossum wrote: > > Where do you get the impression that one would have to explicitly request >> __hash__

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-06 Thread Guido van Rossum
Honestly, the name I would most want for the keyword argument is '_hash'. > That carries the semantics I desire. > > On Feb 6, 2018 10:13 AM, "Ethan Furman" wrote: > >> On 02/06/2018 09:38 AM, Guido van Rossum wrote: >> >> Where do you get the impre

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-06 Thread Guido van Rossum
s(frozen=True)) -- nothing we can do about the *field* will change this. Of course if you use @dataclass(frozen=True, unsafe_hash=True) you may still get a safe hash. :-) -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-06 Thread Guido van Rossum
quest. Let's wait whether it's actually needed a lot before designing it. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-06 Thread Guido van Rossum
(None). > > -- > Eric > > On Feb 5, 2018, at 12:49 AM, Guido van Rossum wrote: > > Looks like this is turning into a major flamewar regardless of what I say. > :-( > > I really don't want to lose the ability to add a hash function to a > mutable dataclass by f

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-06 Thread Guido van Rossum
I'm not a fan, sorry. On Tue, Feb 6, 2018 at 7:33 PM, Ethan Furman wrote: > On 02/06/2018 06:48 PM, Guido van Rossum wrote: > > That seems a rare case (though I hadn't thought of it). I had thought of >> the use case where you want a frozen type >> without

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-16 Thread Guido van Rossum
? Also, a small example that demonstrates your need would do wonders to help us understand your use case better. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-17 Thread Guido van Rossum
Why can'y you make `name` on `NamedObjectItem` a property that returns ` self.obj.name`? Why store a duplicate copy of the name? PS. I have to ponder why frozen dataclasses don't use `__new__`. On Fri, Feb 16, 2018 at 11:43 PM, Ben Lewis wrote: > On Sat, Feb 17, 2018 at 6:40

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-17 Thread Guido van Rossum
fields['j'] = database.lookup('j') > > I personally see two problems with this idea: > 1. This isn't as ergonomic as __post_init__ is as its modifing a > dictionary instead of its instance. > 2. To implement this, it would require a metaclass. >

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-18 Thread Guido van Rossum
wrote: > On 18 February 2018 at 14:10, Guido van Rossum wrote: > > Agreed the __pre_init__ idea is no improvement. I think we're back where > you > > started -- just use `object.__setattr__` to set the attribute in > > `__post_init__`. That's what the PEP says is

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-19 Thread Guido van Rossum
then wanting it hashable. > > Which pointed to the idea of a “ freeze this from now on” method. > > This seems another use case — maybe it would be helpful to be able to > freeze an instance after creation for multiple use-cases? > > -CHB > --

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-20 Thread Guido van Rossum
On Mon, Feb 19, 2018 at 8:16 PM, Glenn Linderman wrote: > On 2/19/2018 7:02 PM, Guido van Rossum wrote: > > But how? > > On Mon, Feb 19, 2018 at 5:06 PM, Chris Barker - NOAA Federal < > chris.bar...@noaa.gov> wrote: > >> ... maybe it would be helpful to be ab

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-20 Thread Guido van Rossum
solutions now that people can implement as separate class decorators and distribute via PyPI (or copy into their own codebase) so I don't think now's the time to consider adding this to dataclasses. Maybe for Python 3.8. -- --Guido van Rossum (python.org/~guido) _

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-20 Thread Guido van Rossum
On Tue, Feb 20, 2018 at 1:37 PM, Eric V. Smith wrote: > On 2/17/2018 2:35 PM, Guido van Rossum wrote: > >> PS. I have to ponder why frozen dataclasses don't use `__new__`. >> > > As I'm sure everyone is now aware after the rest of this discussion: it's >

Re: [Python-Dev] How is the GitHub workflow working for people?

2018-02-21 Thread Guido van Rossum
ido said "no" to this from the outset. > I'm willing to reconsider if there's a good enough tool. Ditto for C code (or do we already do it for C?). FWIW I'm personally hugely happy with the new workflow -- my only regret is that we're not using GitHub for issue tra

Re: [Python-Dev] How is the GitHub workflow working for people?

2018-02-21 Thread Guido van Rossum
volunteer steps up we might consider it (a PEP would have to be written). -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.or

Re: [Python-Dev] PEP 467 (Minor API improvements for binary sequences) - any thoughts?

2018-02-21 Thread Guido van Rossum
ion > > chris.bar...@noaa.gov > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > >

Re: [Python-Dev] How is the GitHub workflow working for people?

2018-02-21 Thread Guido van Rossum
n't respond to this thread. --Guido On Wed, Feb 21, 2018 at 7:03 PM, Dan Stromberg wrote: > On Wed, Feb 21, 2018 at 2:19 PM, Barry Warsaw wrote: > > On Feb 21, 2018, at 13:22, Guido van Rossum wrote: > >> > >> I'm willing to reconsider if there's a

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