Re: [Python-Dev] OS X Installer for 3.0.1 and supported versions

2009-02-14 Thread Alex Martelli
On Sat, Feb 14, 2009 at 3:22 AM, Ned Deily wrote: ... > have done complete and thorough testing. (In particular, I have no > access to a G5 for 64-bit PPC testing.) I have a PowerMac G5 at home and I'll be glad to run tests if it helps. (It runs 10.5: "family pack" licenses are cheap, so I'v

Re: [Python-Dev] And the winner is...

2009-03-31 Thread Alex Martelli
On Tue, Mar 31, 2009 at 5:42 PM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Stephen J. Turnbull wrote: > > > I also just wrote a long post about the comparison of bzr to hg > > responding to a comment on baz...@canonical.com. I won't recap it > > here but it might b

Re: [Python-Dev] And the winner is...

2009-03-31 Thread Alex Martelli
On Tue, Mar 31, 2009 at 5:42 PM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Stephen J. Turnbull wrote: > > > I also just wrote a long post about the comparison of bzr to hg > > responding to a comment on baz...@canonical.com. I won't recap it > > here but it might b

Re: [Python-Dev] And the winner is...

2009-03-31 Thread Alex Martelli
On Tue, Mar 31, 2009 at 6:33 PM, Alexandre Vassalotti wrote: ... > html > https://lists.ubuntu.com/archives/bazaar/2009q1/055872.html > Perfect, thanks! Alex ___ Python-Dev mailing list

Re: [Python-Dev] And the winner is...

2009-03-31 Thread Alex Martelli
On Tue, Mar 31, 2009 at 6:33 PM, Alexandre Vassalotti wrote: ... > html > https://lists.ubuntu.com/archives/bazaar/2009q1/055872.html > Perfect, thanks! Alex ___ Python-Dev mailing list

Re: [Python-Dev] Possible py3k io wierdness

2009-04-05 Thread Alex Martelli
On Sun, Apr 5, 2009 at 3:54 PM, Nick Coghlan wrote: > Antoine Pitrou wrote: > > James Y Knight fuhm.net> writes: > >> It seems that a separate method "_internal_close" should've been > >> defined to do the actual closing of the file, and the close() method > >> should've been defined on the base

Re: [Python-Dev] Python3 and arm-linux

2009-04-23 Thread Alex Martelli
On Thu, Apr 23, 2009 at 11:21 AM, cyberGn0m wrote: > Somebody knowns, is python3 works on arm-linux. Is it possible to build it? > Where to find related discussions? Maybe some special patches already > available? Should i try to get sources from svn or get known version > snapshot? > I haven't

Re: [Python-Dev] multi-with statement

2009-05-02 Thread Alex Martelli
FWIW, I prefer Fredrik's wish too. Alex On Sat, May 2, 2009 at 12:26 PM, Fredrik Johansson < fredrik.johans...@gmail.com> wrote: > On Sat, May 2, 2009 at 9:01 PM, Georg Brandl wrote: > > Hi, > > > > this is just a short notice that Mattias Brändström and I have finished a > > patch to implement

Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-07 Thread Alex Martelli
2009/8/7 Kristján Valur Jónsson : > Unless I am very much mistaken, this is the approach Ruby takes. > Everything is an expression.  For example, the value of a block is the value > of > The last expression in the block. > > I've never understood the need to have a distinction betwen statements an

Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-24 Thread Alex Martelli
Next(s) would seem good... Alex Sent from my iPhone On Oct 24, 2009, at 6:47 PM, John Arbash Meinel > wrote: Adam Olsen wrote: On Fri, Oct 23, 2009 at 11:04, Vitor Bosshard wrote: I see this as being useful for frozensets as well, where you can't get an arbitrary element easily due to

Re: [Python-Dev] ctypes and win64

2006-08-20 Thread Alex Martelli
On Aug 19, 2006, at 3:28 AM, Steve Holden wrote: ... > It's going to be very interesting to see what comes out of the Google > sprints. I am sure the 64-bitters will be out in force, so there'll be Hmmm, we'll be working on our laptops, as is typical of sprints, so I'm not sure how many 64-

Re: [Python-Dev] Can LOAD_GLOBAL be optimized to a simple array lookup?

2006-08-23 Thread Alex Martelli
On Aug 23, 2006, at 2:22 PM, K.S.Sreeram wrote: > Hi all, > > I noticed in Python/ceval.c that LOAD_GLOBAL uses a dictionary lookup, > and was wondering if that can be optimized to a simple array lookup. > > If i'm right there are 3 kinds of name lookups: locals, outer > scopes(closures), and glo

