[Python-ideas] Re: Unpacking in tuple/list/set/dict comprehensions

2021-10-26 Thread Irit Katriel via Python-ideas
For the backwards compatibility section, it would be good to analyze how the change impacts error reporting. (1) is the suggested syntax currently a 'common error' that will become harder to detect once it's not a syntax error? (2) would adding this syntax impact the parser's ability to provide

[Python-ideas] Re: Cleaner tracebacks from Python code

2021-05-29 Thread Irit Katriel via Python-ideas
You can control what the traceback of exceptions you are emitting: "raise e.with_traceback(None)" should clear everything before the current frame. Or you can get clever and construct a traceback with only the frames you want. On Saturday, May 29, 2021, 08:27:18 PM GMT+1, André Roberge w

[Python-ideas] Re: Cleaner tracebacks from Python code

2021-05-29 Thread Irit Katriel via Python-ideas
See this issue:  https://bugs.python.org/issue31299 On Saturday, May 29, 2021, 07:19:32 PM GMT+1, André Roberge wrote: With CPython, tracebacks obtained from code written in C can be extremely clean compared with functionally equivalent code written in Python.  Consider the followin

[Python-ideas] Re: New Idea: A safe keyword to execute the following statement in a failsafe mode.

2021-05-23 Thread Irit Katriel via Python-ideas
On Sunday, May 23, 2021, 02:23:05 PM GMT+1, Shivam Saini wrote: >> Like the first example in which I am sending an log, which isn't important.  If the log is not important, then why are you sending it? ___ Python-ideas mailing list -- pyth

[Python-ideas] Re: Weakrefs for lru_cache?

2020-10-16 Thread Irit Katriel via Python-ideas
When you initially opened this thread I thought you were suggesting a decorator that does the equivalent of a WeakValueDictionary. I guess you would need both in the library.  We have both types of weak caches in our system (weak on value or weak on key), which we implemented. But the one that

[Python-ideas] Re: Weakrefs for lru_cache?

2020-10-16 Thread Irit Katriel via Python-ideas
You can use a global WeakKeyDictionary keyed by the object to achieve the same without having anything on the object. On Friday, October 16, 2020, 09:37:05 AM GMT+1, Ram Rachum wrote: Did you mean like keeping a hidden attribute on the object with the result? Well, that'd require manua

[Python-ideas] Re: Weakrefs for lru_cache?

2020-10-15 Thread Irit Katriel via Python-ideas
We have a couple of weak caches In our system, so I see the use case. I don’t like the idea of silently reverting to a strong ref though. I’ve had bad experiences with systems that try to be too helpful in this manner. It seems like a good idea until it becomes a big problem, and then you have

[Python-ideas] Re: CPP Namespaces For Python

2020-10-06 Thread Irit Katriel via Python-ideas
Hi Alperen,  Why do you need a class at all rather than just a module with some functions? Irit On Tuesday, October 6, 2020, 01:38:21 PM GMT+1, Alperen Keleş wrote: Hi, Please pardon me if my idea is not making sense or already exists, I'm kind of new to developing in Python but I had