[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Closing as this would obviously need a PEP, please open a discusion first on python-ideas -- nosy: +pablogsal resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread Irit Katriel
Irit Katriel added the comment: The python-ideas mailing list is a better place for such questions than the bug tracker. -- nosy: +iritkatriel ___ Python tracker ___

[issue44366] Define functions without parentheses (if no parameters given)

2021-06-09 Thread BoĊĦtjan Mejak
this: def my_function: pass *** Is that a possible scenario at this point, or even desirable? -- components: Interpreter Core messages: 395436 nosy: PedanticHacker priority: normal severity: normal status: open title: Define functions without parentheses (if no parameters given) type

Re: functions without parentheses

2005-07-30 Thread phil hunt
On Fri, 29 Jul 2005 06:37:52 GMT, Bengt Richter [EMAIL PROTECTED] wrote: I suggested in a previous thread that one could support such a syntax by supporting an invisible binary operator between two expressions, That's a truely appalling idea. so that examine string translates to

Re: functions without parentheses

2005-07-30 Thread Bengt Richter
On Fri, 29 Jul 2005 20:54:42 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote: On Fri, 29 Jul 2005 06:37:52 +, Bengt Richter wrote: I suggested in a previous thread that one could support such a syntax by supporting an invisible binary operator between two expressions, so that examine

Re: functions without parentheses

2005-07-30 Thread Bengt Richter
On Sat, 30 Jul 2005 08:14:16 +0100, [EMAIL PROTECTED] (phil hunt) wrote: On Fri, 29 Jul 2005 06:37:52 GMT, Bengt Richter [EMAIL PROTECTED] wrote: I suggested in a previous thread that one could support such a syntax by supporting an invisible binary operator between two expressions, That's a

Re: functions without parentheses

2005-07-30 Thread Dan Sommers
On Sat, 30 Jul 2005 18:42:59 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: or arr = (ArrayElementAggregator() 11 12 13 21 22 23 ) What was that again about every other computer language wanting to be Lisp? ;-) Regards, Dan -- Dan Sommers

Re: functions without parentheses

2005-07-29 Thread Bengt Richter
On Thu, 28 Jul 2005 00:59:51 -0700 (PDT), Jerry He [EMAIL PROTECTED] wrote: Hi, Is it possible to create a function that you can use without parenthesizing the arguments? for example, for def examine(str): . . Is there some way to define it so that I can call it like

Re: functions without parentheses

2005-07-29 Thread Steven D'Aprano
On Fri, 29 Jul 2005 06:37:52 +, Bengt Richter wrote: I suggested in a previous thread that one could support such a syntax by supporting an invisible binary operator between two expressions, so that examine string translates to examine.__invisbinop__(string) if examine as an expression

Re: functions without parentheses

2005-07-29 Thread Josef Meile
Steven D'Aprano wrote: On Fri, 29 Jul 2005 06:37:52 +, Bengt Richter wrote: I suggested in a previous thread that one could support such a syntax by supporting an invisible binary operator between two expressions, so that examine string translates to examine.__invisbinop__(string) if

functions without parentheses

2005-07-28 Thread Jerry He
Hi, Is it possible to create a function that you can use without parenthesizing the arguments? for example, for def examine(str): . . Is there some way to define it so that I can call it like examine string instead of examine(string)? thanks in advance -Jerry

Re: functions without parentheses

2005-07-28 Thread Robert Kern
Jerry He wrote: Hi, Is it possible to create a function that you can use without parenthesizing the arguments? for example, for def examine(str): . . Is there some way to define it so that I can call it like examine string instead of examine(string)? No. --

RE: functions without parentheses

2005-07-28 Thread Delaney, Timothy (Tim)
Jerry He wrote: def examine(str): . . Is there some way to define it so that I can call it like examine string instead of examine(string)? No. Python's syntax does not work that way. Why would you want to? For more information about this, read:

Re: functions without parentheses

2005-07-28 Thread Steven D'Aprano
On Thu, 28 Jul 2005 00:59:51 -0700, Jerry He wrote: Hi, Is it possible to create a function that you can use without parenthesizing the arguments? What problem are you trying to solve that requires this sort of syntax, and why can't it be solved with parentheses? -- Steven. --

Re: functions without parentheses

2005-07-28 Thread Simon Dahlbacka
If you actually want that kind of syntax, then why don't you use Visual Basic? ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: functions without parentheses

2005-07-28 Thread Steve Holden
Simon Dahlbacka wrote [about function calls without parenthesis]: If you actually want that kind of syntax, then why don't you use Visual Basic? ;) Because Perl is far too tempting to ignore. The serious answer to the OP's question, however, is that Python refuses to guess whether a function

Re: functions without parentheses

2005-07-28 Thread bruno modulix
Simon Dahlbacka wrote: If you actually want that kind of syntax, then why don't you use Visual Basic? ;) s/VisualBasic/Ruby/ -- bruno desthuilliers ruby -e print '[EMAIL PROTECTED]'.split('@').collect{|p| p.split('.').collect{|w| w.reverse}.join('.')}.join('@') --

Re: functions without parentheses

2005-07-28 Thread Steven Bethard
Jerry He wrote: def examine(str): . . Is there some way to define it so that I can call it like examine string instead of examine(string)? What do you want to happen when someone types: examine ??? Or better yet, what if you do something like:

Re: functions without parentheses

2005-07-28 Thread gene tani
http://onestepback.org/index.cgi/Tech/Ruby/PythonAndRuby.rdoc this blog talks about design differences, e.g. what . means, whether functions and methods are 1st-class objects. St -- http://mail.python.org/mailman/listinfo/python-list

Re: functions without parentheses

2005-07-28 Thread Scott David Daniels
Jerry He wrote: ... Is there some way to define [examine] so I can call it like examine string instead of examine(string)? Perhaps you are looking for ipython (google for it) if all you are looking for is ease of interactive entry. --Scott David Daniels [EMAIL

Re: functions without parentheses

2005-07-28 Thread bruno modulix
Jerry He wrote: Hi, Is it possible to create a function that you can use without parenthesizing the arguments? for example, for def examine(str): . . Is there some way to define it so that I can call it like examine string instead of examine(string)? No.