Re: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?

2010-09-24 Thread Jim Fulton
For correctness, if the extension is playing games with reference >> counts Python isn't expecting. > > Yikes :) > >> 2. For speed, if the extension is creating dicts (or tuples) it knows >> cannot participate in cycles. > > The optimization is now automated in

Re: [Python-Dev] Let's update CObject API so it is safe and regular!

2009-04-02 Thread Jim Fulton
On Apr 2, 2009, at 7:28 AM, Greg Ewing wrote: Jim Fulton wrote: The only type-safety mechanism for a CObject is it's identity. If you want to make sure you're using the foomodule api, make sure the address of the CObject is the same as the address of the api object expor

Re: [Python-Dev] Let's update CObject API so it is safe and regular!

2009-04-02 Thread Jim Fulton
Larry's example. Jim -- Jim Fulton Zope Corporation ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Let's update CObject API so it is safe and regular!

2009-04-01 Thread Jim Fulton
he bug tracker: http://bugs.python.org/issue5630 I look forward to your comments! -1 I don't see that this gains anything. 1. All you're adding, afaict is a name for the API and the (address of the) CObject itself already provides this. 2. Only code provided by the module pro

Re: [Python-Dev] My summit notes (packaging)

2009-03-28 Thread Jim Fulton
see some value in this, but I think working at the project level is a lot simpler and more practically useful. Jim -- Jim Fulton Zope Corporation ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Uns

[Python-Dev] Released fixes for CVE-2008-2315 for Python 2.4?

2008-11-07 Thread Jim Fulton
Are there plans for a 2.4 release that includes: http://bugs.python.org/issue2620, and http://svn.python.org/view?rev=65335&view=rev ? These (and other fixes) address: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-2315 Jim -- Jim Fulton Zope Corpora

Re: [Python-Dev] [Python-3000] inst_persistent_id

2008-01-20 Thread Jim Fulton
It doesn't make sense to not call this function for classic instances. This optimization is fairly useful. I propose to update the logic to call this function for classic instances too. I'm also open to renaming it if that would m

[Python-Dev] inst_persistent_id

2008-01-12 Thread Jim Fulton
Recently, I reviewed the documentation source for pickle and came across the following comment: BAW: Both pickle and cPickle support something called inst_persistent_id() which appears to give unknown types a second shot at producing a persistent id. Since Jim Fulton can&#

[Python-Dev] Names matter.

2006-01-16 Thread Jim Fulton
st they matter to me, a *lot*. I don't think members of the PSF should be allowed to hide their identity and certainly, it should not be acceptable to contribute to Python under a false name. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (54

Re: [Python-Dev] timeout options in high-level networking modules

2005-12-22 Thread Jim Fulton
Steve Holden wrote: > Jim Fulton wrote: > >>Yesterday, I needed to make a web request in a program (actually a test) >>that could block indefinately, so I needed to set a socket timeout. >>Unfortunately, AFAICT none of urllib, urllib2, httplib provide options to set >

[Python-Dev] timeout options in high-level networking modules

2005-12-22 Thread Jim Fulton
. I'm happy to work on this *if* I can find time. This would make a nice easy sprint project at PyCon too. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zop

Re: [Python-Dev] Keep default comparisons - or add a second set?

2005-12-20 Thread Jim Fulton
> > Even the recently posted "get rid of default comparisons" use case is > really just an argument to make the canonical ordering work better. > The problem Jim Fulton describes is that the (current default) > canonical order will change if objects are saved to a databa

Re: [Python-Dev] On moving to new-style classes

2005-12-13 Thread Jim Fulton
ly descriptors, which make properties, among other things, possible. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org _

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-13 Thread Jim Fulton
Michael Hoffman wrote: > [Ian Bickling] > >>>stdlib, external modules, internal modules seems like enough >>>ordering to me. > > > [Jim Fulton] > >>Personally, I don't find the stdlib/external distinction to be useful. > > >

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-13 Thread Jim Fulton
Barry Warsaw wrote: > On Sun, 2005-12-11 at 11:20 -0500, Jim Fulton wrote: > > >>This seems outdated. My impression, in part from time spent >>working with the Python Labs guys, is that it is fine to have public >>data sttributes even for non-"record" type

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-13 Thread Jim Fulton
ts" rule for data attributes, but attributes > that cause an object to perform some action should always be explicit > methods. Exactly. That's why I suggested the PEP start with the trivial case, which, BTW is extremely common. Let judgement guide when something is

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-13 Thread Jim Fulton
ovided the necessary methods. A better approach is to document the API for your classes and expect people to use that API. Prepending an underscore documents that a variable or method is internal. (Of course, there's still the subclassing API to deal

[Python-Dev] Import order (was Re: PEP 8 updates/clarifications)

2005-12-13 Thread Jim Fulton
[EMAIL PROTECTED] wrote: ... > This is subjective enough that I would think some rationale explaining this > convention should be given. This is subjective enough that I don't think it should be in the PEP. Sometimes, less is more. JIm -- Jim Fulton mailto:[EMAI

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-13 Thread Jim Fulton
oupings to me. (All of my "internal" modules are in packages.) When scanning imports, I don't want to have to think about whether a module is internal or external. I've got enough to think about without that. :) Frankly, I'd be as happy t see the PEP be silent on

