[Python-ideas] Re: Questions about using PEP 637 syntax in PEP 646

2021-01-30 Thread Stefano Borini
l do it tonight. Thanks -- Kind regards, Stefano Borini ___ 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

[Python-ideas] Re: Questions about using PEP 637 syntax in PEP 646

2021-01-29 Thread Stefano Borini
mplementation in typing.py soon. Since there's some > overlap we wanted to make sure we're not duplicating your work, and that > there won't be any merge conflicts later. Do you have a fork we might be able > to get early access to? We

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-10-07 Thread Stefano Borini
e same time Well, they are not mutually exclusive in this case. You would get the element at row 2 col 3. -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.or

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-30 Thread Stefano Borini
eady have a tuple, just like for a function, and it's one of the rare / > only places where list vs. tuple matters in Python). You still would not be able to. The semantics of that operation are unchanged (for backward compatibility) -- Kind

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-30 Thread Stefano Borini
iguously a column I guess everybody already knows this, but I would hope the obvious choice here is matrix[row=3] But in any case, the PEP does not prescribe how the keyword arguments should be used, only that are possible. How they are used (or misused.. :) ) is of course up to the implementatio

[Python-ideas] Re: PEP 637 and keyword only subscripts

2020-09-28 Thread Stefano Borini
se depending on how it's invoked. Also, it would give different behavior between d[x] and d[x, **kw], which in my opinion should be a fully degenerate case. -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@python.org To

[Python-ideas] Re: PEP 637 and keyword only subscripts

2020-09-27 Thread Stefano Borini
On Sun, 27 Sep 2020 at 12:28, Stefano Borini wrote: > I am not sure. I am on the fence on many topics. There seem to be no > clear solution on many of them, it boils down to taste and compromise. > In any case, I listen to all proposals (although with a small delay). > I am wo

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-27 Thread Stefano Borini
nals, so I might be wrong. -- Kind regards, Stefano Borini ___ 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

[Python-ideas] Re: PEP 637 and keyword only subscripts

2020-09-27 Thread Stefano Borini
orking on the sentinel issue at the moment https://github.com/python/peps/compare/master...stefanoborini:pep-637-on-default-sentinel-value -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-26 Thread Stefano Borini
t doesn't feel... "right" :) but maybe there's a logic to it. You are indexing on the indexes, and also on the source. Yeah, makes sense. Sold. -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@python

[Python-ideas] Re: PEP 9999 (provisional): support for indexing with keyword arguments

2020-09-26 Thread Stefano Borini
On Sat, 26 Sep 2020 at 05:10, Steven D'Aprano wrote: > > I recommend that the PEP be changed to allow `*args` inside subscripts. Will do. -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@python.org To unsub

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-25 Thread Stefano Borini
mind exploring that option a bit more, but it's likely to become an exercise. On Fri, 25 Sep 2020 at 22:06, Ricky Teachey wrote: > > On Fri, Sep 25, 2020 at 4:57 PM Stefano Borini > wrote: >> >> On Fri, 25 Sep 2020 at 14:07, Ricky Teachey wrote: >> > >> > I&

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-25 Thread Stefano Borini
d-arguments-td48489.html -- Kind regards, Stefano Borini ___ 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

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-25 Thread Stefano Borini
] Of course people can (and will) abuse the feature, but I would personally consider it poor design. These tricks were discussed in PEP-472 (e.g. specify the unit to be returned), but I always felt uncomfortable with them. -- Kind regards, Stefano Borini ___ Py

[Python-ideas] Re: PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-25 Thread Stefano Borini
t of this ml feedback. I also tried to start implementing the feature as a PoC... but the parser grammar is beyond my skills I fear. I understand it, but unsure (at the moment) how to modify it. Nevertheless I am willing to spend some days and do some ex

[Python-ideas] PEP 637 - support for indexing with keyword arguments (Was: Re: PEP 9999 (provisional): ...)

