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

2006-08-23 Thread Alex Martelli
its, but that's a subject for the Python-3000 mailing list; as long as builtins and globals stay as fluid as today, I'm skeptical on the optimization opportunities here. Alex ___ 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] [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-Checki

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

2006-08-23 Thread Alex Martelli
le, if the 1990 C Standard is that much weaker on this than 1999's and we need to stick to it anyway. But the problem is that testing this sensibly requires fpconst (from PEP 754) or the equivalent, otherwise it may be impossible to write unittest to show the presence or absence of

Re: [Python-Dev] weakref enhancements

2006-09-28 Thread Alex Martelli
when the callable in turn keeps alive an object with possibly massive state). In practice I use wrapping and tricks, but it would be nice to have cleaner standard library support for this. (Often the container needs to be some form of a Queue.Queue, since

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-02 Thread Alex Gaynor
ecuted many times, but it isn't the only case. > > You cannot assume that optimization techniques used on other (static) languages can be used/ported in Python. > > Cesare > No, it's singularly impossible to prove that any global load will be any given value

Re: [Python-Dev] Possible optimization for LOAD_FAST ?

2011-01-04 Thread Alex Gaynor
; Cheers, > Nick. > > -- > Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia > Ugh, I can't be the only one who finds these special cases to be a little nasty? Special cases aren't special enough to break the rules. Alex -- "I disapprove of what

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

2007-10-24 Thread Alex Martelli
ly don't think of themselves as "developers"; they're more likely to end up, say, as "CHI experts", "computational linguists", and the like... Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.pyth

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

2008-03-01 Thread Alex Martelli
> > Cool, thanks. I'd like to volunteer for Italian (and we, the Italian Python community, do have reasonably good connections to the Italian technical press, which is covering e.g. the upcoming Pycon Due conference), and although my French is VERY rusty I can give it a try if no nati

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

2008-03-01 Thread Alex Martelli
PyString - bytes > PyBytes - bytearray > > See? :) Yep, but please do keep the PyUnicode for str and PyString for bytes (as macros/synonnyms of PyStr and PyBytes if you want!-) to help the task of porting existing extensions... the bytearray functions should

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
just announced new investments and high-profile hires to make Jython a top-quality Python implementation. Alex On Sun, Mar 9, 2008 at 7:42 AM, <[EMAIL PROTECTED]> wrote: > > Michal> I'm about to start my master thesis: "optimizing python > Michal> interpreter&

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

2008-03-10 Thread Alex Martelli
Your proposal can't play well with slices including negative indices. Also, your desired use case of alist[indices] is already pretty well covered by [alist[i] for i in indices]. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.py

Re: [Python-Dev] Improved thread switching

2008-03-19 Thread Alex Martelli
kage appears to offer an easy way to migrate threaded code to multiple-processes approaches, although I've only played around with it, not [yet] used it for production code). Alex On Wed, Mar 19, 2008 at 10:49 AM, Adam Olsen <[EMAIL PROTECTED]> wrote: > On Wed, Mar 19, 2008 at

Re: [Python-Dev] Decimal(unicode)

2008-03-25 Thread Alex Martelli
oded strings). +1 -- it seems very practical as well as consistent, and I see no downsides. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/

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/listi

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

2008-05-03 Thread Alex Martelli
e simple "return " [[or bool() if it's actually mandatory to return a bool and can't be relied upon to produce one]]. Alex ___ 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] [Python-3000] Invitation to try out open source code review tool

2008-05-03 Thread Alex Martelli
PI > we can tap into in order to create new issues. Given the app engine model, I guess any "API" to an app engine-hosted service would have to be of the RESTful kind, i.e., some URLs to which client-code can POST appropriately. Alex _

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

2008-05-04 Thread Alex Martelli
be placed *outside the current function*?! What a straw-man...! Just do def last_first(r): return r[0].lower(), r[5].lower() for k, g in groupby(iterable, key=last_first): ... putting the def right where you now have the " = lambda ..." of course! Alex ___

Re: [Python-Dev] Conditional For Statements

