kk
kk
@marcoffee How about implement an Alphabet type for better readability? ```python class Alphabet(object): def __init__(self, chars): self._map = { c : i for i, c in enumerate(chars) } def index(self,...
我在MacOS遇到同样问题 ,可能和python版本有关。步骤如下: 将最新版的 phrases_dict.py 文件复制到当前目录,然后分别用 python 3.12.4, python 3.11.7, python 3.9.7 执行 `import phrases_dict`,在3.9.7环境下几秒钟能执行完,但是 3.11.7 和 3.12.4 要卡几分钟,进程 CPU 持续100%。
这两个库遇到有类似问题: https://github.com/carpedm20/emoji/issues/280#issuecomment-1900270724 https://github.com/holoviz/colorcet/issues/121
这里面可能有多个问题。我写了一个测试脚本,可以参考测试各种方案。 ``` import os import time from pathlib import Path def gen_data(num_line): ret = 'large_data = [\n' for _ in range(num_line): ret += ' [],\n' ret += ']\n' return ret...
我的问题解决了,原因是我的命令行环境默认配置了 `PYTHONTRACEMALLOC=1`,去掉这个配置后一切正常。
Hi, the grammar was just copyed from https://github.com/MagicStack/MagicPython. But I have no time to improve it recently, also sorry for the delayed reply.
Do you means user defined type name? if yes then it's hard to support. otherwise we can treat them as keywords and it's easy, you can search keywords like `print`...
The test does not work against httpbin.org now, it will response `411 Length Required`: ```python >>> import requests >>> requests.__version__ '2.18.4' >>> >>> def stream(): ... yield b'ham' ... yield...
the blog works for me: https://barker.codes/blog/adding-the-virtual-environment-name-to-your-prompt-with-oh-my-zsh/
@gexinworks 非常感谢,我思考了一下有所启发!