How to use 'sizeof in python' in Python

Every line of 'sizeof in python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
555def descr_sizeof(self, w_arg):
556 """\
557Return the size in bytes of the argument.
558It can be a string naming a C type, or a 'cdata' instance."""
559 #
560 if isinstance(w_arg, W_CData):
561 size = w_arg._sizeof()
562 else:
563 w_ctype = self.ffi_type(w_arg, ACCEPT_ALL)
564 size = w_ctype.size
565 if size < 0:
566 raise oefmt(self.w_FFIError,
567 "don't know the size of ctype '%s'", w_ctype.name)
568 return self.space.newint(size)

Related snippets