Timeline for Defining private module functions in python
Current License: CC BY-SA 2.5
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 27, 2023 at 8:38 | comment | added | Avizipi |
It is important to notice that f._foo__bar() will not fail and expose the function.
|
|
| Jun 6, 2022 at 11:13 | comment | added | SharksRule | This is useful, I was looking for a function accessible from within a class but not outside the class. | |
| May 29, 2015 at 12:11 | comment | added | Sevak Avakians | I think the OP's intent is to write functions that are not accessible outside of, for example, a commercial package. In that regard, this answer isn't complete. The __bar() function is still accessible from outside through f._foo__bar(). Therefore, the double-leading underscores do not make it private. | |
| Oct 10, 2009 at 5:46 | history | edited | Andrew Hare | CC BY-SA 2.5 |
added 327 characters in body; deleted 5 characters in body
|
| Oct 10, 2009 at 5:39 | history | answered | Andrew Hare | CC BY-SA 2.5 |