[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-08 Thread Christopher Barker
On Mon, Feb 8, 2021 at 10:49 PM Inada Naoki wrote: > I think it's MUCH better to have ONE way to do something that works, for > Python, on all platforms. That way people that only know one platform can > still write and document code that can work on all platforms. > > This thread is only for

[Python-ideas] Re: class(obj) could return obj.__class__

2021-02-08 Thread Chris Angelico
On Tue, Feb 9, 2021 at 6:39 PM Hans Ginzel wrote: > > Please, consider class(obj) to return obj.__class__ > consistenly with dir(), vars(), repr(), str(),… > > >>> class c: pass > >>> o = c() > >>> o.__class__ > > >>> class(o) >File "", line 1 > class(o) > ^ > SyntaxError:

[Python-ideas] Re: class(obj) could return obj.__class__

2021-02-08 Thread Inada Naoki
Please use type(o) instead. On Tue, Feb 9, 2021 at 4:36 PM Hans Ginzel wrote: > > Please, consider class(obj) to return obj.__class__ > consistenly with dir(), vars(), repr(), str(),… > > >>> class c: pass > >>> o = c() > >>> o.__class__ > > >>> class(o) >File "", line 1 > class(o) >

[Python-ideas] class(obj) could return obj.__class__

2021-02-08 Thread Hans Ginzel
Please, consider class(obj) to return obj.__class__ consistenly with dir(), vars(), repr(), str(),… class c: pass o = c() o.__class__ class(o) File "", line 1 class(o) ^ SyntaxError: invalid syntax H. ___ Python-ideas mailing list

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-08 Thread Inada Naoki
On Tue, Feb 9, 2021 at 3:37 PM Christopher Barker wrote: > > On Mon, Feb 8, 2021 at 6:11 PM Inada Naoki wrote: >> >> > >> Unlike Windows, environment variables work very fine for such use cases. > > > Windows has environment variables, doesn't it? > But it isn't works well for Windows users.

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-08 Thread Christopher Barker
On Mon, Feb 8, 2021 at 6:11 PM Inada Naoki wrote: > > > Unlike Windows, environment variables work very fine for such use cases. > Windows has environment variables, doesn't it? > On Unix, direnv, dotenv, and maybe more tools are there. I've been around Python for decades, and have never

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-08 Thread Inada Naoki
On Tue, Feb 9, 2021 at 2:28 AM Christopher Barker wrote: > >> >> And beginners should use a UTF-8 locale. >> > Beginners may not know how to do that / have a choice. >> > >> > This is a question I still don't know the answer to -- I think that most >> > (all?) non Windows platforms currently

[Python-ideas] Re: Generic NamedTuples

2021-02-08 Thread Peter Ludemann
I use dataclass (with frozen=True) instead of NamedTuple - and I can do mixins. https://docs.python.org/3/library/dataclasses.html ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: Generic NamedTuples

2021-02-08 Thread Guido van Rossum
Did you bring this up on the original issue? On Mon, Feb 8, 2021 at 10:21 AM Ben Avrahami wrote: > In both python 3.7 and 3.8, typing.NamedTuple had some strange behaviour > regarding multiple inheritance. This behaviour was solved in 3.9 > (bpo-36517), but this fix also barred me from a

[Python-ideas] Generic NamedTuples

2021-02-08 Thread Ben Avrahami
In both python 3.7 and 3.8, typing.NamedTuple had some strange behaviour regarding multiple inheritance. This behaviour was solved in 3.9 (bpo-36517), but this fix also barred me from a feature very close to my heart: the generic named tuple ``` T = TypeVar('T') class LLNode(NamedTuple,

[Python-ideas] Re: Make UTF-8 mode more accessible for Windows users.

2021-02-08 Thread Christopher Barker
On Sun, Feb 7, 2021 at 11:19 PM Inada Naoki wrote: > > maybe, but we have many of the same issues -- we want the configuration > tied to the environment, not to the user and all environments. And I'd > rather have things done the same way on all platforms, rather than the > native way on each

[Python-ideas] Re: [Python-Dev] What's up with assignment expression and tuples?

2021-02-08 Thread Paul Sokolovsky
Hello, On Mon, 8 Feb 2021 07:26:27 -0800 Guido van Rossum wrote: > This was intentional in PEP 572 so it is not a grammar bug fix. > > Put your money where your mouth is, or become another armchair > language designer. Your choice. Thanks for encouragement ;-). Adding "const" on the language

[Python-ideas] Re: [Python-Dev] What's up with assignment expression and tuples?

2021-02-08 Thread Guido van Rossum
This was intentional in PEP 572 so it is not a grammar bug fix. Put your money where your mouth is, or become another armchair language designer. Your choice. On Sun, Feb 7, 2021 at 23:58 Paul Sokolovsky wrote: > Hello, > > On Sun, 7 Feb 2021 13:10:55 -0800 > Guido van Rossum wrote: > > > Hi

[Python-ideas] Gauging appetite for a divergent alternative to pattern matching

2021-02-08 Thread Ambient Nuance
Pattern matching re-surfaced on my radar today, along with the impression of a conclusion being just around the corner. Although this has seemed an ongoing state at times, a certain finality would come from a steering council decision. At the same time, it seems the polarisation that has

[Python-ideas] Re: Conditional with statements

2021-02-08 Thread Stephen J. Turnbull
Brendan Barnwell writes: > let the editor (as configured by the reader) choose how to map that > [long logical line] onto a visual display. I think your editor must be the first example of true intelligence in a machine. I don't know any editors that reliably do this readably, let alone to my

[Python-ideas] Re: Conditional with statements

2021-02-08 Thread David Mertz
On Mon, Feb 8, 2021, 2:15 AM Brendan Barnwell wrote: > On 2021-02-07 22:36, David Mertz wrote: > > Code is READ far more often than it is written! > > Lines more than 80-ish characters impose a rapidly increasing cognitive > > and visual burden with every additional character. Really, starting

[Python-ideas] Re: [Python-Dev] What's up with assignment expression and tuples?

2021-02-08 Thread Paul Sokolovsky
Hello, On Sun, 7 Feb 2021 13:10:55 -0800 Guido van Rossum wrote: > Hi Paul, > > I suggest that you just go straight to the PEP phase. Thanks. In all fairness, I don't expect immediate resolution to this issue. But I'm aware of out for at least a year, and keep returning to it (yes, in context