Comments (4)
Hi @asmeurer,
I don't use Python 3 myself yet on any of my projects, but I'm keen to see it succeed so I'd like to support Python 3 if we can. I don't much like the 2to3 approach i.e. maintaining two codebases or having one generated from the other, so I'm more inclined to look six. If I can avoid including that, though, I will, since it's a pretty small project it might not need it.
After a quick look I can see the following things:
- use of
iteritems
in profiler.py:123 - use of
exec
in main.py:41 - possibly some string/byte confusion with the ANSI colors
so hopefully it'll be fairly straightforward.
from pyinstrument.
Yes, I think writing a compatible code-base without 2to3 or six in your case will be pretty easy. I would recommend not supporting Python 3.2, so that you can keep the unicode literals.
I ran the code through 2to3 and successfully used it, so that means that there shouldn't be many issues aside from the ones that it picks up. So I would just run 2to3 and then go through the diff and fix things to be cross compatible rather than Python 3-only compatible.
from pyinstrument.
Here is what the 2to3 result looks like https://github.com/asmeurer/pyinstrument/compare/2to3?expand=1. I'll probably just do the whole port right now. This tool has helped me a lot today. I think you deserve it.
from pyinstrument.
By the way, you totally had a typo. except SystemExit, KeyboardInterrupt
uses KeyboardInterrupt
as the name for the caught SystemExit
exception. You want except (SystemExit, KeyboardInterrupt)
. Fortunately, Python 3 disallows this mistake.
from pyinstrument.
Related Issues (20)
- Incorrect Session.program when running a module HOT 3
- how to install the pyinstrument package on Raspberry Pi 4? HOT 1
- Can Pyinstrument get a precollected `.pstats` input and renders it as html? HOT 2
- Add a renderer for pstats files HOT 3
- Reducing boilerplate HOT 2
- functions like time.sleep are reported as "sleep None" HOT 1
- Better support for sync routes in FastAPI HOT 3
- ValueError on ShowAll in Speedscope Renderer HOT 2
- Support `-c` input mode HOT 1
- Bug: Artificial characters in outfile when using pstats renderer HOT 7
- Significant performance overhead when timing requires a syscall on Linux HOT 18
- Question, missing Async-mode flag at running as module HOT 4
- Pyinstrument hiding useful frames HOT 8
- Automatic Web Deployment HOT 1
- Interpolation bug in jupyter magic HOT 3
- replace deprecated appdirs with platformdirs HOT 1
- HTML Renderer show-all HOT 2
- `pytinstrument` does not track the call stack of `__aenter__` and `__aexit__`
- Console renderer has much more detail than speedscope renderer HOT 1
- pstats renderer total time HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyinstrument.