PYPY(1)
β¨ PYPY β¨ (section 1 of the manual, bestie π)
okay so listen. pypy is a fast, compliant alternative implementation of the Python language. that's it, that's the whole vibe. it's Python but it goes zoom. ποΈβ¨
πΈ SYNOPSIS πΈ
pypy [options] [-c cmd|-m mod|file.py|-] [arg...]
likeβ¦ you give it some options, you give it a script or a command or a module (or a - for stdin, we love a mysterious little dash π), and then some args for that script. iconic behavior.
π OPTIONS π
okay this is the main event, buckle up π«Ά
-iβ drops you into interactive inspection after the script runs. like the script finishes and it's not done talking to you yet. main character energy.-Oβ skipsassertstatements. assert? don't know her. π-OOβ does everything-Odoes, plus it rips out docstrings when importing modules. brutal. lowkey efficient tho.-c CMDβ the program is passed in asCMD. heads up bestie: this terminates the option list, so nothing after it counts as an option. periodt.-Sβ do NOT importsiteon initialization. we're going minimal, we're going feral. β¨-sβ don't add the user site directory tosys.path. keeping it clean π-uβ unbuffered binarystdoutandstderr. no waiting around, everything comes out immediately. we are not patient girls.-h,--helpβ shows a help message and then exits. the classic. the blueprint. π-m MODβ runs a library module as a script. and yep, this terminates the option list too. sorry babes, that's just how it is.-W ARGβ warning control. the arg format isaction:message:category:module:lineno. get into it.-Eβ ignores environment variables (likePYTHONPATH). we're pretending they don't exist, gaslight gatekeep girlboss. π-Bβ disables writing bytecode (.pyc) files. no little cache files cluttering up your vibe.-X track-resourcesβ produces aResourceWarningwhenever a file or socket gets closed by the garbage collector. so you know when things are getting cleaned up behind your back. π--versionβ prints the PyPy version. show me what you're working with bestie.--infoβ prints translation information about this PyPy executable. the behind-the-scenes lore. π--jit ARGβ low level JIT parameters. mostly internal, ngl. run--jit helpfor more info if you're feeling brave. π₯
π ENVIRONMENT π
environment variables, aka the invisible hands shaping your whole Python experience. let's go. π§
PYTHONPATHβ adds directories to pypy's module search path. same format as the shell'sPATH, so you already know the drill.PYTHONSTARTUPβ whatever script this points to gets executed before the first prompt shows up, in interactive mode. a little pregame ritual. β¨PYTHONDONTWRITEBYTECODEβ set it to a non-empty value and it's basically the-Boption. disables writing.pycfiles. same vibe, different name.PYTHONINSPECTβ non-empty value = it's the-ioption. inspect interactively after running the specified script. πPYTHONIOENCODINGβ if set, it overrides the encoding used forstdin/stdout/stderr. syntax isencodingname:errorhandler, and theerrorhandlerpart is optional β it means the same thing it does instr.encode.PYTHONNOUSERSITEβ non-empty value = it's the-soption. don't add the user site directory tosys.path. πPYTHONWARNINGSβ if set, it's equivalent to the-Woption (warning control). the value should be a comma-separated list of-Wparameters.PYPYLOGβ set it to a non-empty value and you get logging enabled. the format is a whole menu, so here it is:fnameor+fnameβ logging for profiling: includes alldebug_start/debug_stopbut not any nesteddebug_print.fnamecan be-to log tostderr. the+fnameform is the one you want if there's a:infname. π:fnameβ full logging, includingdebug_print.prefix:fnameβ conditional logging. you can stack multiple prefixes, comma-separated. only sections whose name matches the prefix will get logged.- and like, a real one:
PYPYLOG=jit-log-opt,jit-backend:logfilewill generate a log suitable for jitviewer, a tool for debugging performance issues under PyPy. π₯
PYPY_IRC_TOPICβ set to a non-empty value and it prints a random#pypyIRC topic when interactive mode starts up. pure nostalgia, we love her. π«Ά
okay and then there's several environment variables: (yes, the original just says that, and honestly? mood. here they are) π§
PYPY_GC_NURSERYβ the nursery size. defaults to 1/2 of your last-level cache, or4Mif that's unknown. small values (like1or1KB) are useful for debugging. πPYPY_GC_NURSERY_DEBUGβ set it to non-zero and it fills the nursery with garbage, to help with debugging. chaos as a feature. πPYPY_GC_INCREMENT_STEPβ the size of memory marked during the marking step. default is the size of the nursery times 2. if you mark it too high, your GC is not incremental at all (rip). the minimum is set to the size that survives minor collection times 1.5, so we reclaim anything all the time.PYPY_GC_MAJOR_COLLECTβ major collection memory factor. default is1.82, which means a major collection gets triggered when the memory consumed equals1.82times the memory really used at the end of the previous major collection.PYPY_GC_GROWTHβ major collection threshold's max growth rate. default is1.4. useful for collecting more often than normal when memory suddenly spikes, like when there's a temporary peak in memory usage. πPYPY_GC_MAXβ the max heap size. if you come near this limit, it'll first collect more often, then raise an RPythonMemoryError, and if that isn't enough, it crashes the program with a fatal error. π try values like1.6GB.PYPY_GC_MAX_DELTAβ the major collection threshold will never be set to more thanPYPY_GC_MAX_DELTAthe amount really used after a collection. defaults to 1/8th of the total RAM size (which is constrained to be at most 2/3/4GB on 32-bit systems). try values like200MB.PYPY_GC_MINβ don't collect while the memory size is below this limit. useful to avoid spending all your time in the GC in very small programs. defaults to 8 times the nursery.PYPY_GC_DEBUGβ enables extra checks around collections that are too slow for normal use. values are0(off),1(on major collections) or2(also on minor collections).PYPY_GC_MAX_PINNEDβ the maximal number of pinned objects at any point in time. defaults to a conservative value depending on nursery size and max object size inside the nursery. useful for debugging β just set it to0. π
π¦ SEE ALSO π¦
python(1)β the original. the blueprint. respect the elders bestie. π
π AUTHOR π
The PyPy Project. kings, honestly. π
πΈ COPYRIGHT πΈ
2022, The PyPy Project
and that's the whole thing bestie!! this page is from PyPy 7.3, dated Apr 01, 2022, and it lives in section 1 of the manual (that's the "PYPY(1)" at the top and bottom, iykyk π ). go forth and run your Python at unreasonable speeds. slay. β¨π«Άπ
π¦ where this page comes from
- ubuntu jammy: pypy 7.3.9+dfsg-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms