RE: why is print a function
"Mark Hahn" <[email protected]> Mon, 26 Jul 2004 14:08:53 -0700
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <000c01c47354$c1df71f0$0b01a8c0@mark> |
Martin Christensen wrote: >>>>>> "Mark" == Mark Hahn <[email protected]> writes: >Mark> I have some vague idea that the only keywords should be >ones that >Mark> have code blocks, but if that is true should raise, assert, etc. >Mark> be functions also? > >That would certainly make them easier to override. That's the >only argument I can think of off the top of my head that >hasn't to do with aesthetics. Good point! That may be the only reason. You could override it and then call the original when you want to from the overriding version. This would apply to the other keywords also. def print(*args, **kwargs): blah blah blah Object.print(*args, **kwargs) I was thinking it might be so you could use it in a generator or something but that seemed silly. That would be encouraging bad coding style.