Re: Change the identation base value?

2023-02-15 Thread Cameron Simpson
On 16Feb2023 04:20, Chris Angelico wrote: On Thu, 16 Feb 2023 at 04:18, scruel tao wrote: Currently, we have following PEP: PEP 8: E114 indentation is not a multiple of 4 (comment) However, I wonder how many people are using 2 spaces as their code indentation in projects? Should it be nesser

Re: LRU cache

2023-02-15 Thread Dino
Thank you Mats, Avi and Chris btw, functools.lru_cache seems rather different from what I need, but maybe I am missing something. I'll look closer. On 2/14/2023 7:36 PM, Mats Wichmann wrote: On 2/14/23 15:07, Dino wrote: -- https://mail.python.org/mailman/listinfo/python-list

Re: Python: How to use the 'trace' module programmatically?

2023-02-15 Thread Weatherby,Gerard
Have you tried the filter options? “These options may be repeated multiple times. --ignore-module= Ignore each of the given module names and its submodules (if it is a package). The argument can be a list of names separated by a comma. --ignore-dir= Ignore all modules and packages in the named di

Re: Change the identation base value?

2023-02-15 Thread Chris Angelico
On Thu, 16 Feb 2023 at 04:18, scruel tao wrote: > > Currently, we have following PEP: > PEP 8: E114 indentation is not a multiple of 4 (comment) > > However, I wonder how many people are using 2 spaces as their code > indentation in projects? Should it be nesserary for us to change this PEP > fr

Add angle brackets for required args in argparse

2023-02-15 Thread scruel tao
If we have the following code: ``` parser = argparse.ArgumentParser(description="test") parser.add_argument('path') ``` Run it without args, will get error message: ``` usage: test.py [-h] path test.py: error: the following arguments are required: path ``` However, I hope the message can be as th

Python: How to use the 'trace' module programmatically?

2023-02-15 Thread Peter Slížik
Hello, I'm trying to analyze complex Python code. For some specific reasons, I decided to use tracing instead of a debugger. The first thing I tried was: python -m trace -t /path/to/file.py The output of this command turned out to be completely useless. The reason is that there was a thread run

Change the identation base value?

2023-02-15 Thread scruel tao
Currently, we have following PEP: PEP 8: E114 indentation is not a multiple of 4 (comment) However, I wonder how many people are using 2 spaces as their code indentation in projects? Should it be nesserary for us to change this PEP from “multiple of 4” to “multiple of 2”? -- https://mail.pytho

Re: LRU cache

2023-02-15 Thread Mats Wichmann
On 2/14/23 15:07, Dino wrote: Here's my problem today. I am using a dict() to implement a quick and dirty in-memory cache. I am stopping adding elements when I am reaching 1000 elements (totally arbitrary number), but I would like to have something slightly more sophisticated to free up spa

Re: Precision Tail-off?

2023-02-15 Thread Weatherby,Gerard
All languages that use IEEE floating point will indeed have the same limitations, but it is not true that Python3 only uses IEEE floating point. Using the Decimal class and cribbing a method from StackOverflow, https://stackoverflow.com/questions/47191533/how-to-efficiently-calculate-cube-roots-

Re: Changing the original SQLite version to the latest

2023-02-15 Thread jose isaias cabrera
On Tue, Feb 14, 2023 at 8:55 PM Thomas Passin wrote: > > On 2/14/2023 3:30 PM, jose isaias cabrera wrote: > > Greetings. > > > > I have tried both Cygwin and SQLite support, and I have received very > > little ideas from them, so I am trying this to see if anyone has dealt > > with such a problem