dflook / python-minifier

Transform Python source code into its most compact representation
MIT License
583 stars 43 forks source link

Private and protected members #7

Open StefanUlbrich opened 4 years ago

StefanUlbrich commented 4 years ago

Hi, awesome project.

Is it planned to shorten private and/or protected class members similarly to local variables (unsafe transformation)?

best

dflook commented 4 years ago

That's a good idea, I hadn't thought of that!

StefanUlbrich commented 4 years ago

Cool, how difficult will it be to implement this feature? How can I contribute? I looked at the code base but a hint on where to start would be helpful.

dflook commented 4 years ago

It's more difficult than I initially thought, but definitely doable. The first step is tracking references to instance/class attributes. I'll have to consider it a bit more before deciding on an approach.

StefanUlbrich commented 4 years ago

Ok, thanks. Please tell me if I can help

MuTsunTsai commented 2 years ago

Any news on this issue? One quick way to implement this will be just pick those members starting with __ or _ and mangle them regardlessly. This is of course VERY unsafe, but should work for those who want this feature.