hasattr function available as a method. Implemented like has_key. Examples -------- >>> s = Struct(a=10) >>> s.hasattr('a') True >>> s.hasattr('b') False >>> s.hasattr('get') False
(self, key)
| 245 | return Struct(dict.copy(self)) |
| 246 | |
| 247 | def hasattr(self, key): |
| 248 | """hasattr function available as a method. |
| 249 | |
| 250 | Implemented like has_key. |
| 251 | |
| 252 | Examples |
| 253 | -------- |
| 254 | |
| 255 | >>> s = Struct(a=10) |
| 256 | >>> s.hasattr('a') |
| 257 | True |
| 258 | >>> s.hasattr('b') |
| 259 | False |
| 260 | >>> s.hasattr('get') |
| 261 | False |
| 262 | """ |
| 263 | return key in self |
| 264 | |
| 265 | def allow_new_attr(self, allow = True): |
| 266 | """Set whether new attributes can be created in this Struct. |
nothing calls this directly
no outgoing calls
no test coverage detected