Re: [Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications)

2005-12-13 Thread Jim Fulton
Guido van Rossum wrote: > On 12/12/05, Jim Fulton <[EMAIL PROTECTED]> wrote: > >>In practice, I don't agree that it works fine. Inevitably, someone >>finds a need to access a "private" variable in a subclass. Or >>even in the original cl

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-12 Thread Jim Fulton
gn code changes an object's state. If you provide a property or a pair if accessors that just sets and gets an attribute with a slightly different name, that affords no more protection than if people were setting the attribute directly. If you don't want external code to change an attribu

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-12 Thread Jim Fulton
the accessors are trivial. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Python-Dev mai

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-12 Thread Jim Fulton
P 8 for the minimum practices necessary for > one programmer to be able to read and maintain another programmer's > code. I'm for making the style guide smaller. I do think it offers too much advice in places. Although I'm not sure we could all agree om what those places

Re: [Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications)

2005-12-12 Thread Jim Fulton
mulate the name mangling. Or perhaps someone wants to examine the value of one of these variables in the debugger. In my experience, almost every time someone uses the __private trick, they or someone else comes to regret it. OTOH, explicit name mangling provides the benefits of implicit name m

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-12 Thread Jim Fulton
ty that accessor methods would give you. > > Don't properties only work with new-style clsses? If so, this should > probably be noted. Read properties work with old-style classes. Write properties require old-stype classes. I'm always forgetting this for some reason. Ye

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-11 Thread Jim Fulton
Ian Bicking wrote: > Jim Fulton wrote: > >>> Designing for inheritance >>> >>>Always decide whether a class's methods and instance variables >>>should be public or non-public. In general, never make data >>>v

[Python-Dev] Deprecate __ private (was Re: PEP 8 updates/clarifications)

2005-12-11 Thread Jim Fulton
Ian Bicking wrote: > Jim Fulton wrote: > ... >>>Also decide whether your attributes should be private or not. >>>The difference between private and non-public is that the former >>>will never be useful for a derived class, while the latt

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-11 Thread Jim Fulton
[EMAIL PROTECTED] wrote: >>>>>>"Jim" == Jim Fulton <[EMAIL PROTECTED]> writes: > > > Jim> The decision about wither to implement foo as a key in the instance > Jim> dictionary *is* an implementation detail that can be hidden by a >

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-11 Thread Jim Fulton
e hidden by a property. If the initial decision, following the rule of "do the simplest thing that works", is to use an instance dictionary item, then I wouldn't bother with a property until you change your mind. Jim -- Jim Fulton mailto:[EMAIL PROTECTED]

Re: [Python-Dev] PEP 8 updates/clarifications

2005-12-11 Thread Jim Fulton
ed. FWIW, as a general rule, I like using a single trailing underscore, especially for keywords. It allows the use of meaningful and easy to remember names. When the name of a variable should be "class" or "for" or whatever, it's easy, as a Python programmer, to remembe

Re: [Python-Dev] ElementTree - Why not part of the core? (fwd)

2005-12-08 Thread Jim Fulton
out what's best for a particular situation. > ET > belongs in the standard distribution to create a level playing field for a > module many people feel is superior to the current XML-related modules. > Think of it as Pythonic affirmative action. ;-) I would only think of it as Pytho

Re: [Python-Dev] ElementTree - Why not part of the core? (fwd)

2005-12-08 Thread Jim Fulton
Steve Holden wrote: > Jim Fulton wrote: > [...] > >>I hope that packaging progress will someday make it matter much less >>whether something is in the standard library. >> > > For which we need a *mechanism* that all package providers can > implement, r

Re: [Python-Dev] ElementTree - Why not part of the core? (fwd)

