On Tue, Apr 15, 2008, Guido van Rossum wrote:
> On Tue, Apr 15, 2008 at 8:34 PM, Greg Ewing <[EMAIL PROTECTED]> wrote:
>> Guido van Rossum wrote:
>>>
>>> That's why I proposed <0, 1, ..., 9> for repr(range(10)).
>>
>> My worry is that this will lead a newcomer into thinking
>> this is some kind o
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Why only str()? Note that the interactive prompt uses repr() to display
values.
I was under the impression that for range, you still wanted to maintain the
distinction between an evalable and a friendly representa
Brad Miller wrote:
>
I wouldn't include the word "object" in any of these.
Everything in Python is an object, so it's just
space-wasting noise.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-d
I worked up prototype implementation for dict_keys, dict_values, and
dict_items
Here's an example of what the output looks like:
>>> x = {chr(i):i for i in range(68,90)}
>>> x.keys()
>>> x.values()
>>> x.items()
>>>
comments?
Are there other objects in this family that I should look at?
No, tp_print is dead, unless I am terribly mistaken. (We didn't remove
the slot because that would require updating every single static type
initializer.)
On Wed, Apr 16, 2008 at 2:39 PM, Christian Heimes <[EMAIL PROTECTED]> wrote:
> Guido van Rossum schrieb:
>
> > Why only str()? Note that the in
Guido van Rossum schrieb:
> Why only str()? Note that the interactive prompt uses repr() to display
> values.
Does py3k still use the tp_print slot for the interactive prompt?
Christian
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.pyth
On Wed, Apr 16, 2008 at 1:16 PM, Terry Reedy <[EMAIL PROTECTED]> wrote:
>
> "Guido van Rossum" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>
> | On Wed, Apr 16, 2008 at 3:15 AM, Armin Rigo <[EMAIL PROTECTED]> wrote:
> | > What about the less confusing and more readily genera
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| On Wed, Apr 16, 2008 at 3:15 AM, Armin Rigo <[EMAIL PROTECTED]> wrote:
| > What about the less confusing and more readily generalizable:
| >
| >
| >
| > It would also be helpful IMHO to use this kind of repr fo
On Wed, 16 Apr 2008, David Wolever wrote:
> On 16-Apr-08, at 9:37 AM, Isaac Morland wrote:
>> On Wed, 16 Apr 2008, Paul Moore wrote:
>>> On 16/04/2008, Armin Rigo <[EMAIL PROTECTED]> wrote:
What about the less confusing and more readily generalizable:
It would also be helpfu
On Wed, Apr 16, 2008 at 3:15 AM, Armin Rigo <[EMAIL PROTECTED]> wrote:
> What about the less confusing and more readily generalizable:
>
>
>
> It would also be helpful IMHO to use this kind of repr for most built-in
> iterators and iterables, instead of their mosty-useless default repr.
We
On Wed, Apr 16, 2008 at 6:58 AM, Steve Holden <[EMAIL PROTECTED]> wrote:
>
> If you consume values from the iterator to display them in the repr()
> where do you then propose to store them until the application wants
> them, and how do you distinguish between "real" and "repr" consumption
> of the
On Apr 16, 2008, at 5:15 AM, Armin Rigo wrote:
> Hi Greg,
>
> On Wed, Apr 16, 2008 at 03:34:44PM +1200, Greg Ewing wrote:
>>> That's why I proposed <0, 1, ..., 9> for repr(range(10)).
>>
>> My worry is that this will lead a newcomer into thinking
>> this is some kind of valid expression syntax.
>
Isaac Morland wrote:
> On Wed, 16 Apr 2008, Paul Moore wrote:
>
>> On 16/04/2008, Armin Rigo <[EMAIL PROTECTED]> wrote:
>>> What about the less confusing and more readily generalizable:
>>>
>>>
>>>
>>> It would also be helpful IMHO to use this kind of repr for most built-in
>>> iterators and it
Isaac Morland wrote:
> On Wed, 16 Apr 2008, Paul Moore wrote:
>
>> On 16/04/2008, Armin Rigo <[EMAIL PROTECTED]> wrote:
>>> What about the less confusing and more readily generalizable:
>>>
>>>
>>>
>>> It would also be helpful IMHO to use this kind of repr for most built-in
>>> iterators and it
On 16-Apr-08, at 9:37 AM, Isaac Morland wrote:
> On Wed, 16 Apr 2008, Paul Moore wrote:
>> On 16/04/2008, Armin Rigo <[EMAIL PROTECTED]> wrote:
>>> What about the less confusing and more readily generalizable:
>>>
>>>
>>> It would also be helpful IMHO to use this kind of repr for most
>>> buil
On Wed, 16 Apr 2008, Paul Moore wrote:
> On 16/04/2008, Armin Rigo <[EMAIL PROTECTED]> wrote:
>> What about the less confusing and more readily generalizable:
>>
>>
>>
>> It would also be helpful IMHO to use this kind of repr for most built-in
>> iterators and iterables, instead of their mosty-
On 16/04/2008, Armin Rigo <[EMAIL PROTECTED]> wrote:
> What about the less confusing and more readily generalizable:
>
>
>
> It would also be helpful IMHO to use this kind of repr for most built-in
> iterators and iterables, instead of their mosty-useless default repr.
I quite like this. But as
Hi Greg,
On Wed, Apr 16, 2008 at 03:34:44PM +1200, Greg Ewing wrote:
> > That's why I proposed <0, 1, ..., 9> for repr(range(10)).
>
> My worry is that this will lead a newcomer into thinking
> this is some kind of valid expression syntax.
What about the less confusing and more readily generaliz
On Tue, Apr 15, 2008 at 8:34 PM, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> > That's why I proposed <0, 1, ..., 9> for repr(range(10)).
>
> My worry is that this will lead a newcomer into thinking
> this is some kind of valid expression syntax.
You and Steven D'Aprano bot
Guido van Rossum wrote:
> That's why I proposed <0, 1, ..., 9> for repr(range(10)).
My worry is that this will lead a newcomer into thinking
this is some kind of valid expression syntax.
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http:/
Hi folks,
Been lurking for a while, this is my first post.
As I recall, this discussion was started because of concern that Python
3 had introduced features that made it less friendly to beginners. If I
can quote Brad Miller:
"Several new iterators have appeared in Python 3.0 that makes the
That's why I proposed <0, 1, ..., 9> for repr(range(10)). (And I meant
the '...' literally, i.e. if there are more than 4 values, replace all
but the first two and the last with three dots. And yes, I mean that
str(range(4)) == '<0, 1, 2, 3>' but str(range(5)) == '<0, 1, ..., 4>'.
I'm not at all s
Brad Miller wrote:
> It was suggested that a broader discussion might be in order around the
> issue of iterators and how they are displayed in the command line
> interpreter.
Whatever is done, I don't think it would be a good idea
to make the str() of these things look *too* much like
a list. I
After posting a patch to implement this some good discussion followed
see: http://bugs.python.org/issue2610
It was suggested that a broader discussion might be in order around
the issue of iterators and how they are displayed in the command line
interpreter.
Several new iterators have app
I'd object to it returning something that resembles a list too
closely, but I could live with str(range(3)) return <0, 1, 2>. We
should probably have a cutoff so that if there are more than 6 values
it'll show the first 3 values, then dots, then the last 2 values. (The
cutoff would be computed so t
Hi,
I use Python in my CS1 and CS2 curriculum and I have a question.
As I've been using the Python 3.0 alphas one of the things that I am
bothered by is that I cannot see the sequence produced by range
without introducing students to the list() function.
I typically introduce range on day 1 o
26 matches
Mail list logo