sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.5k stars 65 forks source link

`collection-builtin-to-comprehension` creates invalid refactoring in the context of f-strings #334

Open bm424 opened 1 year ago

bm424 commented 1 year ago
x = f'''
text: {set(item ** 2 for item in d)}
'''

will become

x = f'''
text: {{item ** 2 for item in d}}
'''

Originally posted by @Karim-53 in https://github.com/sourcery-ai/sourcery/issues/325#issuecomment-1476955656