[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-70811":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},70811,"icecream","gruns\u002Ficecream","gruns","🍦 Never use print() to debug again.","",null,"Python",10062,222,47,49,0,1,5,16,3,42.04,"MIT License",false,"master",true,[27,28,29,30,31,32,33,34],"debug","debugging","debugging-tool","inspects","library","print","python","python3","2026-06-12 02:02:43","\u003Ch1 align=\"center\">\n  \u003Cimg src=\"logo.svg\" width=\"220px\" height=\"370px\" alt=\"IceCream\">\n\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Ficecream\">\u003Cimg src=\"https:\u002F\u002Fbadge.fury.io\u002Fpy\u002Ficecream.svg\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fgruns\u002Ficecream\u002Factions\u002Fworkflows\u002Fci.yml\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fgruns\u002Ficecream\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg\">\u003C\u002Fa>\n  \u003Ca href=\"\u002FLICENSE.txt\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fl\u002Ficecream.svg\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Ficecream\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fpyversions\u002Ficecream.svg\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\n### IceCream — Never use print() to debug again\n\nDo you ever use `print()` or `log()` to debug your code? Of course you\ndo. IceCream, or `ic` for short, makes print debugging a little sweeter.\n\n`ic()` is like `print()`, but better:\n\n  1. It prints both variables and expressions along with their values.\n  2. It's 60% faster to type.\n  3. Data structures are formatted and pretty printed.\n  4. Output is syntax highlighted.\n  5. It optionally includes program context: filename, line number, and\n     parent function.\n\nIceCream is well tested, [permissively licensed](LICENSE.txt), and supports Python 3 and PyPy3.\n\nIceCream is maintained by [Jakeroid (Ivan Karabadzhak)](https:\u002F\u002Fgithub.com\u002FJakeroid), with support from the confidential computing folks at [🌖 Lunal](https:\u002F\u002Flunal.dev\u002F).\n\n\n### Inspect Variables\n\nHave you ever printed variables or expressions to debug your program? If\nyou've ever typed something like\n\n```python\nprint(foo('123'))\n```\n\nor the more thorough\n\n```python\nprint(\"foo('123')\", foo('123'))\n```\n\nthen `ic()` will put a smile on your face. With arguments, `ic()`\ninspects itself and prints both its own arguments and the values of\nthose arguments.\n\n```python\nfrom icecream import ic\n\ndef foo(i):\n    return i + 333\n\nic(foo(123))\n```\n\nPrints\n\n```\nic| foo(123): 456\n```\n\nSimilarly,\n\n```python\nd = {'key': {1: 'one'}}\nic(d['key'][1])\n\nclass klass():\n    attr = 'yep'\nic(klass.attr)\n```\n\nPrints\n\n```\nic| d['key'][1]: 'one'\nic| klass.attr: 'yep'\n```\n\nJust give `ic()` a variable or expression and you're done. Easy.\n\n\n### Inspect Execution\n\nHave you ever used `print()` to determine which parts of your program are\nexecuted, and in which order they're executed? For example, if you've ever added\nprint statements to debug code like\n\n```python\ndef foo():\n    print(0)\n    first()\n\n    if expression:\n        print(1)\n        second()\n    else:\n        print(2)\n        third()\n```\n\nthen `ic()` helps here, too. Without arguments, `ic()` inspects itself and\nprints the calling filename, line number, and parent function.\n\n```python\nfrom icecream import ic\n\ndef foo():\n    ic()\n    first()\n\n    if expression:\n        ic()\n        second()\n    else:\n        ic()\n        third()\n```\n\nPrints\n\n```\nic| example.py:4 in foo()\nic| example.py:11 in foo()\n```\n\nJust call `ic()` and you're done. Simple.\n\n\n### Return Value\n\n`ic()` returns its argument(s), so `ic()` can easily be inserted into\npre-existing code.\n\n```pycon\n>>> a = 6\n>>> def half(i):\n>>>     return i \u002F 2\n>>> b = half(ic(a))\nic| a: 6\n>>> ic(b)\nic| b: 3\n```\n\n\n### Miscellaneous\n\n`ic.format(*args)` is like `ic()` but the output is returned as a string instead\nof written to stderr.\n\n```pycon\n>>> from icecream import ic\n>>> s = 'sup'\n>>> out = ic.format(s)\n>>> print(out)\nic| s: 'sup'\n```\n\nAdditionally, `ic()`'s output can be entirely disabled, and later re-enabled, with\n`ic.disable()` and `ic.enable()` respectively.\n\n```python\nfrom icecream import ic\n\nic(1)\n\nic.disable()\nic(2)\n\nic.enable()\nic(3)\n```\n\nPrints\n\n```\nic| 1: 1\nic| 3: 3\n```\n\n`ic()` continues to return its arguments when disabled, of course; no existing\ncode with `ic()` breaks.\n\n\n### Import Tricks\n\nTo make `ic()` available in every file without needing to be imported in\nevery file, you can `install()` it. For example, in a root `A.py`:\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n# -*- coding: utf-8 -*-\n\nfrom icecream import install\ninstall()\n\nfrom B import foo\nfoo()\n```\n\nand then in `B.py`, which is imported by `A.py`, just call `ic()`:\n\n```python\n# -*- coding: utf-8 -*-\n\ndef foo():\n    x = 3\n    ic(x)\n```\n\n`install()` adds `ic()` to the\n[builtins](https:\u002F\u002Fdocs.python.org\u002F3.8\u002Flibrary\u002Fbuiltins.html) module,\nwhich is shared amongst all files imported by the interpreter.\nSimilarly, `ic()` can later be `uninstall()`ed, too.\n\n`ic()` can also be imported in a manner that fails gracefully if\nIceCream isn't installed, like in production environments (i.e. not\ndevelopment). To that end, this fallback import snippet may prove\nuseful:\n\n```python\ntry:\n    from icecream import ic\nexcept ImportError:  # Graceful fallback if IceCream isn't installed.\n    ic = lambda *a: None if not a else (a[0] if len(a) == 1 else a)  # noqa\n```\n\n\n### Configuration\n\n`ic.configureOutput(prefix, outputFunction, argToStringFunction,\nincludeContext, contextAbsPath)` controls `ic()`'s output.\n\n`prefix`, if provided, adopts a custom output prefix. `prefix` can be a\nstring, like\n\n```pycon\n>>> from icecream import ic\n>>> ic.configureOutput(prefix='hello -> ')\n>>> ic('world')\nhello -> 'world'\n```\n\nor a function.\n\n```pycon\n>>> import time\n>>> from icecream import ic\n>>>  \n>>> def unixTimestamp():\n>>>     return '%i |> ' % int(time.time())\n>>>\n>>> ic.configureOutput(prefix=unixTimestamp)\n>>> ic('world')\n1519185860 |> 'world': 'world'\n```\n\n`prefix`'s default value is `ic| `.\n\n`outputFunction`, if provided, is called once for every `ic()` call with\n`ic()`'s output, as a string, instead of that string being written to\nstderr (the default).\n\n```pycon\n>>> import logging\n>>> from icecream import ic\n>>>\n>>> def warn(s):\n>>>     logging.warning(\"%s\", s)\n>>>\n>>> ic.configureOutput(outputFunction=warn)\n>>> ic('eep')\nWARNING:root:ic| 'eep': 'eep'\n```\n\n`argToStringFunction`, if provided, is called with argument values to be\nserialized to displayable strings. The default is PrettyPrint's\n[pprint.pformat()](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Fpprint.html#pprint.pformat),\nbut this can be changed to, for example, handle non-standard datatypes\nin a custom fashion.\n\n```pycon\n>>> from icecream import ic\n>>>\n>>> def toString(obj):\n>>>    if isinstance(obj, str):\n>>>        return '[!string %r with length %i!]' % (obj, len(obj))\n>>>    return repr(obj)\n>>>\n>>> ic.configureOutput(argToStringFunction=toString)\n>>> ic(7, 'hello')\nic| 7: 7, 'hello': [!string 'hello' with length 5!]\n```\n\nThe default `argToStringFunction` is `icecream.argumentToString`, and\nhas methods to `register` and `unregister` functions to be dispatched\nfor specific classes using `functools.singledispatch`. It also has a\n`registry` property to view registered functions.\n\n```pycon\n>>> from icecream import ic, argumentToString\n>>> import numpy as np\n>>>\n>>> # Register a function to summarize numpy array\n>>> @argumentToString.register(np.ndarray)\n>>> def _(obj):\n>>>     return f\"ndarray, shape={obj.shape}, dtype={obj.dtype}\"\n>>>\n>>> x = np.zeros((1, 2))\n>>> ic(x)\nic| x: ndarray, shape=(1, 2), dtype=float64\n>>>\n>>> # View registered functions\n>>> argumentToString.registry\nmappingproxy({object: \u003Cfunction icecream.icecream.argumentToString(obj)>,\n              numpy.ndarray: \u003Cfunction __main__._(obj)>})\n>>>\n>>> # Unregister a function and fallback to the default behavior\n>>> argumentToString.unregister(np.ndarray)\n>>> ic(x)\nic| x: array([[0., 0.]])\n```\n\n`includeContext`, if provided and True, adds the `ic()` call's filename,\nline number, and parent function to `ic()`'s output.\n\n```pycon\n>>> from icecream import ic\n>>> ic.configureOutput(includeContext=True)\n>>>\n>>> def foo():\n>>>   i = 3\n>>>   ic(i)\n>>> foo()\nic| example.py:12 in foo()- i: 3\n```\n\n`includeContext` is False by default.\n\n`contextAbsPath`, if provided and True, outputs absolute filepaths, like\n`\u002Fpath\u002Fto\u002Ffoo.py`, over just filenames, like `foo.py`, when `ic()` is\ncalled with `includeContext == True`. This is useful when debugging\nmultiple files that share the same filename(s). Moreover, some editors,\nlike VSCode, turn absolute filepaths into clickable links that open the\nfile where `ic()` was called.\n\n```pycon\n>>> from icecream import ic\n>>> ic.configureOutput(includeContext=True, contextAbsPath=True)\n>>>\n>>> i = 3\n>>>\n>>> def foo():\n>>>   ic(i)\n>>> foo()\nic| \u002Fabsolute\u002Fpath\u002Fto\u002Fexample.py:12 in foo()- i: 3\n>>>\n>>> ic.configureOutput(includeContext=True, contextAbsPath=False)\n>>>\n>>> def foo():\n>>>   ic(i)\n>>> foo()\nic| example.py:18 in foo()- i: 3\n```\n\n`contextAbsPath` is False by default.\n\nIf you want to use icecream with multiple log levels, like with Python’s\n`logging` module, you can use `ic.format()` to integrate icecream’s\ndebugging with your logger:\n\n```python\nimport logging\nfrom icecream import ic\n\nfoo = 'bar'\nlogging.debug(ic.format(foo))\n```\n\n❕ This is a bit clunky. Would you prefer built-in log level support in\nicecream? If so, please share your thoughts in\n[issue](https:\u002F\u002Fgithub.com\u002Fgruns\u002Ficecream\u002Fissues\u002F146).\n\n\n### Installation\n\nInstalling IceCream with pip is easy.\n\n```\n$ pip install icecream\n```\n\n\n### Related Python libraries\n\n`ic()` uses [**`executing`**](https:\u002F\u002Fgithub.com\u002Falexmojaki\u002Fexecuting)\nby [**@alexmojaki**](https:\u002F\u002Fgithub.com\u002Falexmojaki) to reliably locate\n`ic()` calls in Python source. It's magic.\n\n\n### IceCream in Other Languages\n\nDelicious IceCream should be enjoyed in every language.\n\n- Dart: [icecream](https:\u002F\u002Fgithub.com\u002FHallerPatrick\u002Ficecream)\n- Rust: [icecream-rs](https:\u002F\u002Fgithub.com\u002Fericchang00\u002Ficecream-rs)\n- Node.js: [node-icecream](https:\u002F\u002Fgithub.com\u002Fjmerle\u002Fnode-icecream)\n- C++: [IceCream-Cpp](https:\u002F\u002Fgithub.com\u002FrenatoGarcia\u002Ficecream-cpp)\n- C99: [icecream-c](https:\u002F\u002Fgithub.com\u002Fchunqian\u002Ficecream-c)\n- PHP: [icecream-php](https:\u002F\u002Fgithub.com\u002Fntzm\u002Ficecream-php)\n- Go: [icecream-go](https:\u002F\u002Fgithub.com\u002FWAY29\u002Ficecream-go)\n- Ruby: [Ricecream](https:\u002F\u002Fgithub.com\u002Fnodai2hITC\u002Fricecream)\n- Java: [icecream-java](https:\u002F\u002Fgithub.com\u002FAkshay-Thakare\u002Ficecream-java)\n- R: [icecream](https:\u002F\u002Fgithub.com\u002Flewinfox\u002Ficecream)\n- Lua: [icecream-lua](https:\u002F\u002Fgithub.com\u002Fwlingze\u002Ficecream-lua)\n- Clojure(Script): [icecream-cljc](https:\u002F\u002Fgithub.com\u002FEigenbahn\u002Ficecream-cljc)\n- Bash: [IceCream-Bash](https:\u002F\u002Fgithub.com\u002Fjtplaarj\u002FIceCream-Bash)\n- SystemVerilog: [icecream_sv](https:\u002F\u002Fgithub.com\u002Fxver\u002Ficecream_sv)\n- GameMaker Language: [GMIceCream](https:\u002F\u002Fgithub.com\u002Fdicksonlaw583\u002FGMIceCream)\n\nIf you'd like a similar `ic()` function in your favorite language, please open a\npull request! IceCream's goal is to sweeten print debugging with a handy-dandy\n`ic()` function in every language.\n","IceCream 是一个用于Python的调试工具，旨在替代传统的print()函数进行代码调试。其核心功能包括自动打印变量名及其值、支持数据结构的格式化输出和语法高亮显示，并可选择性地展示文件名、行号及父函数等上下文信息。相比于标准的print()方法，IceCream提供了更简洁（仅需输入ic而非完整表达式）、更美观且更具信息量的输出方式。此库适用于任何需要快速定位问题或理解程序执行流程的Python开发场景中，特别适合于那些频繁使用print语句来辅助调试的开发者。",2,"2026-06-11 03:34:20","high_star"]