Re: [Python-ideas] a set of enum.Enum values rather than the construction of bit-sets as the "norm"?

2017-12-30 Thread Guido van Rossum
rd example). When using IntFlag, you just use 0. On Sat, Dec 30, 2017 at 9:33 PM, Guido van Rossum <gu...@python.org> wrote: > On Sat, Dec 30, 2017 at 8:50 PM, Franklin? Lee < > leewangzhong+pyt...@gmail.com> wrote: >> >> Paddy might want something like this: >>

Re: [Python-ideas] a set of enum.Enum values rather than the construction of bit-sets as the "norm"?

2017-12-30 Thread Guido van Rossum
pass set() -- you can't use {} since that's an empty dict, not an empty set - one flag: you'd have to pass {Foo.BAR} rather than just Foo.BAR - two flags: you'd have to pass {Foo.BAR, Foo.BAZ} rather than Foo.BAR | Foo.BAZ I think for each of these the proposal would be strictly worse than the current c

Re: [Python-ideas] Change the __repr__ of the `MappingView`s

2017-12-30 Thread Guido van Rossum
; > It's because __init__ in MappingView treat the passed argument -- wich is > stored in self._mapping -- as the whole mapping, not just keys, values or > items... And all the other methods (__contains__ and __iter__) in the > subclasses are using this _mapping attribute to work. > > > So what is to prioritize?

Re: [Python-ideas] Make MappingView inherit from Collection instead of Sized

2017-12-29 Thread Guido van Rossum
This sounds like a good observation. I recommend opening a bug and preparing a PR if you can (a PR would also help finding if there are any problems with the idea). On Dec 29, 2017 9:50 AM, "Yahya Abou 'Imran via Python-ideas" < python-ideas@python.org> wrote: > After I generate an UML diagram

Re: [Python-ideas] Improve ABCs _dump_registry() readability

2017-12-31 Thread Guido van Rossum
ry instead, should'nt > they? > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python

Re: [Python-ideas] pdb to support running modules

2018-01-04 Thread Guido van Rossum
thon-ideas mailing list >> Python-ideas@python.org >> https://mail.python.org/mailman/listinfo/python-ideas >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > > > ___________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo

Re: [Python-ideas] Official site-packages/test directory

2018-01-19 Thread Guido van Rossum
list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-19 Thread Guido van Rossum
On Fri, Jan 19, 2018 at 5:30 AM, M.-A. Lemburg <m...@egenix.com> wrote: > On 19.01.2018 05:38, Nathaniel Smith wrote: > > On Thu, Jan 18, 2018 at 7:51 PM, Guido van Rossum <gu...@python.org> > wrote: > >> Can someone explain to me why this is such a con

Re: [Python-ideas] Official site-packages/test directory

2018-01-19 Thread Guido van Rossum
-packages/test directory. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-19 Thread Guido van Rossum
mappings as > new encodings that work just like the other ones. > > On Fri, 19 Jan 2018 at 11:54 M.-A. Lemburg <m...@egenix.com> wrote: > >> On 19.01.2018 17:20, Guido van Rossum wrote: >> > On Fri, Jan 19, 2018 at 5:30 AM, M.-A. Lemburg <m...@egenix.com >>

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-21 Thread Guido van Rossum
uring WW1. There's not much I can do in such case (except point out that the status quo wins). -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-25 Thread Guido van Rossum
as > Code of Conduct: http://python.org/psf/codeofconduct/ > > -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-26 Thread Guido van Rossum
tion is only a few lines -- perhaps it's enough to just add it as an example to the docs, rather than to add it as a new function to concurrent.futures? A doc change can be added to 3.7! -- --Guido van Rossum (python.org/~guido) ___ Python-ideas m

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-26 Thread Guido van Rossum
o otherwise, and distributes the load > across the workers, while having direct access to the outputs of the calls > to c. > > -dancollins34 > > Sent from my iPhone > > On Jan 26, 2018, at 1:07 AM, Guido van Rossum <gu...@python.org> wrote: > > I really don't want to

Re: [Python-ideas] Adding str.isascii() ?

