nerdexam
Python_Institute

PCPP-32-101 · Question #47

Which of the following types cannot be pickled?

The correct answer is D. function and class definitions. Function and class definitions cannot be pickled because they are not easily serializable due to their code and environment dependencies.

Working with Files

Question

Which of the following types cannot be pickled?

Options

  • ANone, booleans
  • Bstrings, bytes, bytearrays
  • Cintegers, floating-point numbers, complex numbers
  • Dfunction and class definitions

How the community answered

(42 responses)
  • A
    2% (1)
  • B
    7% (3)
  • C
    2% (1)
  • D
    88% (37)

Explanation

Function and class definitions cannot be pickled because they are not easily serializable due to their code and environment dependencies.

Topics

#pickle#serialization#unpicklable types#function definitions

Community Discussion

No community discussion yet for this question.

Full PCPP-32-101 Practice