RE: Script profiling details

2022-01-11 Thread Joseph L. Casale
> You might try `py-spy`. That worked well, I started trying to get more data from the profile output with the stats module but didn't quite get there. Thank you everyone, jlc -- https://mail.python.org/mailman/listinfo/python-list

Re: sharing data across Examples docstrings

2022-01-11 Thread Sebastian Luque
On Wed, 12 Jan 2022 09:28:16 +1100, Cameron Simpson wrote: [...] > Personally I'd be inclined to put long identical examples in the class > docstring instead of the method, but that may not be appropriate. Good point, and perhaps it's best to put a comprehensive example in the class docstring,

Re: sharing data across Examples docstrings

2022-01-11 Thread Cameron Simpson
On 11Jan2022 16:09, Sebastian Luque wrote: >I am searching for a mechanism for sharing data across Examples >sections >in docstrings within a class. For instance: > >class Foo: > >def foo(self): >"""Method foo title > >The example generating data below may be much more labori

Re: sharing data across Examples docstrings

2022-01-11 Thread Chris Angelico
On Wed, Jan 12, 2022 at 9:11 AM Sebastian Luque wrote: > > Hello, > > I am searching for a mechanism for sharing data across Examples sections > in docstrings within a class. For instance: This seems like trying to cram too much information into the docstring, but oh well... do what you will. I

sharing data across Examples docstrings

2022-01-11 Thread Sebastian Luque
Hello, I am searching for a mechanism for sharing data across Examples sections in docstrings within a class. For instance: class Foo: def foo(self): """Method foo title The example generating data below may be much more laborious. Examples

Re: Why operations between dict views return a set and not a frozenset?

2022-01-11 Thread Peter J. Holzer
On 2022-01-11 19:49:20 +0100, Marco Sulla wrote: > I think this is what you mean: > > >>> dis.dis("for _ in {1, 2}: pass") > 1 0 SETUP_LOOP 12 (to 14) > 2 LOAD_CONST 3 (frozenset({1, 2})) > 4 GET_ITER > >>6 FOR_ITER

Re: A Newspaper for Python Mailing Lists

2022-01-11 Thread Peter J. Holzer
On 2022-01-11 12:38:44 -0800, Paul Bryan wrote: > Subscribed. 🙂️ Same. hp -- _ | Peter J. Holzer| Story must make more sense than reality. |_|_) || | | | h...@hjp.at |-- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challe

Re: A Newspaper for Python Mailing Lists

2022-01-11 Thread Paul Bryan
Subscribed. 🙂️ On Wed, 2022-01-12 at 00:35 +0400, Abdur-Rahmaan Janhangeer wrote: > Added RSS: > > 2.0 unless later versions have some advantages: > > https://pyherald.com/rss.xml > > Kind Regards, > > Abdur-Rahmaan Janhangeer > about | blog  > github > Mauritius > -- https://mail.python.or

Re: A Newspaper for Python Mailing Lists

2022-01-11 Thread Abdur-Rahmaan Janhangeer
Added RSS: 2.0 unless later versions have some advantages: https://pyherald.com/rss.xml Kind Regards, Abdur-Rahmaan Janhangeer about | blog github Mauritius > -- https://mail.python.org/ma

Re: Why operations between dict views return a set and not a frozenset?

2022-01-11 Thread Chris Angelico
On Wed, Jan 12, 2022 at 5:49 AM Marco Sulla wrote: > > Ok... so I suppose, since you're inviting me to use dis and look at the > bytecode, that are you talking about constants in assembly, so const in C? > Sorry for the confusion, I'm not so skilled in C and I know nearly nothing > about assemb

Re: Why operations between dict views return a set and not a frozenset?

2022-01-11 Thread Marco Sulla
Ok... so I suppose, since you're inviting me to use dis and look at the bytecode, that are you talking about constants in assembly, so const in C? Sorry for the confusion, I'm not so skilled in C and I know nearly nothing about assembly. Furthermore I never look at the bytecode of any language befo

Re: Script profiling details

2022-01-11 Thread Dieter Maurer
Joseph L. Casale wrote at 2022-1-10 18:43 +: > ... >I expected this given the implementation, but I was hoping to get some >finer details so I can track down the specific module or at least the specific >file so I have a place to start reviewing code for optimizations. > >Is there something I c

Re: symlinks with python3 http.server.CGIHTTPRequestHandler

2022-01-11 Thread Chris Angelico
On Tue, Jan 11, 2022 at 6:17 AM Nat Taylor wrote: > > Is it possible to get http.server.CGIHTTPRequestHandler to run a symlink-ed > script? > > In the example below, GET /cgi-bin/test.py results in a 404 because it is a > symlink. > > % mkdir -p test/cgi-bin > % cd test > % vi test.py > % chmod +x

Re: symlinks with python3 http.server.CGIHTTPRequestHandler

2022-01-11 Thread Kirill Ratkin
Hi Maybe you have some restrictions on file system level. Some selinux for example. I try similar steps on my local 'linux mint' and ... linked script is called my http.server without errors. Here is my 'tree': ├── cgi-bin │   └── test.py -> ../orig.py └── orig.py All files are executab