[New-bugs-announce] [issue39132] Adding funcitonality to determine if a constant string node is triple quoted

Batuhan report at bugs.python.org
Tue Dec 24 10:24:49 EST 2019


New submission from Batuhan <batuhanosmantaskaya at gmail.com>:

I was working on a preceding system for AST unparser and @pablogsal said there is an issue with docstrings (they printed in the same line even it was like 1000 chars long). So determining something is a triple quoted or not is simple with preceding system but I think it would be better if we can do it simpler and public. 

What I am thinking is using col_offset and end_col_offset information to determine if a string is a triple quoted or not. With a function called `ast.is_triple_quoted` or `ast.get_quote_count` etc. 

I can submit a patch if this wanted.I dont think this is big enough to discuss it on python-ideas but if it is, then I'm happy to port discussion over there.

----------
components: Library (Lib)
messages: 358850
nosy: BTaskaya, pablogsal
priority: normal
severity: normal
status: open
title: Adding funcitonality to determine if a constant string node is triple quoted
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39132>
_______________________________________


More information about the New-bugs-announce mailing list