Hello can I make funktions callable without () like print
at time the interpreter seems to printout the adres when I type the
function without ()
--
http://mail.python.org/mailman/listinfo/python-list
iwl [EMAIL PROTECTED] wrote:
Hello can I make funktions callable without ()
no, not really.
like print at time the interpreter seems to printout the adres when I type the
function without ()
the interpreter does repr() on the object (which calls the __repr__ method),
and prints the result.
iwl wrote:
Hello can I make funktions callable without () like print
at time the interpreter seems to printout the adres when I type the
function without ()
print is not a function, it's a statement, and as such equivalent to
raise or assert.
Georg
--
print is supposed to become a function in Py3k, though.
On 12/7/06, Georg Brandl [EMAIL PROTECTED] wrote:
iwl wrote:
Hello can I make funktions callable without () like print
at time the interpreter seems to printout the adres when I type the
function without ()
print is not a function,
iwl wrote:
Hello can I make funktions callable without () like print
at time the interpreter seems to printout the adres when I type the
function without ()
Hi iwl,
its one of the python fundamentals when dealing with functions.
function_name without the () refers to the function object,
iwl wrote:
Hello can I make funktions callable without () like print
at time the interpreter seems to printout the adres when I type the
function without ()
As everyone else has already told you, print is a statement, not a
function. If you want your source code to use these self-calling-