2020-09-23 Thread Stefano Borini
Dear all, "Support for indexing with keyword arguments" has now been merged with the assigned PEP number 637. For future reference, this email will be added to the Post-History of the PEP. On Mon, 21 Sep 2020 at 21:34, Stefano Borini wrote: > > PEP for support for index

[Python-ideas] PEP 9999 (provisional): support for indexing with keyword arguments

2020-09-21 Thread Stefano Borini
can give it a try. I would not mind refreshing my C a bit. -- Kind regards, Stefano Borini ___ 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] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-02 Thread Stefano Borini
ber of people that need to write these methods > is small, and the number of people that can use the feature is large. True but there's a point where one should question if the direction getitem has taken is the right one. -- Kind regards, Stefano Borini _

[Python-ideas] PEP-0472 revisited - draft

2020-09-01 Thread Stefano Borini
ights. -- Kind regards, Stefano Borini ___ 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.pytho

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-30 Thread Stefano Borini
On Sun, 30 Aug 2020 at 04:09, Steven D'Aprano wrote: > > Nobody disputes that it *could* be made to work that way. But I'm > > not convinced that it's the *best* way for it to work. The killer > > argument in my mind is what you would have to do to make an object > > where all of the following ar

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-30 Thread Stefano Borini
I am going to put everything in the new PEP tonight. On Sun, 30 Aug 2020, 08:47 Guido van Rossum, wrote: > On Sat, Aug 29, 2020 at 10:29 PM Guido van Rossum > wrote: > >> FYI, Jonathan's post (once I "got" it) led me to a new way of reasoning >> about the various proposals (__keyfn__, __subscri

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-27 Thread Stefano Borini
Ok then it is my understanding that Steven D'Aprano is willing to sponsor it. Steven please correct me if I am dead wrong, and apologies if that's not the case. On Thu, 27 Aug 2020 at 08:39, Chris Angelico wrote: > > On Thu, Aug 27, 2020 at 5:26 PM Stefano Borini > wrote:

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-27 Thread Stefano Borini
onger wish to be associated > with the PEP if you change it radically.) I lost contact with the other author. I haven't heard of him since, even on the mailing list. -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@pyt

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-27 Thread Stefano Borini
ok at xarray tonight. I am not familiar with its interface. On Thu, 27 Aug 2020 at 02:27, Todd wrote: > > On Wed, Aug 26, 2020 at 7:11 PM Stefano Borini > wrote: >> >> On Wed, 26 Aug 2020 at 23:56, Todd wrote: >> > Again, implicit on your argument here is the assump

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-27 Thread Stefano Borini
like putting a signature on a blank piece of paper. So the question is: is a core developer willing to sponsor the _idea_ (not the PEP, as it doesn't exist yet)? On Thu, 27 Aug 2020 at 00:33, Chris Angelico wrote: > > On Thu, Aug 27, 2020 at 8:20 AM Stefano Borini > wrote: > > &g

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-26 Thread Stefano Borini
ce between anonymous axes and named axes? -- Kind regards, Stefano Borini ___ 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.o

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-26 Thread Stefano Borini
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.org/message/UCYMGB4BKZK7HHUNEBA6OIMCGIZFRXMA/ > Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-26 Thread Stefano Borini
plement it, but we haven't even decided what it should look like from the outside (although it's probably in the massive number of emails I am trying to aggregate in the new PEP). -- Kind regards, Stefano Borini ___ Python-ideas mailing list -

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Stefano Borini
scratch, dict.__getitem__ would probably accept *args, **kwargs, and use them to create the index. I would also say that very likely it would not accept kwargs at all. But you have a point that whatever the implementation might be, it has to play nice with the current dict() behavior. Yet, if we wer

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Stefano Borini
multiple arguments) the second. -- Kind regards, Stefano Borini ___ 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.o

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Stefano Borini
nd the rare and unusual case easy. > > (4) KeyObject doesn't exist. We would need a new builtin type to support > this, as well as the new syntax. This increases the complexity and > maintenance burden of this new feature. > > (5) Compounds the "kind of screwy" (Greg&

[Python-ideas] Re: PEP 472 - slices in keyword indices, d[x=1:3]

2020-08-25 Thread Stefano Borini
ed for keyed arguments. -- Kind regards, Stefano Borini ___ 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 archi

[Python-ideas] Re: FEATURE REQUEST: Make `logging` Module more Pythonic

2020-08-24 Thread Stefano Borini
changing all the tests in the testsuite would throw a wrench in blame, but it would not be mandatory to do so), nor I understand how providing pep-8 compliant names as preferred and recommended names while keeping the old ones for compatibility would be a problem. > On Mon, Aug 24, 2020 at 1

[Python-ideas] Re: FEATURE REQUEST: Make `logging` Module more Pythonic

2020-08-24 Thread Stefano Borini
ge was already being performed for many modules such as e.g. StringIO.StringIO > On Mon, Aug 24, 2020 at 13:14 Stefano Borini wrote: >> >> Brings me to a question. Why weren't the logger and unittest module >> >> "PEP-8"ified in the transition from 2 to 3?

[Python-ideas] Re: FEATURE REQUEST: Make `logging` Module more Pythonic

2020-08-24 Thread Stefano Borini
er, PhD > > Python Language Consulting > - Teaching > - Scientific Software Development > - Desktop GUI and Web Development > - wxPython, numpy, scipy, Cython > ___ > Python-ideas mailing list -- python-ideas@python.org >

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-23 Thread Stefano Borini
they mean something or not. it's your duty to find out, if you care about it") But I would like to raise another question. Is there another language out there that provides the same feature? I am not aware of any. -- Kind regards, Stefano Borini ___

[Python-ideas] Re: PEP 472 - regarding d[x=1, y=2] and similar

2020-08-15 Thread Stefano Borini
ould such a class >>>> X = type(d) > be part of standard Python, as part of PEP 472? (My answer is: Yes, it should > be in standard Python.) Yes and no. In my opinion, the current classes (e.g. dict) *may* be extended to support this (optional) functionality. But the t

[Python-ideas] Re: basic matrix object

2020-08-15 Thread Stefano Borini
x multiplication, inverse, etc are also basic operations that are likely to come up during either a course or trivial computations for e.g. geometry. I would not add things like QR or Cholesky factorization. -- Kind regards, Stefano Borini ___

[Python-ideas] basic matrix object

2020-08-13 Thread Stefano Borini
is already a similar entity in the "array" module, which is a simple version of a numpy array, except that is only one-dimensional. -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe sen

[Python-ideas] Re: Aside RE: Re: macaddress or networkaddress module

2020-08-13 Thread Stefano Borini
connection and on a VPN > (we have more than one in use) different again. FYI there's an issue open on pip to allow for multiple proxies. I have this exact situation as well. https://github.com/pypa/pip/issues/8232 -- Kind regards, Stefano Borini

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-08-11 Thread Stefano Borini
; means. In the case of an array, it can be obvious. In the case of the starting mail, axis is basically the degree of freedom of customisation of a typing class. -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@python.org To uns

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-08-11 Thread Stefano Borini
negative points were the relative lack of maturity of the namedtuple and the _n magic field that we assigned to it. I kind of feel they are still relevant, but I might be wrong. The PEP is 5 years old. -- Kind regards, Stefano Borini ___ Python-ideas mai

[Python-ideas] Re: Function suggestion: itertools.one()

2020-08-08 Thread Stefano Borini
; required to name a new variable, and instead of having an operation on the > iterable, change the way I'm assigning to it. > > WDYT? > > Cheers, > Noam > > > ___ > Python-ideas mailing list -- python-ideas@python.org

[Python-ideas] Re: Package kwkey and PEP 472 -- Support for indexing with keyword arguments

