Re: [Python-3000] Set literal

2008-01-25 Thread Mark Summerfield
On 2008-01-25, Steven Bethard wrote: > On Jan 25, 2008 12:18 AM, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > On 2008-01-25, Guido van Rossum wrote: > > > For the record, I'm thinking Raymond has won this argument fair and > > > square, and I'm withd

Re: [Python-3000] Set literal

2008-01-24 Thread Mark Summerfield
n set {1, 2} # 2 item frozen set {:} # empty dict {1:1} # 1 item dict {1:1, 2:2} # 2 item dict -- Mark Summerfield, Qtrac Ltd., www.qtrac.eu ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailma

Re: [Python-3000] Need closure on __cmp__ removal

2008-01-09 Thread Mark Summerfield
_(self, other)) return cls The reason for the ugly hasattr() calls is that object itself defines the comparison operators (in Python 3.0a2). -- Mark Summerfield, Qtrac Ltd., www.qtrac.eu ___ Python-3000 mailing list Python-3000@python.org http://mail.py

Re: [Python-3000] the right way to open text files in P3K?

2007-12-14 Thread Mark Summerfield
On 2007-12-14, Christian Heimes wrote: > Mark Summerfield wrote: > > Hi, > > > > I was wondering if it is yet known what the right way to open text files > > in P3K will be? > > > > According to the docs the signature for open() is: > > > >

[Python-3000] the right way to open text files in P3K?

2007-12-13 Thread Mark Summerfield
ified) and bytes if "b" is present? Or will the signature change to match the one provided by codecs? codecs.open(filename, mode[, encoding[, errors[, buffering]]]) using the logic described above regarding mode? Or some other way? Thanks! -- Mark Summerfield, Qtra

[Python-3000] poss bug in IDLE 30a1 in Python 30a2

2007-12-10 Thread Mark Summerfield
line 398, in __init__ self.add_page(name) File "/home/mark/opt/python30a2/lib/python3.0/idlelib/tabbedpages.py", line 413, in add_page self._tab_set.add_tab(page_name) File "/home/mark/opt/python30a2/lib/python3.0/idlelib/tabbedpages.py", line 76, in add_tab se

Re: [Python-3000] str.format() -- poss. code or doc bug?

2007-11-30 Thread Mark Summerfield
On 2007-11-30, Guido van Rossum wrote: > On Nov 30, 2007 8:08 AM, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > Your reply seems to imply that Python 3 will have 3 different and > > overlapping ways of formatting strings: %, str.format(), and > > string.Template. If

Re: [Python-3000] str.format() -- poss. code or doc bug?

2007-11-30 Thread Mark Summerfield
On 2007-11-30, Eric Smith wrote: > Mark Summerfield wrote: > > Hi, > > > > I'm using Python 30a. > > > > The docs for str.format()'s 'g' format say > > "General format. This prints the number as a fixed-point number, > &g

[Python-3000] str.format() -- poss. code or doc bug?

2007-11-30 Thread Mark Summerfield
ent is greater than -4 or less than precision, decimal format otherwise." There is no "decimal format", but there is "Signed integer decimal" format which is what seems to being used. So is this a doc bug? BTW I notice that deci

Re: [Python-3000] Trying to understand Python 3's comparisons

2007-11-21 Thread Mark Summerfield
is possible to do so. I'll write myself a class decorator that can create the "missing" comparisons using logical equivalences. Thanks! > -jJ > > On 11/16/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I'm trying to understan

[Python-3000] Trying to understand Python 3's comparisons

2007-11-15 Thread Mark Summerfield
=>. Bear in mind that for class Eq I only defined ==, Python 3 created != for me; similarly for class Lt I defined < and Python created >. Or is my code for LtEq wrong? I know it isn't a problem creating a class decorator or metaclass to "complete" LtEq; I'm just tryi

Re: [Python-3000] PEP 3101 suggested corrections

2007-10-26 Thread Mark Summerfield
On 2007-10-26, Guido van Rossum wrote: > 2007/10/26, Oleg Broytmann <[EMAIL PROTECTED]>: > > On Fri, Oct 26, 2007 at 09:48:28AM -0400, Chris Monson wrote: > > [quoting Mark Summerfield] > > > > 'd' - Decimal Integer. Outputs the number in b

[Python-3000] Small renaming suggestion: re.sub() -> re.replace() or re.substitute()

