Indicates whether or not an input line ends in a comment or within a multiline string. Parameters ---------- src : string A single line input string. Returns ------- comment : bool True if source ends in a comment or multiline string.
(src)
| 322 | return (tokenize.COMMENT in _line_tokens(src)) |
| 323 | |
| 324 | def ends_in_comment_or_string(src): |
| 325 | """Indicates whether or not an input line ends in a comment or within |
| 326 | a multiline string. |
| 327 | |
| 328 | Parameters |
| 329 | ---------- |
| 330 | src : string |
| 331 | A single line input string. |
| 332 | |
| 333 | Returns |
| 334 | ------- |
| 335 | comment : bool |
| 336 | True if source ends in a comment or multiline string. |
| 337 | """ |
| 338 | toktypes = _line_tokens(src) |
| 339 | return (tokenize.COMMENT in toktypes) or (_MULTILINE_STRING in toktypes) |
| 340 | |
| 341 | |
| 342 | @StatelessInputTransformer.wrap |
no test coverage detected