Remove the value associated with the specified key and return it Parameters ---------- key: str Property name dflt The default value to return if key was not found in figure Returns ------- value T
(self, key, *args)
| 933 | return self |
| 934 | |
| 935 | def pop(self, key, *args): |
| 936 | """ |
| 937 | Remove the value associated with the specified key and return it |
| 938 | |
| 939 | Parameters |
| 940 | ---------- |
| 941 | key: str |
| 942 | Property name |
| 943 | dflt |
| 944 | The default value to return if key was not found in figure |
| 945 | |
| 946 | Returns |
| 947 | ------- |
| 948 | value |
| 949 | The removed value that was previously associated with key |
| 950 | |
| 951 | Raises |
| 952 | ------ |
| 953 | KeyError |
| 954 | If key is not in object and no dflt argument specified |
| 955 | """ |
| 956 | # Handle default |
| 957 | if key not in self and args: |
| 958 | return args[0] |
| 959 | elif key in self: |
| 960 | val = self[key] |
| 961 | self[key] = None |
| 962 | return val |
| 963 | else: |
| 964 | raise KeyError(key) |
| 965 | |
| 966 | # Data |
| 967 | # ---- |
no outgoing calls
no test coverage detected