[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 01/12] simpletrace: Improve parsing of sys.argv; fix files
|
From: |
Mads Ynddal |
|
Subject: |
Re: [PATCH v2 01/12] simpletrace: Improve parsing of sys.argv; fix files never closed. |
|
Date: |
Mon, 8 May 2023 13:18:40 +0000 |
> simpletrace.py is both a command-line tool and a Python module. The
> Python module has a public API that people's scripts may rely on. Let's
> avoid breaking API changes unless necessary so that existing scripts
> that import simpletrace continue to work.
>
> It's not very clear what is a public API in simpletrace.py, the file
> should really have __all__ = ['Analyzer', 'process', 'run'].
> Nevertheless, Analyzer's doc comments mention process() and the
> process() function itself also has doc comments, so it's a public API.
>
> Please drop this change to avoid breaking the public API.
I agree, I'll revert the changes. I can add an `__all__` too.
I'd like to avoid having the same `open`, `read_trace_header` and `read_events`
multiple places. Would it be acceptable to let `process` be more of a stub and
move the logic to an internal `_process` function maybe?
- [PATCH v2 00/12] simpletrace: refactor and general improvements, Mads Ynddal, 2023/05/02
- [PATCH v2 04/12] simpletrace: update code for Python 3.11, Mads Ynddal, 2023/05/02
- [PATCH v2 03/12] simpletrace: changed naming of edict and idtoname to improve readability, Mads Ynddal, 2023/05/02
- [PATCH v2 05/12] simpletrace: Changed Analyzer class to become context-manager, Mads Ynddal, 2023/05/02
- [PATCH v2 06/12] simpletrace: Simplify construction of tracing methods, Mads Ynddal, 2023/05/02