2005-12-08 Thread Jim Fulton
t; That said, I agree that ElementTree would be a valuable addition > to the Python library, and has certainly passed the "collect feedback > in the real world" test. I hope that packaging progress will someday make it matter much less whether something is in the standard library

Re: [Python-Dev] Weak references: dereference notification

2005-11-09 Thread Jim Fulton
is sounds acceptable? Since you can now (as of 2.4) subclass the weakref.ref class, you should be able to do this yourself in Python. See for example, weakref.KeyedRef. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714

Re: [Python-Dev] For Python 3k, drop default/implicit hash, and comparison

2005-11-06 Thread Jim Fulton
Guido van Rossum wrote: > On 11/6/05, Jim Fulton <[EMAIL PROTECTED]> wrote: > ... > Except that I really don't think that there's anything wrong with a > default __eq__ that uses object identity. As Martin pointed out, it's > just too weird that an object wo

[Python-Dev] For Python 3k, drop default/implicit hash, and comparison

2005-11-06 Thread Jim Fulton
comparison. Explicit is better than implicit. :) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://ww

Re: [Python-Dev] Freezing the CVS on Oct 26 for SVN switchover

2005-10-27 Thread Jim Fulton
Jeremy Hylton wrote: > Can anyone point an old CVS/Perforce-Luddite at instructions for how > to use the new SVN repository? And can you remind us where to send our public keys? :) Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 36

Re: [Python-Dev] Comparing date+time w/ just time

2005-10-22 Thread Jim Fulton
date objects or compare date objects to DateTime objects. After all, if the datetime module doesn't allow compatison of date and datetime, why should you try to compare date and DateTime? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (54

Re: [Python-Dev] defaultproperty

2005-10-10 Thread Jim Fulton
Guido van Rossum wrote: > On 10/9/05, Jim Fulton <[EMAIL PROTECTED]> wrote: > >>Based on the discussion, I think I'd go with defaultproperty. > > > Great. > > >>Questions: >> >>- Should this be in builtins, alongside property, or

[Python-Dev] defaultproperty (was: Re: RFC: readproperty)

2005-10-09 Thread Jim Fulton
Based on the discussion, I think I'd go with defaultproperty. Questions: - Should this be in builtins, alongside property, or in a library module? (Oleg suggested propertytools.) - Do we need a short PEP? Jim Jim Fulton wrote: > Guido van Rossum wrote: > >>On 9/28/05, J

Re: [Python-Dev] Pythonic concurrency

2005-10-07 Thread Jim Fulton
an a time-stamp) strategy for ZODB, although ZEO would make this extra challenging. In any case, the important thing to agree on here is that transactions provide a useful approach to concurrency control in the case where - separate control flows are independent, and - we need to mediate access to sha

Re: [Python-Dev] Divorcing str and unicode (no more implicit conversions).

2005-10-03 Thread Jim Fulton
ng a sitecustomize.py module which then call the > sys.setdefaultencoding("undefined"). This is a much more evil trick IMO, as it affects all Python code, rather than a single program. I would argue that it's evil to change the default encoding in the first place, except in thi

Re: [Python-Dev] Divorcing str and unicode (no more implicit conversions).

2005-10-03 Thread Jim Fulton
is > semantically textual, and to only use str for what is to be semantically > treated as a string of bytes (network packets, identifiers...). This is > also, AFAIU, the semantic model which is favoured for a hypothetical > future version of Python. This approach has worked pret

Re: [Python-Dev] Pythonic concurrency

2005-09-29 Thread Jim Fulton
(possibly thousands) of programmers who have used this technique in Zope, probably without even realizing that they were doing concurrent programming. J2EE systems use a similar approach. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 3

Re: [Python-Dev] RFC: readproperty

2005-09-29 Thread Jim Fulton
Guido van Rossum wrote: > On 9/28/05, Jim Fulton <[EMAIL PROTECTED]> wrote: > ... > I think we need to be real careful with chosing a name -- in Jim's > example, *anyone* could assign to Spam().eggs to override the value. > The name "readproperty" is too c

[Python-Dev] RFC: readproperty