2020-08-07 Thread Stefano Borini
Wed, 5 Aug 2020 at 23:08, Christopher Barker wrote: > > On Wed, Aug 5, 2020 at 3:01 PM Stefano Borini > wrote: >> >> Maybe I should open a new PEP? > > > I"ll let teh PEP editors decide, but it look slike it was "rejected"m with > this comment:

[Python-ideas] Re: Package kwkey and PEP 472 -- Support for indexing with keyword arguments

2020-08-05 Thread Stefano Borini
ps want > d[1, 2] > d[x=1, y=2] > d[1, y=2] > d[y=2, x=1] > to all be equivalent, for d a mapping of whose domain is points in the x-y > plane. More complicated examples might be found in function annotations > (Andras Tantos, Caleb Donovick), quantum chemistry

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-21 Thread Stefano Borini
s-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.org/message/VSQO7A6K2SA7KI25U25CHROPEHCZFEG2/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- Kind reg

[Python-ideas] Re: Bringing the print statement back

2020-07-18 Thread Stefano Borini
#x27; and we should only allow dotted names (sufficient to access functions in > imported modules and method calls on variables). Or maybe we should only > allow simple names (allowing 'len x' but disallowing 'sys.getrefcount x'. Or > maybe we should really only bring

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-10 Thread Stefano Borini
ould you advise me about how to start the 'ball rolling' to drum-up support > for re-activating this PEP? > > Thanks again, > Andras Tantos > > > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscrib

[Python-ideas] Re: Update pep8 for stressing type hinted long parameter in functions

2019-11-27 Thread Stefano Borini
n, so maybe you should > rather discuss it there first. Otherwise this will create a weird situation > where one of the most popular auto-formatter formats code in violation of PEP > 8. > > -- > Ivan > > > > On Wed, 27 Nov 2019 at 11:42, Stefano Borini wrote: >&g

[Python-ideas] Update pep8 for stressing type hinted long parameter in functions

2019-11-27 Thread Stefano Borini
p8. Regardless of the choice, I think that pep8 should be updated with the appropriate style for this specific case, and style tools should enforce this choice. -- Kind regards, Stefano Borini ___ Python-ideas mailing list -- python-ideas@python.or

Re: [Python-ideas] Open parenthesis in REPL completion

2019-04-25 Thread Stefano Borini
__ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ -- Kind regards, Stefano Borini ___ 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] Catching the return value of a generator at the end of a for loop

2019-04-16 Thread Stefano Borini
ailed to load and how many were successful, so I could return that information to the user. This calls for counting at the level of load_plugins(). If pluginloader returned a tuple (num_successful, num_failed) it would save a (agreed trivial) need to count this information in the caller. -- K

Re: [Python-ideas] Catching the return value of a generator at the end of a for loop

2019-04-16 Thread Stefano Borini
e: > > Hello, > > 2019-04-16 Stefano Borini dixit: > > > def g(): > > yield 2 > > yield 3 > > return 6 > [...] > > for x in g() return v: > > print(x) > > > > print(v) # prints 6 > > I like the idea -- occasi

[Python-ideas] Catching the return value of a generator at the end of a for loop

2019-04-16 Thread Stefano Borini
else: print(x) print(v) -- Kind regards, Stefano Borini ___ 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] Exception for developer errors?

2019-04-10 Thread Stefano Borini
That's quite a good idea, but then I think it should be more explicit in the documentation that the purpose goes beyond the assert statement failure. I've never seen AssertionError raised manually. On Wed, 10 Apr 2019 at 23:15, Jeroen Demeyer wrote: > > On 2019-04-11 00:09, Stef

[Python-ideas] Exception for developer errors?

2019-04-10 Thread Stefano Borini
internal error. I tried some search on the mailing list but could not find anything at a glance about this topic. Was this already discussed in the past? Thanks -- Kind regards, Stefano Borini ___ Python-ideas mailing list Python-ideas@python.org h