piglei / one-python-craftsman

来自一位 Pythonista 的编程经验分享,内容涵盖编码技巧、最佳实践与思维模式等方面。

Home Page:https://www.piglei.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

代码没有高亮

cleiveliu opened this issue · comments

Python 工匠:写好面向对象代码的原则(中)
中的一段代码没有高亮 忘写python了,这算Bug吗?还是feature.

原文:

现在,假设我需要写一个函数,来获取和用户有关的所有帖子标题:

def list_user_post_titles(user: User) -> Iterable[str]:
    """获取与用户有关的所有帖子标题
    """
    for post_id in user.list_related_posts():
        yield session.query(Post).get(post_id).title

漏写啦,我晚点修复下。