Kenny Chau
Kenny Chau

Reputation: 96

What does ... [, param] mean in Python library documentation?

I saw this in the Python standard library documentation:

class bytearray([source[, encoding[, errors]]])

I don't understand the difference between ([source[, encoding[, errors]]]) and

(source, encoding, errors). Why do they put [, ] around parameters?

Upvotes: 2

Views: 598

Answers (3)

Z. Blue
Z. Blue

Reputation: 36

Those args. are optional but both are need.

Upvotes: 1

user5991026
user5991026

Reputation: 49

required [optional] required [optional, but both needed].

Upvotes: 1

Hai
Hai

Reputation: 690

It means those arguments are optional.

Upvotes: 2

Related Questions