File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ Deprecations & breaking changes
18
18
19
19
* Python 3.6 is no longer supported (:gh: `919 `) - Aarni Koskela
20
20
* The `get_next_timezone_transition ` function is no more (:gh: `958 `) - Aarni Koskela
21
+ * `Locale.parse() ` will no longer return `None `; it will always return a Locale or raise an exception.
22
+ Passing in `None `, though technically allowed by the typing, will raise. (:gh: `966 `)
21
23
22
24
New features
23
25
~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -280,6 +280,15 @@ def parse(
280
280
>>> Locale.parse(l)
281
281
Locale('de', territory='DE')
282
282
283
+ If the `identifier` parameter is neither of these, such as `None`
284
+ e.g. because a default locale identifier could not be determined,
285
+ a `TypeError` is raised:
286
+
287
+ >>> Locale.parse(None)
288
+ Traceback (most recent call last):
289
+ ...
290
+ TypeError: ...
291
+
283
292
This also can perform resolving of likely subtags which it does
284
293
by default. This is for instance useful to figure out the most
285
294
likely locale for a territory you can use ``'und'`` as the
You can’t perform that action at this time.
0 commit comments