Extract the writing mode (overwrite or append) from a path spec
(path: str)
| 32 | |
| 33 | @lru_cache |
| 34 | def _mode(path: str) -> Literal["ab", "wb"]: |
| 35 | """Extract the writing mode (overwrite or append) from a path spec""" |
| 36 | if path.startswith("+"): |
| 37 | return "ab" |
| 38 | else: |
| 39 | return "wb" |
| 40 | |
| 41 | |
| 42 | class Save: |
no outgoing calls
no test coverage detected
searching dependent graphs…