2008-05-19 Thread Alex Martelli
hewing synonyms in APIs you design that provide no added value beyond that of catering to different tastes or to a meta-taste for variety over uniformity;-) is still a helpful heuristic -- with or without the "obvious" word (i.e., whether you're working with C, which doesn't hav

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

2008-05-21 Thread Alex Martelli
ame way: it WOULD be sad to waste this excellent opportunity, so I second the suggestion to put pyprocessing in the library right now. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: h

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

2008-06-06 Thread Alex Martelli
an extension from having to write that unneeded and slow extra code? Alex ___ 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] Assignment to None

2008-06-09 Thread Alex Martelli
often used in dotNET libraries)? Alex On Mon, Jun 9, 2008 at 1:28 AM, Michael Foord <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: >> >> On Mon, 9 Jun 2008 12:24:55 pm Curt Hagenlocher wrote: >> >> >>> >>> So, it's okay to seta

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

2008-06-14 Thread Alex Martelli
esses to identifiers without leading dots doing nested lookup (so that e.g. "print foo" might emit b.foo if present, else a.foo if present, else local foo if present, else global foo if present). I'm not sure I like this whole arrangement, but maybe overall I do, perhaps +0 ... Ale

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

2008-06-14 Thread Alex Martelli
often, even though many of those cases don't make it into YouTube videos). I don't need to rant against it within Google, because Google's Python Style Guide already absolutely forbids it, fortunately;-). Alex ___ Python-D

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

2008-06-15 Thread Alex Martelli
gnments define local variables, as usual -- but you can say e.g. 'zz' to mean 'someobj.zz', if you're sufficiently keen on giving up the advantage of having many well-separated namespaces;-). Alex On Sat, Jun 14, 2008 at 11:16 PM, Cesare Di Mauro <[EMAIL PROTECTED]>

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

2008-06-18 Thread Alex Martelli
ast, I'll admit -- it never feels as free-flowing as Scheme did back when I used THAT, but, close enough to make my jobs successful!-) Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

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
x pair using the C99 notation as > recommended in 754R? Dunno about everyone, but I'm +1 on that. > Are you thinking of math module functions or as a method and classmethod on > floats? I'd prefer math modules functions. Alex ___

Re: [Python-Dev] assertRaises

2008-07-17 Thread Alex Martelli
... +1 : enriching the existing method in a way that's perfectly transparent and innocuous to all existing uses _feels_ right, because it's more practical. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

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

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

2008-08-26 Thread Alex Martelli
bad...: """Mixin to enable reification.""" def __init__(self): super(ReificationStore, self).__init__() [there's *nothing else* in this __init__!]. Alex ___ Python-Dev mailing list Python-Dev@p

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
AIX 3 was). Sad to learn that BSD is now also broken in the same way:-(. Alex On Wed, Sep 17, 2008 at 8:00 AM, James Y Knight <[EMAIL PROTECTED]> wrote: > > On Sep 17, 2008, at 10:53 AM, Andrew MacIntyre wrote: > >> Martin v. Löwis wrote: >>>> >>>&

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

2008-09-24 Thread Alex Martelli
) and that requires Python 2.5 and only pure-Python add-ons... thanks! Alex On Wed, Sep 24, 2008 at 8:08 AM, Bob Ippolito <[EMAIL PROTECTED]> wrote: > On Wed, Sep 24, 2008 at 6:14 AM, Barry Warsaw <[EMAIL PROTECTED]> wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 &g

Re: [Python-Dev] My patches

2008-11-02 Thread Alex Martelli
l it's missing is a simple code review tool like code.google.com's or Rietveld, but Jesper's promised me he would integrate something to that effect... Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailma

Re: [Python-Dev] __import__ problems

2008-11-28 Thread Alex Martelli
ely said I could see > some advantages to it. I spent most of my post telling the OP why I > thought his arguments were wrong! And now we're telling you why we think your arguments are also wrong -- what else do you expect from python-dev after all? Alex ___ 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] Attribute error: providing type name

2008-11-30 Thread Alex Martelli
rapper generator he's also authored and uses for PyQt) AND it would make sip even better, so he may want to put it on his backlog. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: h

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 P

Re: [Python-Dev] RFC: Add a new builtin strarray type to Python?