2018-01-26 Thread Guido van Rossum
. > That's fine with me. Please also add it to bytes and bytearray objects. It's okay if the implementation has to scan the string -- so do isdigit() etc. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-26 Thread Guido van Rossum
s later, a “but you can use them for this” example was provided. > > -dancollins34 > > Sent from my iPhone > > On Jan 26, 2018, at 1:05 PM, Guido van Rossum <gu...@python.org> wrote: > > On Fri, Jan 26, 2018 at 9:20 AM, Daniel Collins <dancollin...@gmail.com> &

Re: [Python-ideas] Make functions, methods and descriptor types living in the types module

2018-01-12 Thread Guido van Rossum
> File "", line 1, in >> _pickle.PicklingError: Can't pickle : attribute >> lookup function on builtins failed >> >> And this will help to implement the pickle support of dynamic >> functions etc. Currently the third-party library that implements >> this needs to use a special purposed factory function (not >> compatible with other similar libraries) since types.FunctionType >> isn't pickleable. >> > -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Adding str.isascii() ?

2018-01-26 Thread Guido van Rossum
's limitations. > > > -- > Steve > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (p

Re: [Python-ideas] Adding str.isascii() ?

2018-01-26 Thread Guido van Rossum
bject. > Sorry, no. The existing internal flag is an implementation detail that should not show in the API. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Dataclasses, keyword args, and inheritance

2018-01-29 Thread Guido van Rossum
feature to mean "there's no reason to try to implement this." > > On Mon, Jan 29, 2018 at 11:05 AM Guido van Rossum <gu...@python.org> > wrote: > >> I think that settles it -- there's no reason to try to implement this. >> >> On Mon, Jan 29, 2018 at 10:51 AM, G

Re: [Python-ideas] Adding str.isascii() ?

2018-01-31 Thread Guido van Rossum
gt; it more), but since it is added I don't see much benefit from removing it. > > > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http:

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-31 Thread Guido van Rossum
On Wed, Jan 31, 2018 at 3:03 AM, Serhiy Storchaka <storch...@gmail.com> wrote: > 19.01.18 05:51, Guido van Rossum пише: > >> Can someone explain to me why this is such a controversial issue? >> >> It seems reasonable to me to add new encodings to the stdlib that do

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-31 Thread Guido van Rossum
.18 18:36, Guido van Rossum пише: > > On Wed, Jan 31, 2018 at 3:03 AM, Serhiy Storchaka <storch...@gmail.com >> <mailto:storch...@gmail.com>> wrote: >> >> 19.01.18 05:51, Guido van Rossum пише: >> >> Can someone explain to me why t

