On Feb 19, 2004, at 1:36 PM, Thomas Heller wrote: > Bob Ippolito <bob at redivi.com> writes: > >> Here's a quick overview: >> >> def foo(args) [sugary, expressions, list]: >> pass >> >> This is equivalent to: >> >> def foo(args): >> pass >> foo = list(expressions(sugary(foo))) [examples showing how much nicer it makes type annotation in ctypes and PyObjC] > BTW (I have this patch not yet applied), is it possible to use more > than > one line, in this way? > > def function(arg1, arg2, arg3, arg4, arg5, arg6) > [dothis, dothat, doanother]: > > All in all, I'm +1 on the patch. No, that is not valid syntax with the current patch.. you would need: def function(arg1, arg2, arg3, arg4, arg5, arg6 ) [dothis, dothat, doanother]: or def function(arg1, arg2, arg3, arg4, arg5, arg6) [ dothis, dothat, doanother]: (or some variation, that makes it obvious to Python that the def is not complete). -bob
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