2011-10-02 Thread Alex Gaynor
, and once you're done it reuses it's buffer to create the Python level string object, which is to say there's no need to copy it at the end. As I said, unless your interest is maximum performance, there's nothing wrong with the current idiom, and

Re: [Python-Dev] Hash collision security issue (now public)

2011-12-28 Thread Alex Gaynor
Therefore I think these should be considered application issues, since request limiting is difficult and error prone, I'd recommend the Python stdlib including a non-hash based map (such as a binary tree). Alex ___ Python-Dev mailing list Python-De

Re: [Python-Dev] requirements for moving __import__ over to importlib?

2012-02-07 Thread Alex Gaynor
e easy to just: $ pypy -mtimeit "import struct" $ pypy -mtimeit -s "import importlib" "importlib.import_module('struct')" Or whatever the right API is. Alex ___ Python-Dev mailing list Python-Dev@python.

Re: [Python-Dev] Add a frozendict builtin type

2012-02-27 Thread Alex Gaynor
use a different internal implementation (while, of course, still being dicts at the Python level). We do *not* handle the case of trying to figure out whether a Python object is immutable in any way. Alex ___ Python-Dev mailing list Python-Dev@python.org

[Python-Dev] Compiling Python on Linux with Intel's icc

2012-03-01 Thread Alex Leach
linux-gnu/libz.so.1 (0x7f3e32d8f000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x7f3e32b0b000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f3e3276b000) /lib64/ld-linux-x86-64.so.2 (0x7f3e33c03

Re: [Python-Dev] Compiling Python on Linux with Intel's icc

2012-03-02 Thread Alex Leach
Stefan Krah wrote: > Alex Leach wrote: > > I've managed to compile everything in the python distribution except for > > Modules/_ctypes/libffi/src/x86/ffi64.c. > > There is an issue for this: > > http://bugs.python.org/issue4130 Yes, I saw that bug report, bu

Re: [Python-Dev] Compiling Python on Linux with Intel's icc

2012-03-02 Thread Alex Leach
Stefan Krah wrote: > Alex Leach wrote: > > I've managed to compile everything in the python distribution except for > > Modules/_ctypes/libffi/src/x86/ffi64.c. > > There is an issue for this: > > http://bugs.python.org/issue4130 Yes, I saw that bug report, bu

Re: [Python-Dev] Compiling Python on Linux with Intel's icc

2012-03-02 Thread Alex Leach
uild_ext But this then uses gcc-specific flags when compiling. Cheers, Alex ___ 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] Compiling Python on Linux with Intel's icc

2012-03-02 Thread Alex Leach
Stefan Krah wrote: > Alex Leach wrote: > > I've managed to compile everything in the python distribution except for > > Modules/_ctypes/libffi/src/x86/ffi64.c. > > There is an issue for this: > > http://bugs.python.org/issue4130 Yes, I saw that bug report, bu

Re: [Python-Dev] Compiling Python on Linux with Intel's icc

2012-03-02 Thread Alex Leach
s cf. <3s). And the script hardly took that long to write! Thanks for the benchmark recommendation; I'll use that on the next build - hopefully after passing the math tests! Cheers, Alex > ___ Python-Dev mailing list Python-Dev@python.org h

Re: [Python-Dev] Compiling Python on Linux with Intel's icc

2012-04-14 Thread Alex Leach
l/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/intel/bin:/usr/intel/composer_xe_2011_sp1.9.293/mpirt/bin/intel64:/home/albl500/SDKs/android-sdk-linux/tools:/biol/bin:/biol/arb/bin:/usr/local/cuda/bin:/home/albl500/bin:/usr/intel/composer_xe_2011_sp1.9.293/mpirt/bin/intel64 LD=xild CXX=icpc CC=ic

Re: [Python-Dev] c/ElementTree XML serialisation

2012-05-08 Thread Alex Leach
lookups, from the module I'm working on. That way I hope I can pass method="svg" to ElementTree's write() method; it should work, and it should also be backwards-compatible. That should be quite a quick and easy fix actually. Would this be something worth in

Re: [Python-Dev] c/ElementTree XML serialisation

