Skip to content

Handle flush as a keyword arg to print() #1127

@dhalbert

Description

@dhalbert

The latest MicroPython merge, incorporated in 4.0.0-alpha, now checks the validity of keyword args to print(), instead of ignoring keywords it doesn't recognize.

flush is not currently handled, but has valid uses: cf. adafruit/Adafruit_CircuitPython_Fingerprint#9, where print(..., end="", flush=True) is passed to allow incremental status messages to be printed on the same line.

It looks like flush=True is the "default", and flush=False (buffers output) is not possible with the current I/O implementation, if I understand correctly

Note that file= isn't implemented either: that would be nice, but also maybe not possible now. (No issue opened for that.)

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions