[Python-ideas] Asyncio Future.set_result_threadsafe

2020-02-12 Thread Brian Allen Vanderburg II via Python-ideas
Currently asyncio.futures.Future.set_result will result in any callbacks being scheduled using loop.call_soon instead of loop.call_soon_threadsafe. However in situations where the future's result is set from a different thread, the loop might not wake up as a result of this if it is currently sleep

[Python-ideas] Re: Exceptions as function calls to kill boilerplate

2020-10-13 Thread Brian Allen Vanderburg II via Python-ideas
An issue I have is how to handle typos, whether implemented as a helper or a __getattr__ method: try:     ...     raise ExceptionMaker.color_error("color out of range", color) except ExceptionMaker.colr_error as e:     ... Each __getattr__ would dynamically create/return a new exception class ba

[Python-ideas] TextIOWrapper support for null-terminated lines

2020-10-24 Thread Brian Allen Vanderburg II via Python-ideas
I have a use case where I'm writing a small filter in Python which should be able to take output from the find command to filter and optionally pass it to other commands (like xargs), but also can be passed specific filenames for the input and/or output.  Find can output it's filenames in null-term

[Python-ideas] Conditional function/method/dict arguments assignments

2020-10-24 Thread Brian Allen Vanderburg II via Python-ideas
This is just a hack idea I had for functions/methods that have parameters with default values, possibly outside the control of the user of said function, where sometimes it is desired to pass an argument to the function that differs from the default but other times it is desired to just use the def

[Python-ideas] Python Decorator Improvement Idea

2018-06-15 Thread Brian Allen Vanderburg II via Python-ideas
Just a small idea that could possibly be useful for python decorators. An idea I had is that it could be possible for a decorator function to declare a parameter which, when the function is called as a decorator, the runtime can fill in various information in the parameters for the decorator to us

Re: [Python-ideas] Python Decorator Improvement Idea

2018-06-16 Thread Brian Allen Vanderburg II via Python-ideas
On 06/16/2018 01:22 AM, Steven D'Aprano wrote: > Some of the information would be available in all >> contexts, while other information may only be available in certain >> contexts.The parameter's value cannot be explicitly specified, defaults >> to Null except when called as a decorator, and can