2012-05-08 Thread Alex Leach
On Tuesday 08 May 2012 23:15:43 And Clover wrote: | | CDATA sections are of use for hand-authoring readability, but don't help | in machine-serialised documents. You don't get away from the need to | encode out-of-band sequences (notably ]]> is still invalid) so it | doesn't buy you any simplicity

Re: [Python-Dev] c/ElementTree XML serialisation

2012-05-09 Thread Alex Leach
heck that though.. | | As to writing a loop in javascript without < and >, == and != generally | work rather well, as does Array.prototype.forEach[0] Thanks for the tips! Cheers, Alex ___ Python-Dev mailing list Python-Dev@python.org http:/

Re: [Python-Dev] c/ElementTree XML serialisation

2012-05-09 Thread Alex Leach
heck that though.. | | As to writing a loop in javascript without < and >, == and != generally | work rather well, as does Array.prototype.forEach[0] Thanks for the tips! Cheers, Alex ___ Python-Dev mailing list Python-Dev@python.org http:/

Re: [Python-Dev] backporting stdlib 2.7.x from pypy to cpython

2012-06-11 Thread Alex Gaynor
Frank Wierzbicki seemed positive about it. > -eric > I'm +1 on such a list, I don't have the time to follow every single thread on python-dev, and I'm sure I miss a lot of things, have a dedicated place for things I know are rele

Re: [Python-Dev] [compatibility-sig] making sure importlib.machinery.SourceLoader doesn't throw an exception if bytecode is not supported by a VM

2012-06-12 Thread Alex Gaynor
r me, or anyone else apparently) Alex ___ 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] [compatibility-sig] making sure importlib.machinery.SourceLoader doesn't throw an exception if bytecode is not supported by a VM

2012-06-12 Thread Alex Gaynor
On Tue, Jun 12, 2012 at 11:47 AM, Brett Cannon wrote: > > > On Tue, Jun 12, 2012 at 12:38 PM, Alex Gaynor wrote: > >> For PyPy: I'm not an expert in our import, but from looking at the source >> >> 1) imp.cache_from_source is unimplemented, it's an Attri

Re: [Python-Dev] Status of packaging in 3.3

2012-06-21 Thread Alex Clark
your opinion. I understand the frustration, but we have to let people succeed and/or fail on their own[2]. It worked with the OS packagers guys though, we have built a great data files managment system in packaging + the versions (386) Are you referring to "the" packaging/dis

Re: [Python-Dev] Status of packaging in 3.3

2012-06-21 Thread Alex Clark
et's let setuptools be setuptools and distribute be distribute i.e. as long as distribute exists, I don't care at all about setuptools' release schedule (c.f. PIL/Pillow) and I like it that way :-). If one day setuptools or packaging/distutils2 comes alon

Re: [Python-Dev] Status of packaging in 3.3

2012-06-21 Thread Alex Clark
distutils[1], a package is: a module or modules inside another module[2]. So e.g.:: foo.py is a module and: foo/__init__.py foo/foo.py is a simple package containing the following modules: import foo, foo.foo Alex [1] http://docs.python.org/distutils/introduction.html#general

Re: [Python-Dev] Status of packaging in 3.3

2012-06-22 Thread Alex Clark
100% convinced the new term should be "dist". Rather I propose: - Change the definition of package to: a module (or modules) plus package data and package metadata inside another module. - Refer to source dists as "source packages" i.e. packages containing source code.

[Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-14 Thread Alex Gaynor
Hi all, I've just submitted a PEP proposing making __length_hint__ a public API for users to define and other VMs to implement: PEP: 424 Title: A method for exposing a length hint Version: $Revision$ Last-Modified: $Date Author: Alex Gaynor Status: Draft Type: Standards Track Content

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-14 Thread Alex Gaynor
On Sat, Jul 14, 2012 at 4:18 PM, Benjamin Peterson wrote: > 2012/7/14 Alex Gaynor : > > > > Proposal > > > > > > This PEP proposes formally documenting ``__length_hint__`` for other > > interpreter and non-standard library Python to implement. >

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-14 Thread Alex Gaynor
hint computed. e.g. imagine some sort of lazy stream that cached itself, and only wanted to offer a length hint if it had already been evaluated. Without an exception to raise, it has to return whatever the magic value for length_hint is (in your impl it appears to be 0, the current _PyObject_Len

Re: [Python-Dev] PEP 0424: A method for exposing a length hint

2012-07-16 Thread Alex Gaynor
y the current C _PyObject_LengthHint implementation. There are no provisions for infinite iterators, that is not within the scope of this proposal. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pytho

Re: [Python-Dev] A new JIT compiler for a faster CPython?

2012-07-17 Thread Alex Gaynor
nd the speedups are tiny. Please, learn from Unladen Swallow and other's experiences, otherwise they're for naught, and frankly we (python-dev) waste a lot of time. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.

Re: [Python-Dev] A new JIT compiler for a faster CPython?

2012-07-20 Thread Alex Gaynor
ized to compile individual functions, recursion, etc. And any profiling JIT, in practice, needs a compile heuristic for how many calls must occur before a unit is compiled, even the Hotspot JVM has one. Alex ___ Python-Dev mailing list Python-Dev@

[Python-Dev] Requesting pronouncement on PEP 0424

2012-07-28 Thread Alex Gaynor
Hi all, The discussion on PEP 0424 seems to have subsided (and I haven't gotten angry emails in a week!). So I would like to request a BDFL or BDFP pronouncement on PEP 0424, text available here: http://hg.python.org/peps/file/tip/pep-0424.txt

Re: [Python-Dev] Requesting pronouncement on PEP 0424

2012-07-29 Thread Alex Gaynor
everyone could take a new look at that I would be very grateful. Sorry for the mixup. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/

Re: [Python-Dev] Requesting pronouncement on PEP 0424

2012-07-30 Thread Alex Gaynor
asonable, rather than try to spec that out precisely in the pseudocode (aka Python ;)) a note like you suggest sounds good. > -- > --Guido van Rossum (python.org/~guido) > Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice H

Re: [Python-Dev] [compatibility-sig] do all VMs implement the ast module? (was: Re: AST optimizer implemented in Python)

2012-08-13 Thread Alex Gaynor
hing proposed there is possible, b) making this a front-and-center API makes it really easy to shoot themselves in the foot, by doing things like breaking Python with invalid optimizations (hint: almost every optimization proposed in that thread is invalid in th

Re: [Python-Dev] performance of {} versus dict()

2012-11-15 Thread Alex Gaynor
Stefan Behnel behnel.de> writes: > Right. If that makes a difference, it's another bug. > > Stefan > > It's fixed, with, I will note, fewer lines of code than many messages in this thread: https://bitbucket.org/pypy/pypy/changeset/c30cb1dcb7

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

2005-01-04 Thread Alex Martelli
lly reading python-dev again after all these months -- almost caught up with recent traffic too;-)... Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/ma

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

2005-01-05 Thread Alex Martelli
might be substantial overhead). OK, I guess, as long as we don't expect any further attribute setting on f to affect C.f or D.f (and I don't know of any real use case where that would be needed). Alex ___ Python-Dev mailing list Pyth

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

2005-01-05 Thread Alex Martelli
e proposing make it MORE attractive to Apple to go for 2.3.5, LESS so, or is it indifferent from their POV...? Thanks in advance for any help in getting the tradeoffs about this clearer in my mind! Alex ___ Python-Dev mailing list Python-Dev@python.org http://

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

2005-01-05 Thread Alex Martelli
ag as ast_branch (while it wants a dash, NOT an underscore...). I guess having the instructions recommended to me again prompted me to doublecheck character by character extracarefully, so, thanks!-) Alex ___ Python-Dev mailing list Python-Dev

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

2005-01-05 Thread Alex Martelli
sense of the speed or lack thereof of 2.3.x releases' entrance in Tiger's previews... Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/

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

2005-01-06 Thread Alex Martelli
, we'd need some performance measurements from real-life use cases) even though from the point of view of code simplicity, in this example, there appears to be little or no gain wrt slicing rec[offs:offs+itemsize] or using buffer(rec, offs, itemsize). Alex

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

