Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 17th, 2012  |  syntax: None  |  size: 0.19 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Python C-API: Using `PySequence_Length` with dictionaries
  2. PyObject* d = PyDict_New();
  3. Py_ssize_t res = PySequence_Length(d);
  4.  
  5. printf("Result : %ldn", res);
  6. if (res == -1) PyErr_Print();