Commit 28bc2e0
docs: add encapsulation boundary rules (Principle 7)
Add new principle to PYTHON_BEST_PRACTICES.md addressing the anti-pattern
of accessing private attributes via getattr(obj, '_internal', ...).
This documents:
- Why accessing private state is dangerous
- Real example from PR #70 showing the anti-pattern
- Correct approaches (expose public API, redesign)
- Litmus test for detecting the problem
Motivated by microsoft/amplifier-app-cli#70 which demonstrates
the anti-pattern spreading across the codebase.
🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier)
Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>1 parent a344a1c commit 28bc2e0
1 file changed
+40
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
101 | 141 | | |
102 | 142 | | |
103 | 143 | | |
| |||
0 commit comments