2005-01-06 Thread Alex Martelli
d concrete ;-). Your title "Python's Super Considered Harmful" is an obvious reference to and takeoff on Dijkstra's influential polemic "Goto Considered Harmful". ...or any other of the 345,000 google hits on "considere

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

2005-01-07 Thread Alex Martelli
uire it, right? Can't we treat this misbehavior as an outright bug? +1 -- the nonremoval of escape characters smells like a bug to me, too. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev U

[Python-Dev] PEP 246, redux

2005-01-10 Thread Alex Martelli
st it here, rather than relying on would-be commenters to get it from CVS... I'm also specifically CC'ing Clark, the co-author, since he wasn't involved in this rewrite and of course I owe it to him to change or clearly attribute to myself anything he doesn't like to have &

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
ually corresponds to the subset of PEP 246 adaptation for cases where adapt() returns the original object or raises an error. (That is, if adapt() could only ever return the original object or raise an error, it would be precisely equivalent to Java casting, if I understand it correctly.) Thus, at

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
s useless. If older code doesn't have __conform__, it cannot possibly *use* the Liskov-violation mechanism. Adding __conform__ to a class to raise a LiskovViolation when needed is a TINY change compared to the refactoring needed to use template-meth

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
lent, you're really pushing people to use much more complicated and sophisticated structures of objects than "private inheritance" affords when properly used... and the LAST thing OO programmers need is any encouragement towards more complicated structures!-) Alex ___ 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] PEP 246, redux

2005-01-11 Thread Alex Martelli
prior art, so thanks for pointing it out. If interfaces change so often that 'n' can become worryingly high, this is a valid concern. In my world, though, published interfaces do NOT change as often as to require such remedies;-). Alex __

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
rt pro and con args, too, but I'm not unbiased enough to write it all by myself...;-) Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/pyt

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
or it) and striving horrendously to shoehorn it in. So what's the score now...? Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-d

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
transitivity) is a violation of PRAGMATICS, of the BEST-EFFORT implication, just as it would be to drop packets once in a while in a TCP/IP stack due to some silly programming bug which was passed silently. Alex ___ 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] 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 su

Re: [Python-Dev] copy confusion

2005-01-11 Thread Alex Martelli
#x27;s worrisome, not just that nobody else reported problems, but also that the unit tests didn't catch them...:-( Alex ___ 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] copy confusion

2005-01-11 Thread Alex Martelli
rmance enhancement while adding a related feature (copy_reg integration), rather than as a fix for possible metaconfusion, even though it also has that effect.) OK, but if Armin is correct about the code in the reference implementation of pep 246, and I think he is, this is still a bug in copy.

Re: [Python-Dev] copy confusion

2005-01-11 Thread Alex Martelli
__metaclass__ = MetaCopyableClass # rest of class snipped x = CopyableClass() import copy y = copy.copy(x) kallisti:/tmp alex$ python x.py Traceback (most recent call last): File "x.py", line 14, in ? y = copy.copy(x) File "/usr/local/lib/python2.4/copy.py", line 79, in copy

Re: [Python-Dev] PEP 246, redux

2005-01-11 Thread Alex Martelli
ngth, such as A->B->C or A->Z->C, with all the steps being declared lossless and perfect, then it SHOULD just pick one by whatever criterion, since both will be equally perfect anyway -- so maybe my reasoning by absurd wasn't totally absurd after all;-). Would this compromise be

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

2005-01-12 Thread Alex Martelli
of course, and then it should probably be made fast). Feedback welcome -- the actual patch will doubtless be tiny, but it would be nice to have it right the first time (as it needs to go into both the 2.3 and 2.4 bugfix branches and the 2.5 head). Alex ___ 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] Re: copy confusion

2005-01-12 Thread Alex Martelli
for __deepcopy__. The fix, again, should be a tiny patch -- and it seems to me that we should have it for 2.3.5 as well as for 2.4.1 and the HEAD. Alex ___ 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] 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
dapted-to interface, without facing undetected degradation of information quality by that adapter being invisibly, uncontrollably chained up with another -- no error message, no nothing, no way to stop this -- just because a direct adapter wasn't correctly written and registered. Just

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 i

<    1   2   3   4   >