Re: [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module

2018-02-12 Thread Guido van Rossum
"""~self""" > > > > > > # register bool and numpy bool_ as virtual subclasses > > # so that issubclass(bool, Boolean) = issubclass(np.bool_, Boolean) = True > > Boolean.register(bool) > > > > try: > > import numpy as np > > Boolean.register(np.bool_) > &

Re: [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module

2018-02-14 Thread Guido van Rossum
Can you show some sample code that you have written that shows where this would be useful? Note that using the numbers package actually makes static type checking through e.g. mypy difficult. So I presume you are talking about dynamic checking? --Guido On Feb 14, 2018 12:42 AM, "Sylvain MARIE"

Re: [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module

2018-02-14 Thread Guido van Rossum
t dependent on MyPy. > > > > Sylvain > > > > *De :* gvanros...@gmail.com [mailto:gvanros...@gmail.com] *De la part de* > Guido van Rossum > *Envoyé :* mercredi 14 février 2018 19:47 > *À :* Sylvain MARIE <sylvain.ma...@schneider-electric.com> > > *Cc :* python-i

Re: [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module

2018-02-14 Thread Guido van Rossum
the bloodstreams of the sick; food > from the bellies of the hungry; books from the hands of the > uneducated; technology from the underdeveloped; and putting > advocates of freedom in prisons. Intellectual property is > to the 21st century what the slave trade was to the 16th. > &g

Re: [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module

2018-02-14 Thread Guido van Rossum
s.Integral. And the reason is that few people (outside hardcore np fans) will want to write numbers.Integral instead of int. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/li

Re: [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module

2018-02-15 Thread Guido van Rossum
. But maybe > that’s too much of type checking for the python philosophy ? I’m wondering > if we’re going too far here… > > > > Anyway, again, my point is just about consistency: if this is available > for numbers, why not for simple Booleans? > > > > Sylvain > > >

Re: [Python-ideas] Why CPython is still behind in performance for some widely used patterns ?

2018-02-20 Thread Guido van Rossum
On Tue, Feb 20, 2018 at 12:54 PM, Barnstone Worthy <ba...@barrys-emacs.org> wrote: I'm pretty sure that's an alias for Barry Warsaw. :-) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org

Re: [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module

2018-02-20 Thread Guido van Rossum
gral as an alias for backwards compatibility. I don't think it's a huge problem to fix this in 3.7b2, if someone wants to do the work. On Mon, Feb 19, 2018 at 9:53 PM, Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > Guido van Rossum writes: > > > Hm, perhaps Integral

Re: [Python-ideas] List assignment - extended slicing inconsistency

2018-02-22 Thread Guido van Rossum
? > Summary > === > I find it it not acceptable as a good language design that there is a > large range of behaviour on slicing in assignment target for the different > native (and standard library) data type of seemingly similar kind, and that > users have to figure out for each data type by testing - or at the very > least remember if documented - how it behaves on slicing in assignment > targets. There should be a consistent behaviour at the very least, ideally > even one with a clear user interface as suggested for lists. > Fortunately, what *you* find acceptable or good language design is not all that important. (You can avoid making any mistakes in your own language. :-) You may by now realize that 100% consistent behavior is hard to obtain. However we'll gladly consider your feedback. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Boolean ABC similar to what's provided in the 'numbers' module

2018-02-19 Thread Guido van Rossum
ugh it's also possible that it was simply a mistake. In general I don't like adding aliases for different spellings -- it violates TOOWTDI. If we decide that this really was a mistake we should go ahead and make Integer the recommended way and define Integral as an alias for backwards compatibility. -

Re: [Python-ideas] a set of enum.Enum values rather than the construction of bit-sets as the "norm"?

2018-01-03 Thread Guido van Rossum
On Wed, Jan 3, 2018 at 8:24 AM, Random832 <random...@fastmail.com> wrote: > On Sun, Dec 31, 2017, at 00:33, Guido van Rossum wrote: > > I'm not keen on this recommendation. An argument that takes a Set[Foo] > > would mean that in order to specify: > > - no flags: you'

Re: [Python-ideas] a set of enum.Enum values rather than the construction of bit-sets as the "norm"?

2018-01-01 Thread Guido van Rossum
gt; > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) _

Re: [Python-ideas] "Exposing" `__min__` and `__max__`

2018-06-20 Thread Guido van Rossum
_______ >> Python-ideas mailing list >> Python-ideas@python.org >> https://mail.python.org/mailman/listinfo/python-ideas >> Code of Conduct: http://python.org/psf/codeofconduct/ >> > > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] On evaluating features [was: Unpacking iterables for augmented assignment]

2018-08-28 Thread Guido van Rossum
am not so keen, because the ambiguity of `a, b, c += x`. Perhaps someone can do some research and unearth real code that contains series of += assignments that would become more readable by collapsing them into a single line using the proposed construct. -- --Guido van Rossum (python.org/~guido

Re: [Python-ideas] slice[] to get more complex slices

2018-07-23 Thread Guido van Rossum
eed a metaclass -- it can be implemented as __class_getitem__. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Why shouldn't Python be better at implementing Domain Specific Languages?

2018-08-30 Thread Guido van Rossum
to be written without parentheses, but it was too hard to make it unambiguous (e.g. would "foo +1" mean "foo(+1)" or "foo + 1"?) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@py

Re: [Python-ideas] Why shouldn't Python be better at implementing Domain Specific Languages?

2018-08-30 Thread Guido van Rossum
On Fri, Aug 31, 2018 at 4:04 AM, David Mertz wrote: > On Thu, Aug 30, 2018 at 9:41 PM Guido van Rossum wrote: > >> On Fri, Aug 31, 2018 at 3:19 AM, Michael Selik wrote: >> >>> On Thu, Aug 30, 2018 at 5:31 PM James Lu wrote: >>> >>>> It would

Re: [Python-ideas] Add new `Symbol` type

2018-07-06 Thread Guido van Rossum
gt; > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] anyone need a frozenset or bytearray literal?

2018-07-11 Thread Guido van Rossum
Disassemble this or look at f.__code__.co_consts and you'll see (1, 2, >> 3) as a single constant; but the others have to be built. >> >> +1 on set.freeze(); +0 on bytes.to_bytearray(). >> >> ChrisA >> ___________

Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-18 Thread Guido van Rossum
(Modifying existing encodings seems wrong -- did the feature request somehow transmogrify into that?) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code

Re: [Python-ideas] Repurpose `assert' into a general-purpose check

2018-01-18 Thread Guido van Rossum
ng past (a) isn't so easy. So don't get nerd-sniped by the solution for (b) alone.) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Add MutableSet.update?

2018-03-09 Thread Guido van Rossum
on.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > > -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mai

Re: [Python-ideas] Descouraging the implicit string concatenation

2018-03-14 Thread Guido van Rossum
I use the feature regularly for long error messages, and when combined with .format() or % it's not so easy to replace it with a + (it would require adding parentheses). So I am against formally discouraging it or adding something to PEP 8. However linters could warn about lists of

Re: [Python-ideas] Disallow importing the same module under multiple names

2018-03-14 Thread Guido van Rossum
n Barnwell > "Do not follow where the path may lead. Go, instead, where there is no > path, and leave a trail." >--author unknown > > ___ > Python-ideas mailing list > Python-ideas@python.org &

Re: [Python-ideas] Start argument for itertools.accumulate() [Was: Proposal: A Reduce-Map Comprehension and a "last" builtin]

2018-04-08 Thread Guido van Rossum
:19 AM, Nick Coghlan <ncogh...@gmail.com> wrote: > > On 8 April 2018 at 14:31, Guido van Rossum <gu...@python.org> wrote: > >> Given that two respected members of the community so strongly disagree > >> whether accumulate([], start=0) should behave like accumulate([

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-04-08 Thread Guido van Rossum
lready* introduce their own scope. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Start argument for itertools.accumulate() [Was: Proposal: A Reduce-Map Comprehension and a "last" builtin]

2018-04-10 Thread Guido van Rossum
average (getting the trend for free) - to emphasize the sum, draw a histogram -- in my mind I add up the sizes of the bars -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mai

Re: [Python-ideas] Is there any idea about dictionary destructing?

2018-04-10 Thread Guido van Rossum
of schema-guided parser though.) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Start argument for itertools.accumulate() [Was: Proposal: A Reduce-Map Comprehension and a "last" builtin]

2018-04-07 Thread Guido van Rossum
; > That approach would have the advantage of making the default value of > "start" much easier to document (since it would just be zero, the same > as it is for sum()), and only the length of the input iterable and > "yield_start" would affe

Re: [Python-ideas] PEP 572: Assignment Expressions (post #4)

2018-04-12 Thread Guido van Rossum
ng >> >> if (x ;= i) + 1: >> >> On the third hand, requiring parentheses all the time would also feel >> strained: >> >> while m := someregexp.match(somestring): >> >> is already impossible to misread. >> >> Annoyin

Re: [Python-ideas] Accepting multiple mappings as positional arguments to create dicts

2018-04-12 Thread Guido van Rossum
t; > >>> dict(chain.from_iterable(c.items() for c in configs)) > {'a': 'yes', 'b': 'no', 'c': 3} Yes, this all sounds totally reasonable. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Default values in multi-target assignment

2018-04-12 Thread Guido van Rossum
0: (a, b))(*c) > > ___________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] PEP 572: Assignment Expressions (post #4)

2018-04-12 Thread Guido van Rossum
> None if var:= function() is None else var.method() > > Still not bad looking. > Though a long way from function()?.method() per PEP 505. :-) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org http

Re: [Python-ideas] Proposal: A Reduce-Map Comprehension and a "last" builtin

2018-04-06 Thread Guido van Rossum
a > This would allow updating variables in a generator (I don't see the need > for ":=" or "f() as a") but that's another discussion > Please join the PEP 572 discussion. The strongest contender currently is `a := f()` and for good reasons. -- --Guido van Rossum (python.o

Re: [Python-ideas] Checking interned string after stringobjects concat?

2018-04-21 Thread Guido van Rossum
But to the OP, this is not considered a bug. On Sat, Apr 21, 2018, 07:59 Serhiy Storchaka wrote: > 21.04.18 17:47, Chris Angelico пише: > > On Sat, Apr 21, 2018 at 10:29 PM, Serhiy Storchaka > wrote: > >> 21.04.18 13:42, Chris Angelico пише: > >>> >

Re: [Python-ideas] Change magic strings to enums

2018-04-25 Thread Guido van Rossum
On Wed, Apr 25, 2018, 01:03 Jeroen Demeyer wrote: > On 2018-04-25 09:57, Ivan Levkivskyi wrote: > > In the latter case rewriting EnumMeta in C > > ... or Cython. It's a great language and I'm sure that the Python > standard library could benefit a lot from it. > No, the

Re: [Python-ideas] Change magic strings to enums

2018-04-25 Thread Guido van Rossum
On Wed, Apr 25, 2018, 02:13 Jacco van Dorp wrote: > ... Which is where the auto-completion comes in. ... > Designing the language with auto-complete in mind feels wrong to me. It assumes a very sophisticated IDE and may lead to lazy design compromises. --Guido >

Re: [Python-ideas] Spelling of Assignment Expressions PEP 572 (was post #4)

2018-04-16 Thread Guido van Rossum
g boolean variables, so > `target ? expr` could mean `expr if target else target`. Other proposal for > null/boolean checking might need `?`, let's preserve `?` character for > further development. > The only acceptable use of ? is formul

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-03-27 Thread Guido van Rossum
This thread is dead. On Tue, Mar 27, 2018 at 5:40 PM, Rob Cliffe via Python-ideas < python-ideas@python.org> wrote: > > > On 28/03/2018 01:19, Steven D'Aprano wrote: > >> On Wed, Mar 28, 2018 at 12:08:24AM +0100, Rob Cliffe via Python-ideas >> wrote: >> >&

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-03-27 Thread Guido van Rossum
On Tue, Mar 27, 2018 at 7:00 AM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 27 March 2018 at 01:57, Guido van Rossum <gu...@python.org> wrote: > > On Mon, Mar 26, 2018 at 7:57 AM, Nick Coghlan <ncogh...@gmail.com> > wrote: > >> By contrast, the subloc

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-27 Thread Guido van Rossum
s-level x, and a class-level comprehension references x assuming it to be the global. So we need to tread carefully even here -- but this case is weird already: x = 42 class C: x = [1, 2, 3] z = [x+y for y in x] # [43, 44, 45] -- --Guido van Rossum (python.org/~guido) __

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-27 Thread Guido van Rossum
On Tue, Mar 27, 2018 at 11:43 AM, Ethan Furman <et...@stoneleaf.us> wrote: > On 03/27/2018 11:12 AM, Ivan Levkivskyi wrote: > >> On 27 March 2018 at 18:19, Guido van Rossum wrote: >> > > Hm, so maybe we shouldn't touch lambda, but we can at least fix the scope

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-27 Thread Guido van Rossum
On Tue, Mar 27, 2018 at 11:51 AM, Ivan Levkivskyi <levkivs...@gmail.com> wrote: > On 27 March 2018 at 19:43, Ethan Furman <et...@stoneleaf.us> wrote: > >> On 03/27/2018 11:12 AM, Ivan Levkivskyi wrote: >> >>> On 27 March 2018 at 18:19, Guido van Rossum wro

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-03-25 Thread Guido van Rossum
On Sun, Mar 25, 2018 at 6:29 PM, Chris Angelico <ros...@gmail.com> wrote: > On Mon, Mar 26, 2018 at 12:24 PM, Guido van Rossum <gu...@python.org> > wrote: > > The scope question is far from easy though. I find it particularly > grating > > that an inline assig

Re: [Python-ideas] threading lock and isinstance

2018-03-29 Thread Guido van Rossum
> Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido)

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-03-26 Thread Guido van Rossum
On Mon, Mar 26, 2018 at 7:57 AM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 26 March 2018 at 14:34, Guido van Rossum <gu...@python.org> wrote: > > Not so fast. There's a perfectly reasonable alternative to sublocal > scopes > > -- just let it assign to a local va

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-03-24 Thread Guido van Rossum
xt) as m) and check((m.group(0) as g)): print(g) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] PEP 572 version 2: Statement-Local Name Bindings

2018-03-24 Thread Guido van Rossum
cial rules around class scope count are a wonderful feature. 28 years ago it was the best we could do, and by the time we realized its problems -- all rare edge cases for sure, but unintuitive and hard to debug when they strike -- we were tied by backward compatibility. And we still are. (At the tim

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-03-25 Thread Guido van Rossum
st comprehensions could change, > too - instead of creating a function, they just create a sublocal > scope. > > That may be the best way forward. I'm not sure. > > ChrisA > I don't think the PEP should be split up into two PEPs. The two topics are too closely related. But you ca

[Python-ideas] Fixing class scope brainstorm

2018-03-25 Thread Guido van Rossum
so they can close over class variables? Not sure what should happen to nested classes, they should probably be lumped in with the 'def' scopes. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https

Re: [Python-ideas] PEP draft: Unifying function/method classes

2018-04-02 Thread Guido van Rossum
rst. > > > Thanks, > Jeroen. > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofc

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-04-02 Thread Guido van Rossum
it gets, from someone > who studied math before C anyway. > > -Mike > > > > On 2018-03-30 12:04, Nikolaus Rath wrote: > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-03-30 Thread Guido van Rossum
On Fri, Mar 30, 2018 at 12:04 PM, Nikolaus Rath <nikol...@rath.org> wrote: > On Mar 25 2018, Guido van Rossum <guido-+ZN9ApsXKcEdnm+yROfE0A@ > public.gmane.org> wrote: > > I gotta say I'm warming up to := in preference over 'as', *if* we're > going > > to do this

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-26 Thread Guido van Rossum
On Mon, Mar 26, 2018 at 6:33 AM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 26 March 2018 at 01:50, Guido van Rossum <gu...@python.org> wrote: > > In the PEP 572 threads there's some grumbling about class scopes. > > > > Here's a random brainstorm. How abo

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings, take three!

2018-03-25 Thread Guido van Rossum
ar from easy though. I find it particularly grating that an inline assignment occurs in an 'if' statement, its scope is the entire body of the 'if'. If that body is two pages long, by the end of it the reader (or even the writer!) may well have lost track of where it was defined and may be confused by the cons

Re: [Python-ideas] Adding quantile to the statistics module

2018-03-17 Thread Guido van Rossum
e > quantiles, but unfortunately you're not going to find TOOWTDI. > > -n > > -- > Nathaniel J. Smith -- https://vorpus.org > ___________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailma

Re: [Python-ideas] PEP 572 version 2: Statement-Local Name Bindings

2018-03-23 Thread Guido van Rossum
uld certainly suit a language that is widely used in > education to sharpen the distinction between assignment and equality > operators. > > Cheers, > Christoph > ___ > Python-ideas mailing list >

Re: [Python-ideas] PEP 572: Statement-Local Name Bindings

2018-03-01 Thread Guido van Rossum
e ever used has been slow and klunky > to use compared to a mail/news client. > We can kill this topic right now. We'll be moving to MM3, which is a mailing list for those who like email, and can also be used as a web forum for those who like that. Personally I'm partial to both, so I think

Re: [Python-ideas] Medium for discussion potential changes to python (was: PEP 572: Statement-Local Name Bindings)

2018-03-01 Thread Guido van Rossum
___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) ___ Py

Re: [Python-ideas] Add a __cite__ method for scientific packages

2018-06-28 Thread Guido van Rossum
ore information. >>> It makes total sense to add citations/references to this list (and those should probably print a reference for Python followed by instructions on how to get references for other packages and how to properly add a reference to

Re: [Python-ideas] support toml for pyproject support

2018-10-08 Thread Guido van Rossum
L or perhaps something even simpler than either one. > I feel the same way. (Somebody was requesting extensive TOML support for mypy and was also waving those PEPs in front of us.) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas

Re: [Python-ideas] Add closing and iteration to threading.Queue

2018-10-21 Thread Guido van Rossum
. Nathaniel, would you be able to elaborate more on the issue of backpressure? I think a lot of people here are not really familiar with the concepts and its importance, and it changes how you have to think about queues and the like. -- --Guido van Rossum (python.org/~guido

Re: [Python-ideas] Allow Context Managers to Support Suspended Execution

2018-11-01 Thread Guido van Rossum
> ___________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Return for assignment blocks

2018-10-25 Thread Guido van Rossum
much narrower. So unless we find more use cases, or until we can convince ourselves that we can use `def (args): block` in all expression contexts, I guess it'll have to remain an idea. Thank you though! It was a fascinating one. -- --Guido van Rossum (python.org/~guido) _

Re: [Python-ideas] name2type mapping

2018-10-25 Thread Guido van Rossum
atic type checking (PEPs 484, 526, 544, 561) it may be PEP-worthy. As a compromise, perhaps some discussion can take place in the issue tracker of the repo (https://github.com/guettli/python-name2type-mapping) Thomas created? If someone with PEP experience is interested they can guide Thomas into

Re: [Python-ideas] dict.setdefault_call(), or API variations thereupon

2018-11-01 Thread Guido van Rossum
nce is created, while setdefault() is used when inserting a value. A major issue IMO with defaultdict is that if you try to *read* a non-existing key it will be inserted. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-i

Re: [Python-ideas] dict.setdefault_call(), or API variations thereupon

2018-11-01 Thread Guido van Rossum
The two are less connected than you seem to think. On Thu, Nov 1, 2018 at 7:08 PM Alex Shafer wrote: > I had actually managed to miss collections.defaultdict! > > I'd like to instead propose that a reference to that be added to the > dict.setdefault docs. I can't imagine I'm the only one that

Re: [Python-ideas] Decide if `type.__subclasses__` is part of future Python or not

2018-10-29 Thread Guido van Rossum
> list of > immediate subclasses" > > To fully figure out what it did, I had to read the source code to Python > -- which really is not the best way to figure out what a function does; > hence the request to document it (and indicate it's future existence in > python) >

Re: [Python-ideas] Introduce typing.SupportsFsPath

2018-10-08 Thread Guido van Rossum
cts (without > dependency to "Path") > that are implementing the __fspath__ protocol. > > robert > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Co

Re: [Python-ideas] f-string "debug" conversion

2018-10-03 Thread Guido van Rossum
Gah! You are overthinking it. This idea is only worth it if it's dead simple, and the version that Eric posted to start this thread, where !d uses the repr() of the expression, is the only one simple enough to bother implementing. -- --Guido van Rossum (python.org/~guido

Re: [Python-ideas] add a time decorator to timeit.py

2018-10-07 Thread Guido van Rossum
e empty coffee pot. > > -- > Jonathan > > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- --Guido van Rossum (python.org/~guido) ___

Re: [Python-ideas] PEPs: Theory of operation [was: Moving to another forum system ...]

2018-09-22 Thread Guido van Rossum
authors based on the text they show us. I have to admit that I've not followed the full context, but I recommend that you try to see that other posters in this thread are trying to help with kindness, not judging you or your skills. Good luck with your PEP

Re: [Python-ideas] NAN handling in the statistics module

2019-01-07 Thread Guido van Rossum
nk other stdlib libraries are not beholden to that behavior.) -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Guido van Rossum
ress named Samantha Quan. -- --Guido van Rossum (python.org/~guido) ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Re: for ... except, with ... except

2019-07-31 Thread Guido van Rossum
On Wed, Jul 31, 2019 at 2:06 AM Rob Cliffe via Python-ideas < python-ideas@python.org> wrote: > > > On 31/07/2019 00:35:59, Eric V. Smith wrote: > >> On Jul 30, 2019, at 11:38 AM, Guido van Rossum > wrote: > >> > > .. > > > >> with

[Python-ideas] Re: Namespace context managers

2019-07-29 Thread Guido van Rossum
successor of namedtuple is typing.NamedTuple which supports this syntactically. From the [docs]( https://docs.python.org/3/library/typing.html#typing.NamedTuple): ``` class Employee(NamedTuple): name: str id: int ``` -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is

[Python-ideas] Re: [new idea] dynamic return with using function argument

2019-08-26 Thread Guido van Rossum
in that position. But I don't think the use case is as strong as the OP believes it is. --Guido On Mon, Aug 26, 2019 at 10:02 AM Andrew Barnert wrote: > On Aug 26, 2019, at 08:38, Guido van Rossum wrote: > > Sorry, there is no way to leverage the implementation or syntax of := for > this purpo

  1   2   3   4   5   6   7   8   9   >