2005-09-28 Thread Jim Fulton
ate a read descriptor.) I'd be happy to add this for 2.5. Thoughts? Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-07-29 Thread Jim Fulton
Martin v. Löwis wrote: > Jim Fulton wrote: > >>I did convert projects individually. I told cvs2svn to just create dump >>files. I then used svnload to load the dump files myself so that >>I could make each project a top-level directory with it's own >>trunk, b

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-07-29 Thread Jim Fulton
Martin v. Löwis wrote: > Jim Fulton wrote: > >> I don't expect that this would be an issue for Python. > > > Right. > > >>2. I initially tried to conver our entire repository, including all >> branches. This would have taken days. I finally d

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-07-29 Thread Jim Fulton
abized by "projects", where separate projects reflect more or less independent development efforts with their own teams and schedules. (Maybe Python doesn't have many of these.) > 2. state how the conversion should be performed Once you decide what the project

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-07-29 Thread Jim Fulton
I'd still like to hear from Jim, as I don't believe all serious > problems were identified by eyeball at once. I'm not aware of any errors in the conversion. ... > Ah, before I forget, "single repository" has worked very well for Zope Yup. Jim -- Ji

Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion

2005-07-29 Thread Jim Fulton
Tim Peters wrote: ... > I'm sending this to Jim Fulton because he did the conversion of Zope > Corp's code base to SVN. Unfortunately, Jim will soon be out of touch > for several weeks. Jim, do you have time to summarize the high bits > of the problems you hit? IIR

Re: [Python-Dev] Anonymous blocks: Thunks or iterators?

2005-04-28 Thread Jim Fulton
thunk implementation. It would be a lot simpler, doing just what is required without any jiggery pokery with exceptions and break/continue/return statements. It would be easy to explain what it does and why it's useful. "Simple is better than Complex." Is there a thunk PEP? Jim --

Re: [Python-Dev] Re: anonymous blocks

2005-04-27 Thread Jim Fulton
Duncan Booth wrote: Jim Fulton <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: Guido van Rossum wrote: I've written a PEP about this topic. It's PEP 340: Anonymous Block Statements (http://python.org/peps/pep-0340.html). Some observations: 1. It looks to me like a bare re

Re: [Python-Dev] Re: anonymous blocks

2005-04-27 Thread Jim Fulton
ariable manipulation. I'm guessing that either implementing interfaces (or implementing a class statement in which the class was created before execution of a suite) is not a use case for this PEP. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO

Re: [Python-Dev] Security capabilities in Python

2005-04-08 Thread Jim Fulton
email) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/jim%40zope.com -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714

Re: [Python-Dev] rationale for the no-new-features approach

2005-03-09 Thread Jim Fulton
try: True, False except NameError: True, False = 1, 0 from ever ever happening again. - This, I hope, needs no further explanation Anthony -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO

Re: [Python-Dev] PEP 246, redux

2005-01-12 Thread Jim Fulton
uire lots of inconvenient hooks. There are exceptions of course. Our ZODB storage tests use a generic storage-interface test, but this is possible because the ZODB storage interfaces are extremely concrete. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO

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

2005-01-05 Thread Jim Fulton
Armin Rigo wrote: Hi Jim, On Tue, Jan 04, 2005 at 02:44:43PM -0500, Jim Fulton wrote: Actually, unbound builtin methods are a different type than bound builtin methods: Of course, but conceptually they are similar. You would still encounter the concept if you got an unbound builtin method. There

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

2005-01-04 Thread Jim Fulton
than bound builtin methods: Of course, but conceptually they are similar. You would still encounter the concept if you got an unbound builtin method. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope C

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

2005-01-04 Thread Jim Fulton
wouldn't break with the change. We'd still have bound methods. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope

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

2005-01-04 Thread Jim Fulton
so the concept won't go away. In fact, the change would mean that the behavior between builtin methods and python methods would become more inconsistent. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.o

Re: [Python-Dev] [Python 2.4] PyInt_FromLong returning NULL

2004-12-07 Thread Jim Fulton
st argument if it is non-NULL. It loosly models a Python assignment, assuming that it owns the reference to the second argument. Jim -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http:

Re: [Python-Dev] [Python 2.4] PyInt_FromLong returning NULL

2004-12-07 Thread Jim Fulton
Tim Peters wrote: [Jim Fulton] Ugh. Part of the problem is that all of those calls are unchecked, Dang us. If they were checked, then, who knows, we might have gotten informative exceptions. They certainly "should" be checked, but as a pragmatic matter PyInt_FromLong(1) can't

Re: [Python-Dev] [Python 2.4] PyInt_FromLong returning NULL

2004-12-07 Thread Jim Fulton
be the reason that such a "stupid" call return NULL in a reproducable way? Ugh. Part of the problem is that all of those calls are unchecked, Dang us. If they were checked, then, who knows, we might have gotten informative exceptions. I'd say the first step should be to add che