Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 927bb9e

Browse files
committed
Use dict.fromkeys where possible
1 parent 3309368 commit 927bb9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

galleries/examples/showcase/stock_prices.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
'ADBE', 'GSPC', 'IXIC']
4343

4444
# Manually adjust the label positions vertically (units are points = 1/72 inch)
45-
y_offsets = {k: 0 for k in stocks_ticker}
45+
y_offsets = dict.fromkeys(stocks_ticker, 0)
4646
y_offsets['IBM'] = 5
4747
y_offsets['AAPL'] = -5
4848
y_offsets['AMZN'] = -6

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ def __init__(self, fig,
646646
self._aspect = 'auto'
647647
self._adjustable = 'box'
648648
self._anchor = 'C'
649-
self._stale_viewlims = {name: False for name in self._axis_names}
649+
self._stale_viewlims = dict.fromkeys(self._axis_names, False)
650650
self._forward_navigation_events = forward_navigation_events
651651
self._sharex = sharex
652652
self._sharey = sharey

0 commit comments

Comments
 (0)