2007-10-05 Thread Mark Summerfield
I think re.replace() is better and more consistent regarding the rest of the library. And as for subn, well, replacen or substituten are possible, but why not have just one method and have an optional keyword argument if a tuple is wanted? -- Ma

[Python-3000] Are strs sequences of characters or disguised byte strings?

2007-10-02 Thread Mark Summerfield
{'C\u0327': 2, '\xc7': 1} >>> for k, v in d.items(): ... print(k, v) ... Ç 2 Ç 1 I think this is surprising. >>> s = {c1, c2} >>> s {'C\u0327', '\xc7'} >>> for x in s: ... pri

Re: [Python-3000] ordered dict for p3k collections?

2007-09-26 Thread Mark Summerfield
On 2007-09-26, Guido van Rossum wrote: > On 9/26/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > On 2007-09-26, [EMAIL PROTECTED] wrote: > > > Mark> I have put a new version (incorporating another > > > implementation Mark> idea from Paul Hank

Re: [Python-3000] ordered dict for p3k collections?

2007-09-26 Thread Mark Summerfield
rted data structures are used far more frequently than the unsorted versions. If you primarily program in Python, using dict + sorted() is very natural because they are built into the language. But using a sorted data structure and never sorting is a very common practice in other

Re: [Python-3000] ordered dict for p3k collections?

2007-09-26 Thread Mark Summerfield
On 2007-09-26, Mike Klaas wrote: > On 25-Sep-07, at 2:01 PM, Mark Summerfield wrote: > > On 2007-09-25, Guido wrote: > >> For that to happen, someone has to write a production-quality > >> implementation, release it as a separate 3rd party module for a > >> whil

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Mark Summerfield
On 2007-09-25, you wrote: > On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > My proposal was for the sorteddict to be put in the collections module, > > not as a builtin. One of the things I particularly like about Python is > > that the core language is smal

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Mark Summerfield
On 2007-09-25, Guido van Rossum wrote: > On 9/25/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > I can understand your personal preference for dict, although mine is for > > sorteddict---but IMO Python should provide both since both are > > legitimate in appropriate

Re: [Python-3000] ordered dict for p3k collections?

2007-09-25 Thread Mark Summerfield
omp.lang.python with subject: sorteddict PEP proposal [started off as orderedict] If there is a positive response I will submit it to the PEP editors. If there is not, I will just hope that someone else will pick up the idea, even if in another form or with a different API, because I'

Re: [Python-3000] ordered dict for p3k collections?

2007-09-14 Thread Mark Summerfield
. I'm happy to do that (at least for a sorteddict), but if someone who has done PEPs before did so, I'd be just as happy---I'll see what the feedback is (if any) when I get online again next week. PS And no, I've never programmed in PHP and never fancied doing so:-) -- Mar

Re: [Python-3000] ordered dict for p3k collections?

2007-09-14 Thread Mark Summerfield
On 2007-09-14, Adam Olsen wrote: > On 9/14/07, Mark Summerfield <[EMAIL PROTECTED]> wrote: > > On 2007-09-14, Nicko van Someren wrote: > > > On 11 Sep 2007, at 15:06, Mark Summerfield wrote: > > > > Is there any chance that an ordered dict will be

Re: [Python-3000] ordered dict for p3k collections?

2007-09-14 Thread Mark Summerfield
On 2007-09-14, Nicko van Someren wrote: > On 11 Sep 2007, at 15:06, Mark Summerfield wrote: > > Is there any chance that an ordered dict will be added to Python 3's > > library? > > It would make sense, since one of the primary justifications for the > new metaclass

[Python-3000] ordered dict for p3k collections?

2007-09-11 Thread Mark Summerfield
also pure Python). I would suppose that it would be better if it was implemented in C---for example, my own pure Python ordered dict takes about eight times as long to load in 18,000 items compared with loading the same into a dict. -- Mark Summerfield, Qtrac Ltd., ww

Re: [Python-3000] abc docs

2007-09-05 Thread Mark Summerfield
ing though? -- Forwarded Message -- Subject: Re: [Python-3000] abc docs Date: 2007-09-05 From: Mark Summerfield <[EMAIL PROTECTED]> To: python-3000@python.org [snip] BTW When I tried a variation of one of the ABC examples from the PEP I got this: Python 3.0a1 (py3k, Sep

Re: [Python-3000] abc docs

2007-09-05 Thread Mark Summerfield
26 (Red Hat 4.1.2-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from abc import ABCMeta >>> class MyABC(metaclass=ABCMeta): pass ... >>> MyABC.register(tuple) >&