Parses the string representation of a Python str */
| 286 | Parses the string representation of a Python str |
| 287 | */ |
| 288 | inline std::string parse_str(const std::string &in) { |
| 289 | if ((in.front() == '\'') && (in.back() == '\'')) |
| 290 | return in.substr(1, in.length() - 2); |
| 291 | |
| 292 | throw std::runtime_error("Invalid python string."); |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | Parses the string represenatation of a Python tuple into a vector of its items |