python-minifier icon indicating copy to clipboard operation
python-minifier copied to clipboard

Private and protected members

Open StefanUlbrich opened this issue 5 years ago • 5 comments

Hi, awesome project.

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

best

StefanUlbrich avatar Mar 12 '20 11:03 StefanUlbrich

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

dflook avatar Mar 12 '20 16:03 dflook

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.

StefanUlbrich avatar Mar 24 '20 15:03 StefanUlbrich

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.

dflook avatar Mar 24 '20 17:03 dflook

Ok, thanks. Please tell me if I can help

StefanUlbrich avatar Mar 25 '20 09:03 StefanUlbrich

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.

MuTsunTsai avatar Aug 19 '22 10:08 MuTsunTsai