<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;">
<p></p>
<div>
<div>Hi folks<br>
I was thinking about how sometimes, a function sometimes acts on classes, and <br>
behaves very much like a method. Adding new methods to classes existing classes<br>
is currently somewhat difficult, and having pseudo methods would make that <br>
easier.<br>
<br>
Code example: (The syntax can most likely be improved upon)<br>
def has_vowels(self: str):<br>
for vowel in ["a", "e,", "i", "o", "u"]:<br>
if vowel in self: return True<br>
<br>
This allows one to wring `string.has_vowels()` instead of `has_vowels(string)`, <br>
which would make it easier to read, and would make it easier to add <br>
functionality to existing classes, without having to extend them. This would be <br>
useful for builtins or imported libraries, so one can fill in "missing" methods.<br>
<br>
* Simple way to extend classes <br>
* Improves readability <br>
* Easy to understand <br>
<br>
~Paul</div>
</div>
<p></p>
</div>
</body>
</html>