Re: [Python-Dev] [Python-checkins] r51525 - in python/trunk: Lib/test/test_float.py Objects/floatobject.c

2006-08-23 Thread Alex Martelli
On Aug 23, 2006, at 3:29 PM, Thomas Wouters wrote: > > Since Alex isn't on python-dev, forwarding this for his convenience > (he said he wanted to reply.) Thanks! I _am_ on Python-Dev (otherwise couldn't read what you're forwarding here), but not on Python-Checkins (where the discussion w

Re: [Python-Dev] [Python-checkins] r51525 - in python/trunk:Lib/test/test_float.py Objects/floatobject.c

2006-08-23 Thread Alex Martelli
On Aug 23, 2006, at 3:13 PM, [EMAIL PROTECTED] wrote: > Zitat von Tim Peters <[EMAIL PROTECTED]>: > >> Huh. It's been a (mildly controversial, but intentional all the >> same) >> feature that Python tries to raise raise OverflowError on overflowing >> libm operations. Doesn't work all that we

Re: [Python-Dev] weakref enhancements

2006-09-28 Thread Alex Martelli
On 9/28/06, tomer filiba <[EMAIL PROTECTED]> wrote: > > I'm sceptical that these would find use in practice. > > [..] > > Also, I question the utility of maintaining a weakref to a method or > > attribute instead of holding one for the object or class. As long as > > the enclosing object or class

Re: [Python-Dev] Python developers are in demand

2007-10-24 Thread Alex Martelli
On 10/12/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > The problem may be related to the fact that Python is rarely teached at > > school or university. I know no school or university in Germany that is > > teaching Python. > > I teach Python to the first semester, at the Hasso-Plattner-Inst

Re: [Python-Dev] [Python-3000] No releases tonight

2008-03-01 Thread Alex Martelli
On Sat, Mar 1, 2008 at 11:11 AM, Barry Warsaw <[EMAIL PROTECTED]> wrote: ... > > I also propose translations of the shorter text to important languages > > like French, German, Japanese, Portuguese and Spanish. I'm willing to > > help with the German translation. > > Cool, thanks. I'd like

Re: [Python-Dev] C-API status of Python 3?

2008-03-01 Thread Alex Martelli
On Sat, Mar 1, 2008 at 12:14 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: ... > The 3.0 API isn't stable yet. I plan to rename some of the functions > before the first beta is released. Currently the naming schema is too > confusing: > > PyUnicode - str > PyString - bytes > PyBytes - by

Re: [Python-Dev] C-API status of Python 3?

