Question: In pandas source code, here's a snippet of the to_csv function: @overload def to_csv( self, path_or_buf: FilePath | WriteBuffer[bytes] | WriteBuffer[str], sep: str = ..., na_rep: str = ..., float_format: str | Callable | None = ...,  What does the ... mean? EDIT: A couple of users have suggested this answer. Though appreciated, as per my comment, this answer does not contain a clear explanation of ... used as function argument defaults. There is a discussion over here, but it is not concrete enough for me to consider it satisfactory, and so I rejected the suggestion to close my question as having been answered elsewhere.

Answer: The short answer: in this particular case, the ellipsis (...) is used as a placeholder for the default values in an overloaded method signature, following PEP 484 ("In stubs it may be useful to declare an argument as having a default without specifying the actual default value. … In such cases the default value may be specified as a literal ellipsis"). The long answer: In its current version, the to_csv() method provides two overloads – see source code starting here. An "overloaded function" (or method) in Python simply means a different combination of input and return types, or even a different number of arguments, for the sake of type annotation. It is provided as a stubbed definition that is marked by the @overload decorator – see the section of the corresponding PEP 484 here. At present, this looks as follows for to_csv():  @overload def to_csv( self, path_or_buf: None = ..., sep: str = ..., na_rep: str = ..., float_format: str | Callable | None = ..., columns: Sequence[Hashable] | None = ..., header: bool_t | list[str] = ..., index: bool_t = ..., index_label: IndexLabel | None = ..., mode: str = ..., encoding: str | None = ..., compression: CompressionOptions = ..., quoting: int | None = ..., quotechar: str = ..., lineterminator: str | None = ..., chunksize: int | None = ..., date_format: str | None = ..., doublequote: bool_t = ..., escapechar: str | None = ..., decimal: str = ..., errors: OpenFileErrors = ..., storage_options: StorageOptions = ..., ) -> str: ... @overload def to_csv( self, path_or_buf: FilePath | WriteBuffer[bytes] | WriteBuffer[str], sep: str = ..., na_rep: str = ..., float_format: str | Callable | None = ..., columns: Sequence[Hashable] | None = ..., header: bool_t | list[str] = ..., index: bool_t = ..., index_label: IndexLabel | None = ..., mode: str = ..., encoding: str | None = ..., compression: CompressionOptions = ..., quoting: int | None = ..., quotechar: str = ..., lineterminator: str | None = ..., chunksize: int | None = ..., date_format: str | None = ..., doublequote: bool_t = ..., escapechar: str | None = ..., decimal: str = ..., errors: OpenFileErrors = ..., storage_options: StorageOptions = ..., ) -> None: ... @final @doc( storage_options=_shared_docs["storage_options"], compression_options=_shared_docs["compression_options"] % "path_or_buf", ) def to_csv( self, path_or_buf: FilePath | WriteBuffer[bytes] | WriteBuffer[str] | None = None, sep: str = ",", na_rep: str = "", float_format: str | Callable | None = None, columns: Sequence[Hashable] | None = None, header: bool_t | list[str] = True, index: bool_t = True, index_label: IndexLabel | None = None, mode: str = "w", encoding: str | None = None, compression: CompressionOptions = "infer", quoting: int | None = None, quotechar: str = '"', lineterminator: str | None = None, chunksize: int | None = None, date_format: str | None = None, doublequote: bool_t = True, escapechar: str | None = None, decimal: str = ".", errors: OpenFileErrors = "strict", storage_options: StorageOptions | None = None, ) -> str | None: # Actual doc and source of the method follow  Note that the only difference between the first and second overload is the combination of path_or_buf argument and the return type:  In the first case, path_or_buf is None and the return type will be str (namely, as no path is given, the resulting CSV data will be returned). In the second case, path_or_buf is something writeable (a file path or some buffer) and the return type will be None (as the CSV data is written to the path or buffer, it does not need to be returned).  The default values of arguments do not matter at this point, so they are simply abbreviated as an ellipsis. This, again, follows PEP 484, which specifies:  In stubs it may be useful to declare an argument as having a default without specifying the actual default value. … In such cases the default value may be specified as a literal ellipsis.  This seems to be a good choice for several reasons:  Syntactically, this is just fine, as the ellipsis, as of Python 3, is an ordinary Python object. For a human reader, it is convenient to read; also, it avoids using None for the same purpose, which would be ambiguous (as in: does it mean "I don't care about the actual value at this point" or does it mean "the default value is None"?). For the Python interpreter, it does not make a difference, as it takes its default values from the final signature that precedes the actual code. (This final signature, the third one in the given case, also combines the type annotations for path_or_buf and the return type from the previous two cases, so it is not immediately clear from the type annotations alone, which combinations are possible – which is why @overload was used in the first place).  One might wonder why the ellipses are provided here at all – in fact, the code seems to run just as well without them (except for the ones that replace the method body in the stubs). However, as pointed out by @tobias_k, they help with another distinction, regarding the overloads: in the way the ellipses are used, they indicate that a default value is actually part of this particular overload. Note the path_or_buf argument: its default value is only meaningful for the first overload (path_or_buf is None), but not for the second (a path or buffer must be provided by the caller). Consequently, an ellipsis is only present in the first overload's signature but not in the second overload's signature for this particular argument.