@@ -580,19 +580,41 @@ def _is_iterable_not_string_like(x):
580580 raise ValueError (f"linestyle { ls !r} is not a valid on-off ink sequence." )
581581
582582
583- validate_joinstyle = ValidateInStrings ('joinstyle' ,
584- ['miter' , 'round' , 'bevel' ],
585- ignorecase = True )
586- validate_joinstylelist = _listify_validator (validate_joinstyle )
583+ def _deprecate_case_insensitive_join_cap (s ):
584+ s_low = s .lower ()
585+ if s != s_low :
586+ if s_low in ['miter' , 'round' , 'bevel' ]:
587+ cbook .warn_deprecated (
588+ "3.3" , message = "Case-insensitive capstyles are deprecated "
589+ "since %(since)s and support for them will be removed "
590+ "%(removal)s; please pass them in lowercase." )
591+ elif s_low in ['butt' , 'round' , 'projecting' ]:
592+ cbook .warn_deprecated (
593+ "3.3" , message = "Case-insensitive joinstyles are deprecated "
594+ "since %(since)s and support for them will be removed "
595+ "%(removal)s; please pass them in lowercase." )
596+ # Else, error out at the check_in_list stage.
597+ return s_low
598+
599+
600+ def validate_joinstyle (s ):
601+ s = _deprecate_case_insensitive_join_cap (s )
602+ cbook ._check_in_list (['miter' , 'round' , 'bevel' ], joinstyle = s )
603+ return s
587604
588- validate_capstyle = ValidateInStrings ('capstyle' ,
589- ['butt' , 'round' , 'projecting' ],
590- ignorecase = True )
591- validate_capstylelist = _listify_validator (validate_capstyle )
592605
593- validate_fillstyle = ValidateInStrings ('markers.fillstyle' ,
594- ['full' , 'left' , 'right' , 'bottom' ,
595- 'top' , 'none' ])
606+ def validate_capstyle (s ):
607+ s = _deprecate_case_insensitive_join_cap (s )
608+ cbook ._check_in_list (['butt' , 'round' , 'projecting' ], capstyle = s )
609+ return s
610+
611+
612+ validate_fillstyle = ValidateInStrings (
613+ 'markers.fillstyle' , ['full' , 'left' , 'right' , 'bottom' , 'top' , 'none' ])
614+
615+
616+ validate_joinstylelist = _listify_validator (validate_joinstyle )
617+ validate_capstylelist = _listify_validator (validate_capstyle )
596618validate_fillstylelist = _listify_validator (validate_fillstyle )
597619
598620
0 commit comments