Skip to content

[pydocstyle] docstrings encoding #3436

Answered by charliermarsh
yuxqiu asked this question in Q&A
Discussion options

You must be logged in to vote

If I recall correctly... we used to use the evaluated string body (i.e., the s in Expr::Constant { kind: Constant::Str(s), .. }), which would probably give you the behavior that you're seeing pydocstyle, since that gets evaluated by the parser, and so (e.g.) continuations wouldn't be included as part of s. But I thought this led to other pydocstyle deviations, and so we moved to using the raw string. I can't exactly remember the details unfortunately. We could look through the changelog...

It might be the case that pydocstyle uses slightly different representations for different rules. E.g., if you look at the source, they sometimes do lines = ast.literal_eval(docstring).strip().split('\n')

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@yuxqiu
Comment options

@yuxqiu
Comment options

Answer selected by yuxqiu
Comment options

You must be logged in to vote
2 replies
@charliermarsh
Comment options

@yuxqiu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants