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
I understand that not every transformation is going to be cleanly reversible.
Given that underscores are already word separators a number of python packages use double underscores as higher-level separators though (most notably django's ORM but also eg fixture generators factoryboy and model mommy). Preserving reversibility of consecutive underscores is a useful property.
The tests and docs don't seem cover the behaviour of consecutive underscores -- it seems to be undefined.
Would you accept a patch that changed the behaviour to preserve consecutive underscores? My proposal is:
For underscores in the middle of a word, camelizing drops one underscore:
Every underscore/camelize cycle drops an underscore in the case of consecutive underscores.
Consider the following snippet:
Output:
I understand that not every transformation is going to be cleanly reversible.
Given that underscores are already word separators a number of python packages use double underscores as higher-level separators though (most notably django's ORM but also eg fixture generators factoryboy and model mommy). Preserving reversibility of consecutive underscores is a useful property.
The tests and docs don't seem cover the behaviour of consecutive underscores -- it seems to be undefined.
Would you accept a patch that changed the behaviour to preserve consecutive underscores? My proposal is:
The text was updated successfully, but these errors were encountered: