Commit 18d4d8f
committed
Two changes to from...import:
1) "from M import X" now works even if M is not a real module; it's
basically a getattr() operation with AttributeError exceptions
changed into ImportError.
2) "from M import *" now looks for M.__all__ to decide which names to
import; if M.__all__ doesn't exist, it uses M.__dict__.keys() but
filters out names starting with '_' as before. Whether or not
__all__ exists, there's no restriction on the type of M.1 parent ad99177 commit 18d4d8f
1 file changed
Lines changed: 54 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3089 | 3089 | | |
3090 | 3090 | | |
3091 | 3091 | | |
3092 | | - | |
3093 | | - | |
3094 | | - | |
3095 | | - | |
3096 | | - | |
3097 | | - | |
3098 | | - | |
3099 | | - | |
3100 | | - | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
3101 | 3096 | | |
3102 | 3097 | | |
3103 | 3098 | | |
3104 | | - | |
3105 | | - | |
| 3099 | + | |
3106 | 3100 | | |
3107 | 3101 | | |
3108 | | - | |
| 3102 | + | |
3109 | 3103 | | |
3110 | 3104 | | |
3111 | 3105 | | |
3112 | | - | |
3113 | | - | |
3114 | | - | |
3115 | | - | |
3116 | | - | |
3117 | | - | |
3118 | | - | |
3119 | | - | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
3120 | 3128 | | |
3121 | | - | |
3122 | 3129 | | |
3123 | | - | |
3124 | | - | |
3125 | | - | |
3126 | | - | |
3127 | | - | |
3128 | | - | |
3129 | | - | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
3130 | 3153 | | |
3131 | | - | |
| 3154 | + | |
3132 | 3155 | | |
3133 | | - | |
| 3156 | + | |
| 3157 | + | |
3134 | 3158 | | |
3135 | 3159 | | |
3136 | 3160 | | |
| |||
0 commit comments