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 @@ -279,6 +279,15 @@ def parse(
279
279
>>> Locale.parse(l)
280
280
Locale('de', territory='DE')
281
281
282
+ If the `identifier` parameter is neither of these, such as `None`
283
+ e.g. because a default locale identifier could not be determined,
284
+ a `TypeError` is raised:
285
+
286
+ >>> Locale.parse(None)
287
+ Traceback (most recent call last):
288
+ ...
289
+ TypeError: ...
290
+
282
291
This also can perform resolving of likely subtags which it does
283
292
by default. This is for instance useful to figure out the most
284
293
likely locale for a territory you can use ``'und'`` as the
You can’t perform that action at this time.
0 commit comments