New submission from Gavin D'souza <gavin...@gmail.com>:

For a simple string input, pprint would be expected to return an output similar 
to print. However, the functionality differs

### Code:
import time
from pprint import pprint

start = time.time()
time.sleep(0.5)
object_made = time.time()
time.sleep(0.5)
done = time.time()
time.sleep(0.5)
shown = time.time()

pprint(
    f"Time to create object: {object_made - start}s\n" +
    f"Time to insert 100000 rows: {done - object_made}s\n" +
    f"Time to retrieve 100000 rows: {shown - done}s\n"
)

### Output Received:
('Time to create object: 0.5010814666748047s\n'
 'Time to insert 100000 rows: 0.5010972023010254s\n'
 'Time to retrieve 100000 rows: 0.501101016998291s\n')

### Expected Output:
Time to create object: 0.5010814666748047s
Time to insert 100000 rows: 0.5010972023010254s
Time to retrieve 100000 rows: 0.501101016998291s

----------
components: Library (Lib)
messages: 340720
nosy: Gavin D'souza, fdrake
priority: normal
severity: normal
status: open
title: Unexpected Behaviour of pprint.pprint
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36705>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to