Warren DeLano wrote: > In other words we have lost the ability to refer to "as" as the > generalized OOP-compliant/syntax-independent method name for casting: Other possible spellings: # Use the normal Python idiom for avoiding keyword clashes # and append a trailing underscore new_object = old_object.as_(class_hint) float_obj = int_obj.as_("float") float_obj = int_obj.as_(float_class) # Use a different word (such as, oh, "cast" perhaps?) new_object = old_object.cast(class_hint) float_obj = int_obj.cast("float") float_obj = int_obj.cast(float_class) You could make a PEP if you really wanted to, but it's going to be rejected. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia ---------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4