You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Think this would be a generally very useful feature. Easy to structure your code so that various things have Async/Sync prefixes, and then you can just target them all with a regex instead of having to list every token.
A guess a small benefit of having it implemented as a regex is that it will then be with all the other default replacements at the top of the file rather than hidden in the code.
Activity
pquentin commentedon Oct 5, 2020
Would
additional_replacementsbe enough for your needs? https://unasync.readthedocs.io/en/latest/#usagejohtso commentedon Oct 5, 2020
Well, that's still just string for string replacement, no regexes right?
I did just realise that with the case of
Async/Syncprefixed class names, we just hard-code the replacement. https://github.com/python-trio/unasync/blob/master/src/unasync/__init__.py#L106-L108A guess a small benefit of having it implemented as a regex is that it will then be with all the other default replacements at the top of the file rather than hidden in the code.