Is it possible to make the result of map() look like a list if people
are paying attention, but use memory like an iterator when they're
not? We'd want to distinguish between:
x = map(...)
and
for x in map(...)
Actually, to get any use out of it, we'd need to allow the first case,
as long as
Talin wrote:
> But the formatters for int and float have to happen *after* type
> coercion.
I don't see why. Couldn't the __format__ method
for an int recognise float formats as well and coerce
itself as necessary?
> (I should also mention that "a:b,c" looks prettier to my eye than
> "a,b:c".
Ron Adam wrote:
> '{0:10;20,f.2}'
>
> Works for me.
It doesn't work for me, as it breaks up into
0:10; 20,f.2
i.e. semicolons separate more strongly than commas
to my eyes.
--
Greg
___
Python-3000 mailing list
[email protected]
http://m
Jeffrey Yasskin wrote:
>
> Is it possible to make the result of map() look like a list if people
> are paying attention, but use memory like an iterator when they're
> not?
I suppose it could lazily materialise a list behind the
scenes when needed (i.e. on the first __getitem__ or
__len__ call),
Greg Ewing wrote:
> Ron Adam wrote:
>
>> '{0:10;20,f.2}'
>>
>> Works for me.
>
> It doesn't work for me, as it breaks up into
>
>0:10; 20,f.2
>
> i.e. semicolons separate more strongly than commas
> to my eyes.
And after my reply I realized this looks a bit odd.
{0:;20,f.2}
B
Ron Adam wrote:
> An alternative I thought of this morning is to reuse the alignment symbols
> '^', '+', and '-' and require a minimum width if a maximum width is specified.
One more (or two) additions to this...
In the common cases of generating columnar reports, the min_width and
max_width
I'm looking at the recently submitted patch for the csv module and am
scratching my head a bit trying to understand the code transformations.
I've not looked at any py3k code yet, so this is all new to me. Is there
any documentation about the Py3k conversion? I'm particularly interested in
the st
During the recast of the atexit module into C it grew _clear and unregister
functions. I can understand that a clear function might be handy, but why
is it private?
Given that sys.exitfunc is gone is there a reason to have _run_exitfuncs?
Who's going to call it?
Finally, I can see a situation wh
I haven't seen the patch you mention, and unfortunately there aren't
docs for the conversion yet.
However, one thing to note is that in 2.x, the PyString type ('str')
is used for binary data, encoded text data, and decoded text data. In
3.0, binary and encoded text are represented using PyBytes ('
skip> Given that sys.exitfunc is gone is there a reason to have
skip> _run_exitfuncs? Who's going to call it?
I should have elaborated. Clearly you need some way to call it, but since
that is going to be called from C code (isn't it?), why expose it to Python
code?
Skip
___
[EMAIL PROTECTED] wrote:
> skip> Given that sys.exitfunc is gone is there a reason to have
> skip> _run_exitfuncs? Who's going to call it?
>
> I should have elaborated. Clearly you need some way to call it, but since
> that is going to be called from C code (isn't it?), why expose it to
Ron Adam wrote:
> Which would result in a first column that right aligns, a second column
> that centers unless the value is longer than 100, in which case it right
> align, and cuts the end, and a third column that left aligns, but cuts off
> the right if it's over 15.
All this talk about cutt
[EMAIL PROTECTED] wrote:
> I can see a situation where you might register the same function
> multiple times with different argument lists, yet unregister takes only the
> function as the discriminator.
One way to fix this would be to remove the ability to
register arguments along with the functio
Well, regardless of the brokenness of the patch, I do get two
different failures from this test on OSX. The first is caused by
trying to socket.bind() a port that's already been bound recently:
Exception in thread Thread-2:
Traceback (most recent call last):
File "/Users/jyasskin/src/python/test
On 8/4/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Ron Adam wrote:
> > Which would result in a first column that right aligns, a second column
> > that centers unless the value is longer than 100, in which case it right
> > align, and cuts the end, and a third column that left aligns, but cuts off
skip> Given that sys.exitfunc is gone is there a reason to have
skip> _run_exitfuncs? Who's going to call it?
Christian> Unit tests? Some developers might want to test their
Christian> registered functions.
Your tests can just fork another instance of Python which prints:
p
>> I can see a situation where you might register the same function
>> multiple times with different argument lists, yet unregister takes
>> only the function as the discriminator.
Greg> One way to fix this would be to remove the ability to register
Greg> arguments along with
Ron Adam wrote:
> Ron Adam wrote:
>
>> An alternative I thought of this morning is to reuse the alignment symbols
>> '^', '+', and '-' and require a minimum width if a maximum width is
>> specified.
>
> One more (or two) additions to this...
(snipped)
I've kind of lost track of what the prop
Guido van Rossum wrote:
> On 8/4/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
>> Ron Adam wrote:
>>> Which would result in a first column that right aligns, a second column
>>> that centers unless the value is longer than 100, in which case it right
>>> align, and cuts the end, and a third column th
19 matches
Mail list logo