On Fri, Apr 21, 2006 at 08:10:07PM +1200, Greg Ewing wrote:
> Aurélien Campéas wrote:
> > On Thu, Apr 20, 2006 at 07:59:43PM +1200, Greg Ewing wrote:
> > > Andy Sy wrote:
> > > > Does this mean that Py3K intends to reuse major portions of
> > > > Python 2.x's implementation?
> > > I expect that alm
The optional static typing blog
http://www.artima.com/weblogs/viewpost.jsp?thread=87182 and many other
postings imply a lot of interesting detail about types, type expression, type
checking, adapt() and such. I'm considering collecting some of these
subjects together in a note for review and p
On 4/24/06, guido.van.rossum wrote:
+new->ob_size = size;+if (size == 0)+new->ob_bytes = NULL;+else {+new->ob_bytes = PyMem_Malloc(size);+if (new->ob_bytes == NULL) {+Py_DECREF(new);
+return NULL;+
Hi Guido,
> On 4/24/06, Greg Wilson <[EMAIL PROTECTED]> wrote:
> > On a completely different note, are you willing to consider native
> > syntax for sets (as per PEP 218) in Python 3000?
> I like to write {1, 2, 3} instead of set([1, 2, 3]) but I don't know
> what to do with the ambiguity for {}.
On Mon, 2006-04-24 at 10:16 -0400, Greg Wilson wrote:
> I'm sure we can work something out --- I agree, {} for empty set and {:}
> for empty dict would be ideal, were it not for backward compatibility.
I dunno, the more I write dict() and set() the more I kind of like them
rather the literal alte
On 4/24/06, Greg Wilson <[EMAIL PROTECTED]> wrote:
> Would getting a
> trial implementation done on top of P2.5 be a good Google Summer of Code
> project?
Mmm, seems a rather small project to me to spend a whole summer...
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
__
Talin wrote:
> It seems that the history of the Python mailing lists are littered with the
> decayed corpses of various ideas related to "metaprogramming", that is,
> programs
> that write programs, either at compile time.
>
> We've seen proposals for C-style macros, Lisp-style macros, programmab
Here's something for the crazy idea bin...
Right now class creation looks like:
class X(base):
y = 'z'
This gets the things in the () (object), evaluates the body of the class
in a new scope and captures that scope (namespace), and looks for a
metaclass using a couple rules. Then it
On 4/23/06, Talin <[EMAIL PROTECTED]> wrote:
>... you can't just do it for a single argument in isolation. You
> have no idea where any positional argument is going to
> go until all keyword arguments have been placed, and
> until all previous positional arguments have
> been placed.
Yes you do.
On 4/24/06, Barry Warsaw <[EMAIL PROTECTED]> wrote:
> On Mon, 2006-04-24 at 10:16 -0400, Greg Wilson wrote:
>
> > I'm sure we can work something out --- I agree, {} for empty set and {:}
> > for empty dict would be ideal, were it not for backward compatibility.
>
> I dunno, the more I write dict()
On 4/22/06, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> Talin wrote:
> > 2) Otherwise, see if the value to be formatted has a __format__ method. If
> > it does, then call it.
> So an object can override standard parsing like {0:d} to return something
> other than an integer? *shudder*
There are s
Talin wrote:
>>>4) Should there be a way to pass in a dict argument without flattening it via
>>>**args?
>>
>>I think it might not be ambiguous in practice if the first argument
>>could be a dictionary. Because you get:
>>
>> "{foo}".format(a_dict)
>>
>>Since 'foo' isn't an integer and *no* key
In another thread ("Brainstorming: Python Metaprogramming") it occurred
to me that many LINQish things are reasonable enough given the AST and
generator expressinos. But sorting is hard to do. Sorting also remains
a place where lambdas are still frequently needed, like:
sorted(list_of_peop
On 4/24/06, Ian Bicking <[EMAIL PROTECTED]> wrote:
> Here's something for the crazy idea bin...
>
> Right now class creation looks like:
>
>class X(base):
>y = 'z'
>
> This gets the things in the () (object), evaluates the body of the class
> in a new scope and captures that scope (name
On Mon, Apr 24, 2006 at 10:53:39AM -0500, Ian Bicking wrote:
> Here's something for the crazy idea bin...
>
> Right now class creation looks like:
>
>class X(base):
>y = 'z'
>
> This gets the things in the () (object), evaluates the body of the class
> in a new scope and captures th
On 4/23/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
> ... the normal Python rule is that if you have a full-colon
> (ANYWHERE), and you put something after it on the
> same line, then you're done the block.
That would already be a slight improvement, from my perspective.
Today, being done is requi
On 4/24/06, Greg Wilson <[EMAIL PROTECTED]> wrote:
> Interesting --- I think that being able to write down a data structure
> using the same sort of notation you'd use on a whiteboard in a high school
> math class is one of the great strengths of scripting languages, and one
> of the things that ma
On 4/18/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On 4/18/06, Jim Jewett <[EMAIL PROTECTED]> wrote:
> Do you realize that you are
> describing that the expression
> .foo
> is syntactic sugar for
>
> lambda self: self._foo()
Somehow I had it in my head that I needed to also call t
Interesting --- I think that being able to write down a data structure
using the same sort of notation you'd use on a whiteboard in a high school
math class is one of the great strengths of scripting languages, and one
of the things that makes it possible to use Python, Perl, and Ruby as
configurat
Ian Bicking <[EMAIL PROTECTED]> wrote:
>
> In another thread ("Brainstorming: Python Metaprogramming") it occurred
> to me that many LINQish things are reasonable enough given the AST and
> generator expressinos. But sorting is hard to do. Sorting also remains
> a place where lambdas are sti
Bill> Has a PEP already been written? Would this be useful? Who else
Bill> finds this interesting or may have started on these subjects?
Bill> OK, so I'm fishing for encouragement here. ;-)
To very loosely paraphrase the late (some would say great) Johnny Cochran:
When in do
On 4/22/06, Talin <[EMAIL PROTECTED]> wrote:
> Here's a condensed list of the open issues that have been raised by people
> so far:
I'm not sure whether this was raised explicitly, but Ian at least
mentioned it: Are they keys to the dictionary in some way restricted?
For instance, I think it wou
Greg Wilson wrote:
> Interesting --- I think that being able to write down a data structure
> using the same sort of notation you'd use on a whiteboard in a high school
> math class is one of the great strengths of scripting languages, and one
> of the things that makes it possible to use Python, P
Jim Jewett gmail.com> writes:
>
> On 4/22/06, Talin acm.org> wrote:
> > Here's a condensed list of the open issues that have been raised by people
> > so far:
>
> I'm not sure whether this was raised explicitly, but Ian at least
> mentioned it: Are they keys to the dictionary in some way rest
On 4/24/06, Alex Martelli <[EMAIL PROTECTED]> wrote:
> On 4/24/06, Greg Wilson <[EMAIL PROTECTED]> wrote:
> > Interesting --- I think that being able to write down a data structure
> > using the same sort of notation you'd use on a whiteboard in a high school
> > math class is one of the great stre
Josiah Carlson wrote:
> One of the features of generator expressions which makes it desireable
> instead of list comprehensions is that generator expressions may use
> less memory *now*, and may be able to start returning results *now*.
>
> Using ( orderby ...) as a replacement for sorted((genexp)
Talin wrote:
>>>Here's a condensed list of the open issues that have been raised by people
>>>so far:
>>
>>I'm not sure whether this was raised explicitly, but Ian at least
>>mentioned it: Are they keys to the dictionary in some way restricted?
>>
>>For instance, I think it would be reasonable to
On 4/24/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On 4/24/06, Alex Martelli <[EMAIL PROTECTED]> wrote:
> > On 4/24/06, Greg Wilson <[EMAIL PROTECTED]> wrote:
> > > Interesting --- I think that being able to write down a data structure
> > > using the same sort of notation you'd use on a whi
On 4/24/06, Alex Martelli <[EMAIL PROTECTED]> wrote:
> I dislike that as much as I dislike [] as a shorthand for
> list(), but I have no trouble admitting that if we have the
> [...] form, it's consistent to have the {...} one too.
I think you're atypical in that dislike.
--
--Guido van Rossum (h
On 4/24/06, Thomas Wouters <[EMAIL PROTECTED]> wrote:
>
> On 4/24/06, guido.van.rossum wrote:
> > +new->ob_size = size;
>
> +if (size == 0)
> +new->ob_bytes = NULL;
> +else {
> +new->ob_bytes = PyMem_Malloc(size);
> +if (new->ob_bytes == NULL) {
> +P
On Mon, 2006-04-24 at 11:18 -0700, Guido van Rossum wrote:
> > Hmmm... Should we see this as official confirmation that PEP 7 is going to
> > go to 4-space indents instead of tab ones, or is it just an editor
> > accidentily left in Google-indent mode? (I think I prefer the former ;)
>
> The form
On Mon, 2006-04-24 at 11:18 -0700, Guido van Rossum wrote:
> The former. I thought it was already decided? Of course, only for
> *new* code so far, to ease merges.
Here's a tiny bit of Emacs Lisp that should support the py3k style.
Only moderately tested in XEmacs 21.5.
-Barry
(defconst py3k-st
On 4/24/06, Barry Warsaw <[EMAIL PROTECTED]> wrote:
> On Mon, 2006-04-24 at 11:18 -0700, Guido van Rossum wrote:
>
> > > Hmmm... Should we see this as official confirmation that PEP 7 is going to
> > > go to 4-space indents instead of tab ones, or is it just an editor
> > > accidentily left in Goog
On Mon, 2006-04-24 at 11:44 -0700, Guido van Rossum wrote:
> Doesn't have to be a flag day -- we can reformat code
> opportunistically whenever there's no hope of ever doing merges from
> 2.x.
>
> I do plan that within one file we'll stick to style consistency.
Sounds good to me. I guess when s
Ian Bicking <[EMAIL PROTECTED]> wrote:
>
> Josiah Carlson wrote:
> > One of the features of generator expressions which makes it desireable
> > instead of list comprehensions is that generator expressions may use
> > less memory *now*, and may be able to start returning results *now*.
> >
> > Us
Barry> Sounds good to me. I guess when someone is about to do
Barry> significant work on a C file, we should ask on this list about
Barry> that possibility, and if it's low, then we can reformat the file
Barry> at that time.
I presume with the reformatting happening in a separate
Ian Bicking colorstudy.com> writes:
>
> Talin wrote:
> >>>Here's a condensed list of the open issues that have been raised by people
> >>>so far:
> >>
> >>I'm not sure whether this was raised explicitly, but Ian at least
> >>mentioned it: Are they keys to the dictionary in some way restricted?
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 4/24/06, Alex Martelli <[EMAIL PROTECTED]> wrote:
>> I dislike that as much as I dislike [] as a shorthand for
>> list(), but I have no trouble admitting that if we have the
>> [...] form, it's consistent to have
On 4/22/06, Talin <[EMAIL PROTECTED]> wrote:
> Brett Cannon python.org> writes:
>
> > [I am posting to python-3000 since this is where the parameter list
> > ideas are being discussed, but this is probably generic enough to
> > eventually make it into the 2.x line]
> >
> > Here is a rough draft of
"Ian Bicking" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
metaclass using a couple rules. Then it does:
>
> X = metaclass('X', (base,), {'y': 'z'})
>
> What if instead it did:
>
> X = metaclass('X', (base,))
> X.y = 'z'
What if X is inmutable, or intended to be so, either
Guido van Rossum wrote:
> OTOH mathematicians (whether in high school or not) write things like
> {x | 2 < x < 10}, which is of course the origin of our list
> comprehensions and generator expressions. Therefor I think it makes
> sense that {F(x) for x in S if P(x)}, ough to be valid syntax if we
>
Greg Wilson wrote:
>I'm sure we can work something out --- I agree, {} for empty set and {:}
>for empty dict would be ideal, were it not for backward compatibility.
>
For the record, I am strong -1 on adding a custom syntax for sets.
IMO, most of the interesting uses of sets start with some ext
On 4/24/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> Greg Wilson wrote:
>
> >I'm sure we can work something out --- I agree, {} for empty set and {:}
> >for empty dict would be ideal, were it not for backward compatibility.
> >
[snip]
> Further, punctuation approaches face uncomfortable choic
The recent discussion about the with statement on python-dev reminded me
that at one point we talked about making chained exceptions automatic.
Could someone update PEP3100 to list chained exceptions as one of the
features that needs discussion?
--
Aahz ([EMAIL PROTECTED]) <*> ht
On 4/24/06, Aahz <[EMAIL PROTECTED]> wrote:
> The recent discussion about the with statement on python-dev reminded me
> that at one point we talked about making chained exceptions automatic.
> Could someone update PEP3100 to list chained exceptions as one of the
> features that needs discussion?
You wrote:
>Bill> Has a PEP already been written? Would this be useful? Who else
> Bill> finds this interesting or may have started on these subjects?
> Bill> OK, so I'm fishing for encouragement here. ;-)
>
>To very loosely paraphrase the late (some would say great) Johnny Cochran:
>
>
> Ian Bicking:
> Instead you get set([2, 3, 5, 7]), which is much less attractive and
> introduces an unneeded intermediate data structure. Or set((2, 3, 5,
> 7))... which is typographically prettier, but probably more confusing to
> a newbie.
>
> Generator comprehensions + dict() were a nice alte
> > Guido:
> > sense that {F(x) for x in S if P(x)}, ough to be valid syntax if we
> > support {1, 2, 3} -- IOW the form {} should mean the same as
> > set().
> Alex:
> I dislike that as much as I dislike [] as a shorthand for
> list(), but I have no trouble admitting that if we have the
> [...] f
On Apr 24, 2006, at 6:35 PM, Greg Wilson wrote:
>> Ian Bicking:
>> Instead you get set([2, 3, 5, 7]), which is much less attractive and
>> introduces an unneeded intermediate data structure. Or set((2, 3, 5,
>> 7))... which is typographically prettier, but probably more
>> confusing to
>> a ne
While observing heated discussions about adaption and generic functions
I wonder if this
is a good opportunity for a modest complaint about the castration of
__getattr__ in new style classes.
What are you doing if you want to adapt a new style class X to a class
that has implemented
e.g. __add__
Kay Schluehr wrote:
> While observing heated discussions about adaption and generic functions
> I wonder if this
> is a good opportunity for a modest complaint about the castration of
> __getattr__ in new style classes.
If you want to get full control back, that's what __getattribute__ is for. .
51 matches
Mail list logo