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

2020-07-20 Thread Rhodri James
t like xarray and pandas working, but that just means it should be in xarray and/or pandas. It doesn't feel at all right for regular Python to be muddling indices and modal parameters to something that isn't a function call like that

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

2020-07-17 Thread Rhodri James
o interest in becoming one. This helped a lot. I particularly like the slice notation, there is a clear win there. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...

[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread Rhodri James
same solution ? You can embed Python right now. The API to do it exists, and a number of programs out in the world do exactly that. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to p

[Python-ideas] Re: Access (ordered) dict by index; insert slice

2020-07-01 Thread Rhodri James
On 01/07/2020 11:24, Steven D'Aprano wrote: On Tue, Jun 30, 2020 at 07:40:23PM +0100, Rhodri James wrote: Don't get me wrong, if it's not going to cause performance issues I think being able to index views would be great What are your use-cases for indexing set-like

[Python-ideas] Re: Access (ordered) dict by index; insert slice

2020-06-30 Thread Rhodri James
erformance issues I think being able to index views would be great, but I don't think this is the right way to justify it. If anyone who knows could comment on the feasibility, that would be great too :-) -- Rhodri James *-* Kynesim Ltd

[Python-ideas] Re: Access (ordered) dict by index; insert slice

2020-06-29 Thread Rhodri James
articularly obvious way to proceed. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.pyth

[Python-ideas] Re: approximate equality operator ("PEP 485 follow-up")

2020-06-23 Thread Rhodri James
thing. So this is currently parsed as "a == b + (-0.5)". Reversing it to use -+ won't work because unary plus is also a thing. A little bit out of the box, but what about: a == b +/- 0.5 ...or even: a == b +or- 0.5 Is "math.isclose(a, b, abs_tol=0.5)" really so

[Python-ideas] Re: Extend the range functionality to allow infinite ranges

2020-06-19 Thread Rhodri James
ee the use case here. Could you supply some examples? -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/li

[Python-ideas] Re: "return if "

2020-06-17 Thread Rhodri James
eded serious thought (usually because of a regex) and the condition was an afterthought. For anything I actually cared about, I wanted the visible structuring with line breaks and all. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Rhodri James
On 16/06/2020 06:56, doods...@gmail.com wrote: Can we implement eventfd(2) as documented here <https://man7.org/linux/man-pages/man2/eventfd.2.html>? EventFD is available on PyPI: https://pypi.org/project/eventfd/ -- Rhodri James *-* Kynes

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread Rhodri James
tandardization, not more. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Messag

[Python-ideas] Re: New syntax for dict literals

2020-06-10 Thread Rhodri James
On 10/06/2020 16:38, Atsuo Ishimoto wrote: Hi Thank you for comments 2020年6月10日(水) 0:11 Rhodri James : Python is not Perl. By that I mean Python in general tends not to use non-alphanumeric symbols unless they already have a well established meaning (such as quote marks, arithmetic operators

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

2020-06-10 Thread Rhodri James
that's in convoluted environments driving test equipment, but I find it gets really hard to read surprisingly quickly. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ide

[Python-ideas] Re: Shared Semaphores for synchronisation across unrelated processes

2020-06-09 Thread Rhodri James
might want to consider other shared primatives. I can think of other use cases where cross-process pipes, mutexes and so on could be useful. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send a

[Python-ideas] Re: Shared Semaphores for synchronisation across unrelated processes

2020-06-09 Thread Rhodri James
worth broadening out the discussion to other sorts of named objects? Named Pipes particularly spring to my mind... -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ide

[Python-ideas] Re: New syntax for dict literals

2020-06-09 Thread Rhodri James
ooking at the above would not have a lot of guidance as to what might be going on, and could be forgiven for thinking they were looking at some weird form of set. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.

[Python-ideas] Re: Shared Semaphores for synchronisation across unrelated processes

2020-06-05 Thread Rhodri James
to clarify, and others to contribute, if they wish. Since what I have asked for is for Vinay to clarify what is wanted, that involves no effort on my part :-) -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To u

[Python-ideas] Re: Shared Semaphores for synchronisation across unrelated processes

2020-06-05 Thread Rhodri James
stated it outright. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived

[Python-ideas] Re: Shared Semaphores for synchronisation across unrelated processes

2020-06-05 Thread Rhodri James
<https://bugs.python.org/issue38035> at bugs.python.org <http://bug.python.org/>, which contains more detailed discussion on the same. I am posting this here after a suggestion from a Python contributor. These are very nice statements. What is you actually want? -- Rhodri Jam

[Python-ideas] Re: Optional keyword arguments

2020-05-29 Thread Rhodri James
current if x is None: x = randint(0,9) a lot easier to understand. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.

[Python-ideas] Re: Python __main__ function

2020-05-28 Thread Rhodri James
on with an entirely unnecessary function wrapper? -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-idea

[Python-ideas] Re: Python GIL Thoughts

2020-05-26 Thread Rhodri James
ting out to clients that the answer to any question beginning "Can you just...?" is "No." It is never "just". Never. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscri

[Python-ideas] Re: type hints : I'd like to suggest allowing unicode → as an alternative to ->

2020-05-23 Thread Rhodri James
On 22/05/2020 20:40, Steven D'Aprano wrote: Imagine the confusion if somebody had variables spam, Spam, sPAM, SPam, sPAm. Or worse, SPΑM, SPАM and SPAM. Randall is way ahead of you. https://xkcd.com/2309/ :-) -- Rhodri James *-* Kynesi

[Python-ideas] Re: type hints : I'd like to suggest allowing unicode → as an alternative to ->

2020-05-22 Thread Rhodri James
des" (auto-indentation after you hit RETURN) can make more work for you! -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org

[Python-ideas] Re: Optional keyword arguments

2020-05-22 Thread Rhodri James
s back now and again, but doesn't seem to get much traction one way or another. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.

[Python-ideas] Re: type hints : I'd like to suggest allowing unicode → as an alternative to ->

2020-05-21 Thread Rhodri James
On 21/05/2020 22:11, Mike Miller wrote: The only thing I've seen recently that doesn't is the Linux console, which I use rarely for admin tasks.  (Oddly enough, it does handle right arrow properly.) Guess what I use. In conjunction with Emacs, of course :-/ -- Rhodri James *-* K

[Python-ideas] Re: type hints : I'd like to suggest allowing unicode → as an alternative to ->

2020-05-21 Thread Rhodri James
on holiday in Quebec. I quite agree! -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.or

[Python-ideas] Re: type hints : I'd like to suggest allowing unicode → as an alternative to ->

2020-05-21 Thread Rhodri James
that the Linux UK Keyboard doesn't offer AltGr shortcuts for a c-cedilla. It makes addressing my colleague François quite a pain :-/ -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send a

[Python-ideas] Re: Optional keyword arguments

2020-05-21 Thread Rhodri James
On 21/05/2020 13:24, Chris Angelico wrote: On Thu, May 21, 2020 at 9:58 PM Rhodri James wrote: On 20/05/2020 23:20, James Lu wrote: There's a thirty year tradition of doing that because there's no terser way to do it. Terser does not mean better. In my experience, terser cod

[Python-ideas] Re: Optional keyword arguments

2020-05-21 Thread Rhodri James
s together like this. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived

[Python-ideas] Re: Optional keyword arguments

2020-05-20 Thread Rhodri James
the syntax -- I'm really not seeing the problem here. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python

[Python-ideas] Re: [Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-18 Thread Rhodri James
flag. The former universal newlines flag got separated out to be a mode parameter all its own when it turned out not to be a simple flag after all. I seem to remember that separation being somewhat painful... -- Rhodri James *-* Kynesim Ltd ___ Py

[Python-ideas] Re: [Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-17 Thread Rhodri James
it; for the first, it's an unnecessary distraction, and for the second the existence of zip_longest() argues against it. 2) People don't hate zip.strict() as much as I had expected. 3) The PEP needs to come up with an actual argument against itertools.zip_strict(). The

[Python-ideas] Re: Adding slice Iterator to Sequences

2020-05-15 Thread Rhodri James
On 14/05/2020 19:56, Andrew Barnert wrote: On May 14, 2020, at 10:45, Rhodri James wrote: On 14/05/2020 17:47, Andrew Barnert via Python-ideas wrote: Which is exactly why Christopher said from the start of this thread, and everyone else has agreed at every step of the way, that we can’t

[Python-ideas] Re: Adding slice Iterator to Sequences (was: islice with actual slices)

2020-05-14 Thread Rhodri James
not at all clear. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived

[Python-ideas] Re: Making asserts non-recoverable.

2020-05-14 Thread Rhodri James
On 14/05/2020 03:54, Greg Ewing wrote: On 14/05/20 8:55 am, Richard Damon wrote: On 5/13/20 2:03 PM, Rhodri James wrote: I'm sorry, but I think the correct response is to give them a spanking in code review.  I certainly wouldn't pass any code that actually relied on assert doin

[Python-ideas] Re: Making asserts non-recoverable.

2020-05-13 Thread Rhodri James
he correct response is to give them a spanking in code review. I certainly wouldn't pass any code that actually relied on assert doing anything. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe s

[Python-ideas] Re: Making asserts non-recoverable.

2020-05-13 Thread Rhodri James
Unless by "writing code that is dependent on asserts" you mean something I'm going to disapprove of strongly :-) -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an

[Python-ideas] Re: Equality between some of the indexed collections

2020-05-07 Thread Rhodri James
d "is", people still get muddled. If we have "==" and "=OMG=" or whatever, that would just be an accident waiting to happen. Cheers, Rhodri -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python

[Python-ideas] Re: zip(x, y, z, strict=True)

2020-05-05 Thread Rhodri James
ctually we are. As Steven pointed out further down the post, adding a flag to a function that is pretty much always going to be set at compile time is equivalent to (and IMHO would be better expressed as) a new function. -- Rhodri James *-* K

[Python-ideas] Re: zip(x, y, z, strict=True)

2020-05-05 Thread Rhodri James
lt to strict=True, but having the flag is a strong statement that length-checking is an intrinsic part of zipping. I don't believe that's true, and in consequence I think adding a flag is a mistake. -- Rhodri James *-* Kynesim Ltd ___ Python-ide

[Python-ideas] Re: zip(x, y, z, strict=True)

2020-05-05 Thread Rhodri James
On 05/05/2020 13:53, Henk-Jaap Wagenaar wrote: Brandt's example with ast in the stdlib I think is a pretty good example of this. On Tue, 5 May 2020 at 13:27, Rhodri James wrote: On 05/05/2020 13:12, Henk-Jaap Wagenaar wrote: A function that is a "safer" version in some &

[Python-ideas] Re: zip(x, y, z, strict=True)

2020-05-05 Thread Rhodri James
rsus zip-with-strict-true. I'm sorry, I don't buy it. This isn't an edge case, it's all about whether you care about what your input is. In that sense, it's exactly like the relationship between zip and zip_longest. -- Rhodri James *-* Kynesim Ltd ___

[Python-ideas] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-04 Thread Rhodri James
the chain of argument could you at least trim the middle out? -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/li

[Python-ideas] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-01 Thread Rhodri James
ys know whether he always wants "strict=True" or "strict=False". That functionality switch is the smell, and I don't think you convincingly deal with it. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- p

[Python-ideas] Re: Introduce 100 more built-in exceptions

2020-05-01 Thread Rhodri James
tes the traceback, I want to get as many hints as possible about what went wrong. Then you should read the exception reason. You're still going to have to think about what your program logic error is, and a separate exception is going to be less use than an explanatory text string. -

[Python-ideas] Re: deque: Allow efficient operations

2020-04-29 Thread Rhodri James
Isn't the point that you should be approaching a datastructure in Python thinking about what you want it to do, not how it's implemented underneath? That sort of micromanagement smacks of premature optimisation. -- Rhodri James *-* Kynesim Ltd ___

[Python-ideas] Re: Adding a "once" function to functools

2020-04-29 Thread Rhodri James
ately expensive information that you may not need at all but will use a lot if you do need it. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: zip(x, y, z, strict=True)

2020-04-28 Thread Rhodri James
g this thread, and should have a draft posted to the list for feedback this week. -1 on the flag. I'd be happy to have a separate zip_strict() (however you spell it), but behaviour switches just smell wrong. -- Rhodri James *-* Kynesim Ltd ___

[Python-ideas] Re: zip(x, y, z, strict=True)

2020-04-27 Thread Rhodri James
use cases Except for those cases where either the whole dataset needs to be processed or none of it, which is what people were thinking might be behind some of the desire for zip_equal(). That you can't do it in the general case would be a later "well, bugger" stage of the des

[Python-ideas] Re: Keyword arguments self-assignment

2020-04-21 Thread Rhodri James
le=handle" to "handle=medium_handle" as projects have crept... -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/

[Python-ideas] Re: list.append(x) could return x

2020-04-20 Thread Rhodri James
think ? Thanks in advance for your replies -- ∞ -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.pytho

[Python-ideas] Re: list.append(x) could return x

2020-04-20 Thread Rhodri James
and that's what people are going to expect. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas

[Python-ideas] Re: Keyword arguments self-assignment

2020-04-19 Thread Rhodri James
nt order so these parameters are definitely bound wrong, and also that weird `**` that I don't know the meaning of has no bearing on that, and I'm not going to check with a print() or a debugger". If I have to go away and look some syntax up, that syntax has slowed me down. Thi

[Python-ideas] Re: Keyword arguments self-assignment

2020-04-17 Thread Rhodri James
syntax that nobody else replicated, and I think that’s happening again here. It's not just Steven. After dusting my monitor to remove flyspecs, I still couldn't find a natural way of reading that example. I didn't visually parse it quite the same, but the excess of punctuation st

[Python-ideas] Re: Keyword arguments self-assignment

2020-04-17 Thread Rhodri James
ne to this magical knowledge. Also, your examples are clearly demonstrating that using the shortcut makes it easier to avoid mistakes. It shows that using positional parameters makes it easier to make mistakes, but that's not news. -- Rhodri James *-* Kynesim Ltd ___

[Python-ideas] Re: Keyword arguments self-assignment

2020-04-17 Thread Rhodri James
ints. We do seem to have got off-track somewhat ;-) -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-idea

[Python-ideas] Re: Keyword arguments self-assignment

2020-04-16 Thread Rhodri James
way of basic readability. I beg to differ. I do find "def foo(a, *, b)" gets in the way of readability. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to

[Python-ideas] Re: Keyword arguments self-assignment

2020-04-16 Thread Rhodri James
) foo(bar=, qux=) ``` I wasn't in favour of the original proposal, and that at least had the excuse of just being for debugging. Imagine how much less I am enthused by this. Explicit is better than implicit. -- Rhodri James *-* Kynesim Ltd

[Python-ideas] Re: Range of Indexes

2020-04-11 Thread Rhodri James
introduction of enumerate() lo! these many moons ago, I find I almost never write range(len(x)) as a loop iterable. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le

[Python-ideas] Re: Exception spaces

2020-04-10 Thread Rhodri James
o don't do that, then. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message arc

[Python-ideas] Re: Alternative to iterator unpacking that wraps iterator-produced ValueError

2020-04-09 Thread Rhodri James
around" is not to do the thing that raises the exception? -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/list

[Python-ideas] Re: Explicitly defining a string buffer object (aka StringIO += operator)

2020-04-02 Thread Rhodri James
-world examples that would be improved by them. That's been lacking to the extent that it sounds like what you're really saying is "I want to program $LANGUAGE in Python." Since that's almost always a mistake, you've actually driven me from +0 to -0.5

[Python-ideas] Re: PEP 9999: Retire animal-unfriendly language

2020-04-01 Thread Rhodri James
de only from cow's milk. It can also be made from goat's milk. Typical pro-bovine/anti-caprid bias! :-) Ewe are forgetting to separate your sheep from your goats. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@pytho

[Python-ideas] Re: About python3 on windows

2020-03-24 Thread Rhodri James
eed have seen frozen binaries discouraged in the past. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/py

[Python-ideas] Re: prefix/suffix for bytes

2020-03-11 Thread Rhodri James
On 11/03/2020 18:45, Stephen J. Turnbull wrote: Rhodri James writes: > We've headed off down the rabbit-hole of filenames for > justification here, but surely pathlib is the correct tool if you > are going to be chopping up filenames and path names? This isn't

[Python-ideas] Re: prefix/suffix for bytes

2020-03-11 Thread Rhodri James
seem to be 90% of what people are asking for. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.pyth

[Python-ideas] Re: prefix/suffix for bytes

2020-03-10 Thread Rhodri James
but it is ASCII-compatible; ASCII characters are encoded as their 7-bit ASCII values. I'm not sure this is a particularly useful observation, mind you. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscr

[Python-ideas] Re: Non-blocking concurrent.futures ThreadPoolExecutor

2020-03-10 Thread Rhodri James
kinda ugly though. Well, yes. The non-ugly thing would be to make sure your threads are well behaved ;-) -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le

[Python-ideas] Re: Incremental step on road to improving situation around iterable strings

2020-02-25 Thread Rhodri James
and the harder the language is to learn. Just consider how hard English is to learn as an adult, and notice just how much of the language is inconsistency after inconsistency. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-i

[Python-ideas] Re: Incremental step on road to improving situation around iterable strings

2020-02-24 Thread Rhodri James
ecause of unexpectedly iterating through a string, it's my own stupid fault. Almost always I have been doing something over simplistic or wrong-headed, usually returning a string from a function when I meant to return a list of (one) string(s) instead. -- Rhodri James

[Python-ideas] Re: Communication on mailing lists [was: Add a __valid_getitem_requests__ protocol]

2020-02-24 Thread Rhodri James
much what you said then.  Have you not returned to that mailing list because you no longer feel like part of the community? I seem to remember saying at the time that if I'd received the message for Steven as it was stated in public, I would not show up on bended knee as a supplicant as it

[Python-ideas] Re: Make ~ (tilde) a binary operator, e.g. __sim__(self, other)

2020-02-24 Thread Rhodri James
matic R in Python. That on the whole sounds like a bad idea; a friend of mine use to say he could write FORTRAN in any language but no one else could read it. Wouldn't it be more pythonic (or more accurately anything-other-than-R-ic) to use an interface that was more l

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-19 Thread Rhodri James
On 19/02/2020 16:55, Soni L. wrote: On 2020-02-18 5:33 p.m., Soni L. wrote: Similar to len(). Just a shitty wrapper for __valid_getitem_requests__. Correction: Just a simple wrapper for __valid_getitem_requests__. Thank you! :-) -- Rhodri James *-* Kynesim Ltd

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-19 Thread Rhodri James
On 19/02/2020 00:26, Steven D'Aprano wrote: On Tue, Feb 18, 2020 at 08:44:07PM +0000, Rhodri James wrote: Language, sunshine. What about it? Just for the record, I had no issues with Soni's language, but I do object to attempts to shame him for it. This isn't the Disney Ch

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-18 Thread Rhodri James
On 18/02/2020 20:33, Soni L. wrote: On 2020-02-18 5:08 p.m., Rhodri James wrote: On 18/02/2020 19:43, Soni L. wrote: It'd be nice to have a __valid_getitem_requests__ protocol that, if present, yields pairs such that: for key, value in items(obj):    assert obj[key] == value for an

[Python-ideas] Re: Add a __valid_getitem_requests__ protocol

2020-02-18 Thread Rhodri James
he arbitrary object? -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Messag

[Python-ideas] Re: CSV Dictwriter - Handling escape characters

2020-02-12 Thread Rhodri James
characters-to-a-csv-file-with-dictwriter I think my advice would be a variation on "Don't do that!" If you can massage your data into the right format before you try writing it, that would be preferable to having DictWriter mangle your strings in what is essentially an arbitra

[Python-ideas] Re: addition of "nameof" operator

2020-01-22 Thread Rhodri James
nature of C# (variables are lvalues) that simply isn't true in Python, which I don't think the OP realised. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to pytho

[Python-ideas] Re: Compound statement colon (Re: Re: Improve SyntaxError for obvious issue:)

2020-01-17 Thread Rhodri James
lly if you have a multi-line "if", since you won't have the visual cue from the left-hand side. if (first_of_many_tests() and second_of_many_tests() and and_so_on() and last_of_many_tests()): do_something_muttley() -- Rhodri James *-* Kynesim Ltd ___

[Python-ideas] Re: Enhancing Zipapp

2020-01-08 Thread Rhodri James
On 08/01/2020 18:08, many people wrote lots of stuff... Folks, could we pick one list and have the discussion there, rather than on both python-list and python-ideas? Getting *four* copies of Andrew's emails is a tad distracting :-) -- Rhodri James *-* Kynesi

[Python-ideas] Re: Archiving Threads / Closing Threads

2019-12-04 Thread Rhodri James
On 04/12/2019 12:44, Abdur-Rahmaan Janhangeer wrote: Abdur-Rahmaan Janhangeer http://www.pythonmembers.club | https://github.com/Abdur-rahmaanJ Mauritius On Wed, 4 Dec 2019, 15:16 Rhodri James, wrote: Which is a problem because...? -- Rhodri James *-* Kynesim Ltd An advantage. If the

[Python-ideas] Re: Archiving Threads / Closing Threads

2019-12-04 Thread Rhodri James
pople resurrecting old threads from ten years ago, or even a year ago? Easy digging of threads. Which is a problem because...? -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ide

[Python-ideas] Re: Renaming json.load()

2019-11-29 Thread Rhodri James
ss with it. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived

[Python-ideas] Re: Renaming json.load()

2019-11-29 Thread Rhodri James
. I'm with Chris: -1 on making life complicated. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-20 Thread Rhodri James
On 20/11/2019 15:28, Richard Damon wrote: On Nov 20, 2019, at 7:50 AM, Rhodri James wrote: As context managers, yes, lazy managers make chaining them easier because there's no mess to clean up if the chain breaks while you are creating it. On the other hand, eager managers like open()

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-20 Thread Rhodri James
n() can be used outside a "with" statement and still manage resources perfectly well for a lot of cases. It a matter of fitness for different purposes, so even "preferable" is a relative term here. -- Rhodri James *-* Kynesim Ltd ___ P

[Python-ideas] Re: Ability to set precedence of classdict (returned from __prepare__) for a metaclass type

2019-11-20 Thread Rhodri James
often make the largest contribution to this list by reading more posts and stifling the impulse to reply to any of them.:-) YMMV, of course. You used YMMV with malice aforethought, didn't you? :-) -- Rhodri James *-* Kynesim Ltd ___ Python-id

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-19 Thread Rhodri James
On 19/11/2019 17:57, Andrew Barnert wrote: On Nov 19, 2019, at 09:40, Rhodri James wrote: How about using Paths as file context managers? Just an idle thought. Then how do you open a Path for writing, or in binary mode, etc.? With additional parameters and/or methods, obviously

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-19 Thread Rhodri James
On 19/11/2019 17:50, Soni L. wrote: On 2019-11-19 3:37 p.m., Rhodri James wrote: On 19/11/2019 17:12, Brian Skinn wrote: @jayvdb on GitHub and I are working on a new version of one of my packages, stdio-mgr (https://github.com/bskinn/stdio-mgr), with a dramatically expanded API and

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-19 Thread Rhodri James
__enter__(). That's fixable by writing your own wrapper class, but having a builtin file context manager that deferred resource-consuming actions would be a Good Thing™ How about using Paths as file context managers? Just an idle thought. -- Rhodri James *-* Kynesi

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-11 Thread Rhodri James
hit them.) A quirk of my brain is that unlike my classmates I couldn't do the same with numbers -- with a very few exceptions like powers of two, numbers are just collections of digits to me in a way that words *aren't* collections of letters

[Python-ideas] Re: Make itertools recipes license easier

2019-10-31 Thread Rhodri James
by lawyers whom I don't want to wake up, despite it being nearly 20 years later. Numquam titillandum advocatus dormiens? -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to

[Python-ideas] Re: Percent notation for array and string literals, similar to Perl, Ruby

2019-10-24 Thread Rhodri James
On 24/10/2019 11:33, Steven D'Aprano wrote: On Wed, Oct 23, 2019 at 06:01:06PM +0100, Rhodri James wrote: The proposed: %w[red green blue] says that this is something, good luck figuring out what. You don't need *luck* to figure out what it does, you need five seconds in the REP

[Python-ideas] Re: Percent notation for array and string literals, similar to Perl, Ruby

2019-10-23 Thread Rhodri James
On 23/10/2019 16:16, Steven D'Aprano wrote: On Wed, Oct 23, 2019 at 03:16:51PM +0100, Rhodri James wrote: I'm seriously not getting the issue people have with colours1 = ["red", "green", "blue"] which has the advantage of saying what it means. A

[Python-ideas] Re: Percent notation for array and string literals, similar to Perl, Ruby

2019-10-23 Thread Rhodri James
I wanted, quote each separately I'm seriously not getting the issue people have with colours1 = ["red", "green", "blue"] which has the advantage of saying what it means. -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mail

[Python-ideas] Re: PEP 584: Add + and += operators to the built-in dict class.

2019-10-23 Thread Rhodri James
or prefer plus over pipe, and I don't think that pipe is "more accurate". +1 (as one of the non-newcomers who prefers plus) -- Rhodri James *-* Kynesim Ltd ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send a

[Python-ideas] Re: Percent notation for array and string literals, similar to Perl, Ruby

2019-10-23 Thread Rhodri James
This smells like Perl's quoting operators. I wasn't a big fan of them even when I was a Perlmonger. Given the choice of "glyph doing something" and "glyph doing something I understand", I'll take the latter every time. -- Rhodri James *-* Kynesim Ltd _

[Python-ideas] Re: PEP 584: Add + and += operators to the built-in dict class.

2019-10-21 Thread Rhodri James
On 21/10/2019 14:54, David Mertz wrote: On Mon, Oct 21, 2019, 9:14 AM Rhodri James The plus operation on two dictionaries feels far more natural as a vectorised merge, were it to mean anything. E.g., I'd expect {'a': 5, 'b': 4} + {'a': 3, 'b'

[Python-ideas] Re: PEP 584: Add + and += operators to the built-in dict class.

2019-10-21 Thread Rhodri James
x27;: 8, 'b': 5} That's only a natural expectation if you also expect the values in your dict to be addable (in the sense of doing something useful with a "+" operator). It never occurs to me to make that assumption because a fair

  1   2   3   >