2008-03-02 Thread Alex Martelli
On Sun, Mar 2, 2008 at 10:39 AM, Gregory P. Smith <[EMAIL PROTECTED]> wrote: > > On 3/2/08, Christian Heimes <[EMAIL PROTECTED]> wrote: > > Alex Martelli wrote: > > > Yep, but please do keep the PyUnicode for str and PyString for bytes > > > (as macros/

Re: [Python-Dev] RQST: Master Thesis

2008-03-09 Thread Alex Martelli
Depending on which implementation[s] you want to target, Michal, you should also check out PyPy at http://codespeak.net/pypy/, IronPython at http://www.codeplex.com/IronPython, and Jython at http://www.jython.org/ -- Jython's currently a tad behind the other three, but Sun Microsystems has just ann

Re: [Python-Dev] PEP Proposal: Revised slice objects & lists use slice objects as indexes

2008-03-10 Thread Alex Martelli
On Mon, Mar 10, 2008 at 3:57 AM, Forrest Voight <[EMAIL PROTECTED]> wrote: > > I am not sure what you are trying to propose here. The slice object > > isn't special, it's just a regular built-in type. > > The idea is to have slice objects be generators. You could make a > slice like 1:10:2 ,

Re: [Python-Dev] Improved thread switching

2008-03-19 Thread Alex Martelli
Hmmm, sorry if I'm missing something obvious, but, if the occasional background computations are sufficiently heavy -- why not fork, do said computations in the child thread, and return the results via any of the various available IPC approaches? I've recently (at Pycon, mostly) been playing devil

Re: [Python-Dev] Decimal(unicode)

2008-03-25 Thread Alex Martelli
On Tue, Mar 25, 2008 at 9:43 AM, Nick Coghlan <[EMAIL PROTECTED]> wrote: ... > Since we have some strong use cases at least for the bytes->int case, > consistency then suggests that the other numeric types should all accept > bytes as well (interpreting them as ASCII encoded strings). +1 --

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Alex Martelli
On Fri, May 2, 2008 at 4:11 PM, Jesse Noller <[EMAIL PROTECTED]> wrote: > +1 from me +2 from me -- of all abuses of lambdas, this one's the worst. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-03 Thread Alex Martelli
On Fri, May 2, 2008 at 11:32 PM, Mike Klaas <[EMAIL PROTECTED]> wrote: ... > Sorry, that was a bad example. It is obviously silly if the return value > of the function is callable. ...and yet it's *exactly* what keeps happening to lambda-happy programmers -- in production code as well as exam

Re: [Python-Dev] [Python-3000] Invitation to try out open source code review tool

2008-05-03 Thread Alex Martelli
On Sat, May 3, 2008 at 2:28 PM, Brett Cannon <[EMAIL PROTECTED]> wrote: ... > > I'd be great to integrate this with the bug tracker so that all submitted > > patches automagically show up in codereview with links to one another. > > Yeah, or a simple button to move it over there. Either way

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-04 Thread Alex Martelli
On Sun, May 4, 2008 at 3:31 AM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: ... > for k,g in groupby(iterable, key=lambda r: (r[0].lower(), r[5].lower())): > ... > lastname_firstname = lambda r: (r[0].lower(), r[5].lower()) > for k, g in groupby(iterable, key=lastname_firstname): ... >

Re: [Python-Dev] Conditional For Statements

2008-05-19 Thread Alex Martelli
On Mon, May 19, 2008 at 5:33 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... import this > The Zen of Python, by Tim Peters > ... > There should be one-- and preferably only one --obvious way to do it. > > There should be ONE OBVIOUS way to do it, not "only one way". The "only one way"

Re: [Python-Dev] Addition of "pyprocessing" module to standard lib.

2008-05-21 Thread Alex Martelli
On Wed, May 21, 2008 at 1:53 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > This thread has diverged a bit from the original topic. > > I suggest going ahead and adding pyprocessing to the library. > IMO, its functionality is going to be an essential capability as > more and more computers ship

Re: [Python-Dev] Mini-Pep: Simplifying the Integral ABC

2008-06-06 Thread Alex Martelli
On Fri, Jun 6, 2008 at 11:01 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On Thu, Jun 5, 2008 at 8:45 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> Does anyone actually need an int lookalike with binary methods but >> cannot just inherit from int? > > Does anyone actually need an int loo

Re: [Python-Dev] Assignment to None

2008-06-09 Thread Alex Martelli
The problem is more general: what if a member (of some external object we're proxying one way or another) is named print (in Python < 3), or class, or...? To allow foo.print or bar.class would require pretty big changes to Python's parser -- I have vague memories that the issue was discussed ages

Re: [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

2008-06-14 Thread Alex Martelli
Yep. Javascript's totally botched and unusable 'with' statement is an excellent warning of what horrors that kind of thing can wreck in a dynamic language unless carefully designed. I also agree that .foo is a good disambiguation syntax -- unfortunately it doesn't disambiguate among *nested* with

Re: [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

2008-06-14 Thread Alex Martelli
On Sat, Jun 14, 2008 at 1:24 PM, Simon Cross <[EMAIL PROTECTED]> wrote: > On Sat, Jun 14, 2008 at 10:19 PM, Cesare Di Mauro <[EMAIL PROTECTED]> wrote: >> from Tkinter import * > > I discourage this too. :) And so do I, every single time I teach Python (which is pretty often, even though many of th

Re: [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

2008-06-15 Thread Alex Martelli
+1 on updating the FAQ. Maybe we could even have it notice that a read-only version of the desired semantic for 'with' is easily hacked with the *current* semantic of 'with'...: @contextlib.contextmanager def readonly(anobj): caller_globals = sys._getframe(2).f_globals saved_globals = cal

Re: [Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

2008-06-18 Thread Alex Martelli
On Wed, Jun 18, 2008 at 9:58 PM, Cesare Di Mauro <[EMAIL PROTECTED]> wrote: > Very very, interesting. Thanks. :) > > Somebody thinks that Python is unsuitable to implement a DSL: IMO your > example prove the contrary. :D As long as you're willing to do the "DSL" within the strictures of Python sy

Re: [Python-Dev] [Python-checkins] r64424 - inpython/trunk:Include/object.h Lib/test/test_sys.pyMisc/NEWSObjects/intobject.c Objects/longobject.cObjects/typeobject.cPython/bltinmodule.c

2008-06-28 Thread Alex Martelli
On Sat, Jun 28, 2008 at 4:46 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > From: "Mark Dickinson" <[EMAIL PROTECTED]> >> >> There's one other major difference between the C99 notation and the >> current patch: the C99 notation includes a (hexa)decimal point. The >> advantages of this include

Re: [Python-Dev] assertRaises

2008-07-17 Thread Alex Martelli
On Thu, Jul 17, 2008 at 2:54 AM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: > > I said: >> Let's just make assertRaises return the exception instance, it seems like it >> feels the need correctly. > > and I meant "fills", not "feels", obviously... +1 : enriching the existing method in a way that's

Re: [Python-Dev] fileobj.read(float): warning or error?

2008-07-21 Thread Alex Martelli
I thought that's what we had __index__ for -- reject arguments that don't SMOOTHLY turn into integers when an integer is actually required! Alex On Mon, Jul 21, 2008 at 10:01 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> Well, the real problem is os.urandom(4.2) which goes to an unlimited

Re: [Python-Dev] Things to Know About Super

2008-08-26 Thread Alex Martelli
On Tue, Aug 26, 2008 at 6:16 PM, Michele Simionato <[EMAIL PROTECTED]> wrote: ... > It is just a matter of how rare the use cases really are. Cooperative > methods has been introduced 6+ years ago. In all this time surely > they must have been used. How many compelling uses of cooperation > we c

Re: [Python-Dev] Things to Know About Super

2008-08-27 Thread Alex Martelli
On Tue, Aug 26, 2008 at 10:24 PM, Michele Simionato <[EMAIL PROTECTED]> wrote: ... > .. code-block:: python > > def include_mixin(mixin, cls): # could be extended to use more mixins > # traits as in Squeak take the precedence over the base class > dic = vars(mixin).copy() # could be ext

Re: [Python-Dev] FreeBSD 7 amd64 and large memory tests

2008-09-17 Thread Alex Martelli
Unbelievable as this may seem, this crazy over-committing malloc behavior is by now "a classic" -- I first fought against it in 1990, when IBM released AIX 3 for its then-new RS/6000 line of workstations; in a later minor release they did provide a way to optionally switch this off, but, like on Li

Re: [Python-Dev] json decoder speedups, any time left for 2.6?

2008-09-24 Thread Alex Martelli
Meanwhile, can you please release (wherever you normally release things;-) the pure-Python version as well? I'd like to play around with it in Google App Engine opensource sandboxes (e.g., cfr. gae-json-rest -- I'll be delighted to add you to that project if you want of course;-) and that requires

Re: [Python-Dev] My patches

2008-11-02 Thread Alex Martelli
On Sun, Nov 2, 2008 at 5:42 AM, Barry Warsaw <[EMAIL PROTECTED]> wrote: ... > A dvcs means that people can publish their branches in a wide variety of > ways. Trusted developers can push their branches to code.python.org. > Non-core developers can use one of the free public dvcs branch hosting

Re: [Python-Dev] __import__ problems

2008-11-28 Thread Alex Martelli
On Fri, Nov 28, 2008 at 9:47 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 29 Nov 2008 03:30:49 am Christian Heimes wrote: > ... >> May I point you to the two leading underscores? The name '__import__' >> clearly suggests that the function is part of Python's internals. By >> definition

Re: [Python-Dev] Attribute error: providing type name

2008-11-30 Thread Alex Martelli
On Sun, Nov 30, 2008 at 2:02 PM, Filip Gruszczyński <[EMAIL PROTECTED]> wrote: >> Yeah, any time someone implements their own attribute lookup process for >> a class (be it via __getattr__, __getattribute__ or the C equivalents), >> it is up to the reimplementation to appropriately format their err

Re: [Python-Dev] Attribute error: providing type name

2008-12-01 Thread Alex Martelli
I wonder if there's some desiderata left for future Python versions to make this standard behavior easier (for C-coded, Python-coded, and Cython-coded classes, ones made by SWIG, etc) without too much black magic... Alex On Mon, Dec 1, 2008 at 1:30 AM, Filip Gruszczyński <[EMAIL PROTECTED]> wrote

Re: [Python-Dev] Please help complete the AST branch

2005-01-04 Thread Alex Martelli
On 2005 Jan 04, at 17:17, Jeremy Hylton wrote: That's fine with me. We had taken it to the compiler-sig when it wasn't clear there was interest in the ast branch :-). Speaking for myself, I have a burning interest in the AST branch (though I can't seem to get it correctly downloaded so far, I gue

Re: [Python-Dev] Let's get rid of unbound methods

2005-01-05 Thread Alex Martelli
On 2005 Jan 05, at 04:42, Barry Warsaw wrote: On Tue, 2005-01-04 at 18:01, Jack Jansen wrote: But I'm more worried about losing the other information in an unbound method, specifically im_class. I would guess that info is useful to class browsers and such, or are there other ways to get at that? Th

Re: [Python-Dev] 2.3.5 schedule, and something I'd like to get in

2005-01-05 Thread Alex Martelli
On 2005 Jan 05, at 00:06, Jack Jansen wrote: ... We've solved this issue for the trunk and we can solve it for 2.4.1: if MACOSX_DEPLOYMENT_TARGET isn't set and we're on 10.3 we force it to 10.3. Moreover, when it is 10.3 or higher (possibly after being forced) we use the dynamic_lookup way of

Re: [Python-Dev] Please help complete the AST branch

2005-01-05 Thread Alex Martelli
On 2005 Jan 04, at 22:11, Brett C. wrote: ... Speaking for myself, I have a burning interest in the AST branch (though I can't seem to get it correctly downloaded so far, I guess it's just my usual CVS-clumsiness and I'll soon find out what I'm doing wrong & fix it) See http://www.python

Re: [Python-Dev] 2.3.5 schedule, and something I'd like to get in

2005-01-05 Thread Alex Martelli
On 2005 Jan 05, at 12:40, Ronald Oussoren wrote: ... The Tiger that was released at WWDC included a patched version of Python 2.3.3. See: http://www.opensource.apple.com/darwinsource/WWDC2004/. Thanks! So, since WWDC was on June 28 and 2.3.4 had been released on May 27, we get some first sen

Re: [Python-Dev] an idea for improving struct.unpack api

2005-01-06 Thread Alex Martelli
On 2005 Jan 06, at 06:27, Ilya Sandler wrote: ... We could have an optional offset argument for unpack(format, buffer, offset=None) I do agree on one concept here: when a function wants a string argument S, and the value for that string argument S is likely to come from some other bigger strin

Re: [Python-Dev] Re: super() harmful?

2005-01-06 Thread Alex Martelli
On 2005 Jan 06, at 20:16, Terry Reedy wrote: "James Y Knight" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Please notice that I'm talking about concrete, real issues, not just a "super is bad!" rant. Umm, James, come on. Let's be really real and concrete ;-). Your title "Python's Su

Re: [Python-Dev] Re: [Csv] Minor change to behaviour of csv module

2005-01-07 Thread Alex Martelli
On 2005 Jan 07, at 14:45, Michael Chermside wrote: Andrew explains that in the CSV module, escape characters are not properly removed. Magnus writes: IMO this is the *only* reasonable behaviour. I don't understand why the escape character should be left in; this is one of the reason why UNIX-style

[Python-Dev] PEP 246, redux

2005-01-10 Thread Alex Martelli
quot;under his own name"! Thanks, Alex PEP: 246 Title: Object Adaptation Version: $Revision: 1.6 $ Author: [EMAIL PROTECTED] (Alex Martelli), [EMAIL PROTECTED] (Clark C. Evans) Status: Draft Type: Standards Track Created: 21-Mar-2001 Python-Version: 2.5 Post-History: 29-Mar-2001, 10-Jan-20

Re: [Python-Dev] PEP 246, redux

2005-01-10 Thread Alex Martelli
On 2005 Jan 10, at 18:43, Phillip J. Eby wrote: ... At 03:42 PM 1/10/05 +0100, Alex Martelli wrote: The fourth case above is subtle. A break of substitutability can occur when a subclass changes a method's signature, or restricts the domains accepted for a method's arg

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
The volume of these discussions is (as expected) growing beyond any reasonable bounds; I hope the BDFL can find time to read them but I'm starting to doubt he will. Since obviously we're not going to convince each other, and it seems to me we're at least getting close to pinpointing our differ

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 10, at 23:19, Phillip J. Eby wrote: ... As I said, after more thought, I'm actually less concerned about the performance than I am about even remotely encouraging the combination of Liskov violation *and* concrete adaptation As per other msg, abstract classes have just the same iss

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 10, at 23:15, Thomas Heller wrote: Alex Martelli <[EMAIL PROTECTED]> writes: PEP: 246 Title: Object Adaptation Minor nit (or not?): You could provide a pointer to the Liskov substitution principle, for those reader that aren't too familiar with that term. Excellent i

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 10, at 19:34, Phillip J. Eby wrote: ... IMO it's more desirable to support abstract base classes than to allow classes to "opt out" of inheritance when testing conformance to a base class. If you don't have an "is-a" relationship to your base class, you should be using delegation

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 10, at 18:59, Phillip J. Eby wrote: At 12:43 PM 1/10/05 -0500, Phillip J. Eby wrote: As a practical matter, all of the existing interface systems (Zope, PyProtocols, and even the defunct Twisted implementation) treat interface inheritance as guaranteeing substitutability for the base

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 11:01, Alex Martelli wrote: On 2005 Jan 10, at 18:59, Phillip J. Eby wrote: At 12:43 PM 1/10/05 -0500, Phillip J. Eby wrote: As a practical matter, all of the existing interface systems (Zope, PyProtocols, and even the defunct Twisted implementation) treat interface

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 16:34, Phillip J. Eby wrote: ... Anyway, I agree that your version of the code should be used to form the reference implementation, since the purpose of the reference implementation is to show the complete required semantics. Great, one point at last on which we fully agree

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 18:27, Michael Chermside wrote: ... ... but in my world, people violate Liskov all the time, even in languages that attempt (unsuccessfully) to enforce it. [1] ... [1] - Except for Eiffel. Eiffel seems to do a pretty good job of enforcing it. ...has Eiffel stopped its he

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 20:44, Phillip J. Eby wrote: ... If we're just recomending that people design for transitivity, then I don't have a problem (although see Alex's fairly good point illustrated with LotsOfInfo, PersonName, and FullName -- I found it convincing). It's a bit misleading, however;

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 20:48, Phillip J. Eby wrote: ... I'd rather not assume that class inheritance implies substitutability, Hm, you should take that up with Alex then, since that is what his current PEP 246 draft does. :) Actually, the earlier drafts did that too, so I'm not sure why you want

Re: [Python-Dev] copy confusion

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 23:20, Fredrik Lundh wrote: back in Python 2.1 (and before), an object could define how copy.copy should work simply by definining a __copy__ method. here's the relevant portion: ... try: copierfunction = _copy_dispatch[type(x)] except KeyError: tr

Re: [Python-Dev] copy confusion

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 23:39, Phillip J. Eby wrote: ... cls = type(x) copier = _copy_dispatch.get(cls) if copier: return copier(x) ... this a bug, or a feature of the revised copy/pickle design? Looks like a bug to me; it breaks the behavior of classic classes, since type(cla

Re: [Python-Dev] copy confusion

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 23:58, Guido van Rossum wrote: ... cls = type(x) copier = _copy_dispatch.get(cls) if copier: return copier(x) ... is this a bug, or a feature of the revised copy/pickle design? [Phillip] Looks like a bug to me; it breaks the behavior of classic classes,

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
On 2005 Jan 11, at 22:08, Phillip J. Eby wrote: ... Yes, you're ALLOWED to stuff with NULL any field that isn't explicitly specified as NOT NULL. But you should ONLY do so when the information is REALLY missing, NOT when you've lost it along the way because you've implemented adapter-chain t

getting special from type, not instance (was Re: [Python-Dev] copy confusion)

2005-01-12 Thread Alex Martelli
Since this bug isn't the cause of Fredrik's problem I'm changing the subject (and keep discussing the specific problem that Fredrik uncovered under the original subject). On 2005 Jan 12, at 05:11, Guido van Rossum wrote: ... I had exactly the same metabug in the pep 246 reference implementat

Re: [Python-Dev] Re: copy confusion

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 00:30, Fredrik Lundh wrote: Guido van Rossum wrote: The only thing this intends to break /.../ it breaks classic C types: True!!! And it only breaks copy, NOT deepcopy, because of the following difference between the two functions in copy.py...: def deepcopy(x, memo=None, _nil

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 14:44, Paul Moore wrote: On Wed, 12 Jan 2005 00:33:22 +0100, Alex Martelli <[EMAIL PROTECTED]> wrote: But adaptation is not transmission! It's PERFECTLY acceptable for an adapter to facade: to show LESS information in the adapted object than was in the orig

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 15:00, Paul Moore wrote: On Wed, 12 Jan 2005 00:33:22 +0100, Alex Martelli <[EMAIL PROTECTED]> wrote: By imposing transitivity, you're essentially asserting that, if a programmer forgets to code and register an A -> C direct adapter, this is never a problem, as

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 16:12, Phillip J. Eby wrote: At 02:27 PM 1/12/05 +, Mark Russell wrote: I strongly prefer *not* to have A->B and B->C automatically used to construct A->C. Explicit is better than implicit, if in doubt don't guess, etc etc. So I'd support: - As a first cut, no automatic

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 16:26, Guido van Rossum wrote: ... [Alex] I'm saying that if, by mistake, the programmer has NOT registered the A->C adapter (which would be easily coded and work perfectly), then thanks to transitivity, instead of a clear and simple error message leading to immediate diagnosi

Re: getattr and __mro__ (was Re: [Python-Dev] PEP 246, redux)

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 16:44, Thomas Heller wrote: ... conform = getattr(type(obj), '__conform__', None) ... I'm confused. Do you mean that getattr(obj, "somemethod")(...) does something different than obj.somemethod(...) with new style class instances? Doesn't getattr search the __dic

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 16:45, Guido van Rossum wrote: My personal POV here: even when you break Liskov in subtle ways, there are lots of situations where assuming substitutability has no ill effects, so I'm happy to pretend that a subclass is always a subtype of all of its base classes, (and their base

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 16:49, Guido van Rossum wrote: [Phillip] As for the issue of what should and shouldn't exist in Python, it doesn't really matter; PEP 246 doesn't (and can't!) *prohibit* transitive adaptation. Really? Then isn't it underspecified? I'd think that by the time we actually implement

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 17:40, Phillip J. Eby wrote: At 04:36 PM 1/12/05 +0100, Alex Martelli wrote: I already know -- you told us so -- that if I had transitivity as you wish it (uncontrollable, unstoppable, always-on) I could not any more write and register a perfectly reasonable adapter which

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 18:58, Phillip J. Eby wrote: ... I have some data about people coming in from LDAP and the like, which I want to record in that SQL DB -- the incoming data is held in types that implement IPerson, so I write an adapter IPerson -> IFullname for the purpose. This doesn't answ

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 19:16, Guido van Rossum wrote: ... [Alex] Hm? I meant if there were multiple A's. For every Ai that has an Ai->B you would also have to register a trivial Ai->C. And if there were multiple C's (B->C1, B->C2, ...) then the number of extra adaptors to register would be the numbe

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 20:06, Phillip J. Eby wrote: At 10:16 AM 1/12/05 -0800, Guido van Rossum wrote: For example, inteface B (or perhaps this should be a property of the adapter for B->C?) might be marked so as to allow or disallow its consideration when looking for multi-step adaptations. We could e

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 20:39, Phillip J. Eby wrote: ... > it's difficult because intuitively an interface defines a *requirement*, so > it seems logical to inherit from an interface in order to add requirements! Yes... I would fall into this trap as well until I'd been burned a few times. It's b

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Alex Martelli
On 2005 Jan 12, at 20:51, Phillip J. Eby wrote: ... There's a very simple reason. If one is using only non-noisy adapters, there is absolutely no reason to ever define more than one adapter between the *same* two points. If you do, ...but there's no harm whatsoever done, either. If I have f

Re: [Python-Dev] Re: PEP 246: LiskovViolation as a name

2005-01-13 Thread Alex Martelli
On 2005 Jan 13, at 02:18, Phillip J. Eby wrote: At 05:54 PM 1/12/05 -0700, Steven Bethard wrote: Not that my opinion counts for much =), but returning None does seem much simpler to me. I also haven't seen any arguments against this route of handling protocol nonconformance... Is there a particul

Re: [Python-Dev] Son of PEP 246, redux

2005-01-13 Thread Alex Martelli
On 2005 Jan 13, at 03:57, Phillip J. Eby wrote: Okay, I'm really out of time now. Hate to dump this in as a possible spoiler on PEP 246, because I was just as excited as Alex about the possibility of it going in. But this whole debate has made me even less enamored of adaptation, and more inte

Re: getting special from type, not instance (was Re: [Python-Dev] copy confusion)

2005-01-13 Thread Alex Martelli
On 2005 Jan 12, at 18:59, Guido van Rossum wrote: ... [Alex] Armin's fix was to change: ... [And then proceeds to propose a new API to improve the situation] I wonder if the following solution wouldn't be more useful (since less code will have to be changed). The descriptor for __getattr__ an

Re: [Python-Dev] PEP 246, redux

2005-01-13 Thread Alex Martelli
On 2005 Jan 12, at 21:42, Phillip J. Eby wrote: ... Anyway, hopefully this post and the other one will be convincing that considering ambiguity to be an error *reinforces* the idea of I-to-I perfection, rather than undermining it. (After all, if you've written a perfect one, and there's alre

Re: [Python-Dev] PEP 246, redux

2005-01-13 Thread Alex Martelli
On 2005 Jan 13, at 15:34, Clark C. Evans wrote: ... The 'implicit' adaptation refers to the automagical construction of composite adapters assuming that a 'transitive' property holds. I've seen nothing in this thread to explain why this is so valueable, why Let me play devil's advocate: I _have_

Re: [Python-Dev] PEP 246, redux

2005-01-13 Thread Alex Martelli
On 2005 Jan 13, at 16:08, Phillip J. Eby wrote: this with their string/file/path discussions -- *nobody* is safe from implicit adaptation if adaptation actually creates new objects with independent state! An adapter's state needs to be kept with the original object, or not at all, and most of t

Re: [Python-Dev] PEP 246, redux

2005-01-13 Thread Alex Martelli
On 2005 Jan 13, at 16:13, Carlos Ribeiro wrote: ... +1, specially for the last sentence. An adapter with local state is not an adapter anymore! It's funny how difficult it's to get this... but it's obvious once stated. ...? A StringIO instance adapting a string to be used as a readablefile is

Re: getting special from type, not instance (was Re: [Python-Dev] copy confusion)

2005-01-13 Thread Alex Martelli
On 2005 Jan 13, at 18:02, Guido van Rossum wrote: ... In all cases, I'm +1 on seeing built-in method objects (PyMethodDescr_Type) become data descriptors ("classy descriptors?" :-). Let's do override descriptors. A Pronouncement!!! And please, someone fix copy.py in 2.3 and 2.4. Sure -- what wa

Re: [Python-Dev] PEP 246, redux

2005-01-13 Thread Alex Martelli
On 2005 Jan 13, at 19:21, Clark C. Evans wrote: ... Are you _sure_ you have M*N adapters here? But even so, Yep. for j in (J1,J2,J3,J4,...,JM) for i in (I1,I2,...,IN): register(j,i) Uh? WHAT are you registering for each j->i...? The other issue with registries (and why I avoided th

Re: [Python-Dev] PEP 246, redux

2005-01-13 Thread Alex Martelli
On 2005 Jan 13, at 22:43, Paramjit Oberoi wrote: On Thu, 13 Jan 2005 20:40:56 +0100, Alex Martelli <[EMAIL PROTECTED]> wrote: So please explain what's imperfect in wrapping a str into a StringIO? If I understand Philip's argument correctly, the problem is this: def print_n

Re: getting special from type, not instance (was Re: [Python-Dev] copy confusion)

2005-01-13 Thread Alex Martelli
On 2005 Jan 14, at 00:11, Guido van Rossum wrote: Let's do override descriptors. A Pronouncement!!! And please, someone fix copy.py in 2.3 and 2.4. Sure -- what way, though? The way I proposed in my last post about it? This would do it, right? (From your first post in this conversation according

Re: [Python-Dev] PEP 246, redux

2005-01-13 Thread Alex Martelli
On 2005 Jan 14, at 04:08, David Ascher wrote: Alex Martelli wrote: Yes, there is (lato sensu) "non-determinism" involved, just like in, say: for k in d: print k Wow, it took more than the average amount of googling to figure out that lato sensu means "broadly s

Re: [Python-Dev] redux: fractional seconds in strptime

2005-01-14 Thread Alex Martelli
On 2005 Jan 14, at 10:36, Skip Montanaro wrote: Brett> The problem I have always had with this proposal is that the Brett> value is worthless, time tuples do not have a slot for fractional Brett> seconds. Yes, it could possibly be changed to return a float for Brett> seconds, but

Re: [Python-Dev] redux: fractional seconds in strptime

2005-01-14 Thread Alex Martelli
On 2005 Jan 14, at 19:11, Aahz wrote: On Fri, Jan 14, 2005, Brett C. wrote: Right, it's a struct_time object; just force of habit to call it a time tuple. And I technically don't see why a fractional second attribute could not be added that is not represented in the tuple. But I personally woul

Re: [Python-Dev] PEP 246: lossless and stateless

2005-01-14 Thread Alex Martelli
On 2005 Jan 14, at 20:25, Clark C. Evans wrote: | Does anyone know of any other languages that take this "operational" | aproach to solving the substitutability problem? Microsoft's COM? I don't see the parallel: COM (QueryInterface) is strictly by-interface, not by-method, and has many other diff

  1   2   3   >