On Sep 27, 4:16 am, Ben Finney <[EMAIL PROTECTED]>
wrote:
> process <[EMAIL PROTECTED]> writes:
> > ' '.join([`x * x` for x in range(1, 6)])
>
> > exactly what does this symbol do and what does it stand for?
>
> It's an obsolete, deprecated syntactic sugar for (what is now
> implemented as) the bui
In article
<[EMAIL PROTECTED]>,
alex23 <[EMAIL PROTECTED]> wrote:
> ' '.join((str(x * x) for x in range(1,6)))
Aren't the outer set of parens redundant? This works just as well:
' '.join(str(x * x) for x in range(1,6))
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 27, 3:58 pm, r0g <[EMAIL PROTECTED]> wrote:
> Ah, just spotted the backticks - they just return whatever's inside them
> as a string.
No, they return the repr() of the object inside. The output of
__repr__ -has- to be a string, but typecasting into string isn't the
intention of repr() (or t
process wrote:
> ' '.join([`x * x` for x in range(1, 6)])
>
> exactly what does this symbol do and what does it stand for?
Ah, just spotted the backticks - they just return whatever's inside them
as a string.
--
http://mail.python.org/mailman/listinfo/python-list
process wrote:
> ' '.join([`x * x` for x in range(1, 6)])
>
> exactly what does this symbol do and what does it stand for?
Which symbol, the '*' ???
Are you kidding?
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 27, 12:39 pm, process <[EMAIL PROTECTED]> wrote:
> ' '.join([`x * x` for x in range(1, 6)])
>
> exactly what does this symbol do and what does it stand for?
`` is the same as repr(). I'm pretty sure the backtick
operator has been removed from 3.0.
In the context of the code sample you post
process <[EMAIL PROTECTED]> writes:
> ' '.join([`x * x` for x in range(1, 6)])
>
> exactly what does this symbol do and what does it stand for?
It's an obsolete, deprecated syntactic sugar for (what is now
implemented as) the built-in 'repr' function.
Instead, write the above as:
' '.join(
' '.join([`x * x` for x in range(1, 6)])
exactly what does this symbol do and what does it stand for?
--
http://mail.python.org/mailman/listinfo/python-list