(n):
... return bool(n%2)
...
def even(n):
... return not odd(n)
...
not much more complex, but the logic for A(n) and not A(n) is only done once.
Not really much to do with TCO though.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
**53 then the assertion succeeds and the loop does not print.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 22/06/2015 11:33, Robin Becker wrote:
.
Naftali,
I ran the following from python prompt
for what it's worth this also works on my machine
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Users\rptlab cd tmp
PS C:\Users\rptlab
: [Error 2] The system cannot find the file specified
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
Anyone wishing to bend their minds around instance as module can see the code
I've tested on //annapurna/tmp/rl_config.py.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 22/06/2015 13:03, Robin Becker wrote:
Anyone wishing to bend their minds around instance as module can see the code
I've tested on //annapurna/tmp/rl_config.py.
whoops misposted sorry
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 20/06/2015 08:24, Steven D'Aprano wrote:
On Fri, 19 Jun 2015 07:29 pm, Robin Becker wrote:
I'm trying to overcome a recursive import issue in reportlab.
..
I'm afraid I don't understand what you are trying to say here. Why can't the
user just set up such a default e.g
On 19/06/2015 11:23, Peter Otten wrote:
Robin Becker wrote:
.
Do I understand this correctly? You got bitten by a complex setup and now
you are hoping to improve the situation by making it even more complex?
How about reordering initialisation in such a way that the user defaults
an instance. I have set various dunders on the
instance eg __file__, __doc__, __all__ __name__ and I made the object a borg,
but it still seems a bit hacky.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
A minor point is that if you just need to compare distances you don't need to
compute the hypotenuse, its square will do so no subtractions etc etc.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
(), but it seemed to work only on windows.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 20/05/2015 16:42, Alain Ketterlin wrote:
Robin Becker ro...@reportlab.com writes:
.
The code I used to use with os.spawnl was even worse in leaving
zombies around.
For the same reason (os.wait() and os.waitpid() let you ... wait for
child-processes).
I suppose I needed
On 02/05/2015 10:14, Kev Dwyer wrote:
Robin Becker wrote:
```
the user suggests that even though claims are made that you can use a
filesystem, but stuff like pwd is missing. Apparently the user module has
no meaning, but there is a users module? I guess I'll need to keep
.
Is that the case or is it that os.path or os.path.expanduser doesn't exist?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 01/05/2015 13:15, Chris Angelico wrote:
On Fri, May 1, 2015 at 8:29 PM, Robin Becker ro...@reportlab.com wrote:
Best thing to do is to ask the user to post the complete traceback.
You might need to use import os.path but normally I would expect
that not to be an issue.
jamesbynd said
the trick. What I don't know is if the
process started by a view that then detaches will inherit the flags and dump
core properly. I have a mac test platform now and will attempt something myself.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
SIGSEGV etc
etc.
Is it possible to get core dumps on the Mac for debugging purposes? Would the
detached process inherit flags etc etc from the starting process? I know little
about OS X/Mach.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
the objects for years then
the pickle protocol is probably better as it is not python version dependant.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
= len(x)
assert len(y) == n
result = [None] * (2*n)
result[::2] = x
result[1::2] = y
return result
interestingly whilst many of the other solutions can be improved/modernized in
later pythons this one has stayed the same.
--
Robin Becker
--
https
I have to find the python that's parallel to
uwsgi (works in a virtualenv at least).
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 24/11/2014 16:51, Rick Johnson wrote:
EVOLUTION LOVES A WINNER!
I think evolution actually requires losers. Clearly there are more extinct
species, peoples, languages etc etc than there are existing ones so perhaps if
evolution 'loves' anything it 'loves' a loser.
--
Robin Becker
into the region. The idea is
that they should be as far apart as possible so as to minimize overlap and avoid
crossing the region boundary.
Circle packing is hard so I'm thinking of using some kind of spring/repulsion
model to do this.
Has anyone any ideas about how to do this?
--
Robin Becker
On 05/11/2014 06:40, dieter wrote:
Robin Becker ro...@reportlab.com writes:
Is there a way to do pkcs7 / 12 signing with python.
Have you checked whether OpenSSL supports this kind of signing?
If it does, then you likely can use this via several Python wrappings
for OpenSSL.
I checked
Is there a way to do pkcs7 / 12 signing with python. I looked at various
cryptographic packages, but it's not clear if any of them can do this.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
suggest if
you foresee problems using fabric on Windows and also suggest an
alternative to this if available. .
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 13/10/2014 22:00, Terry Reedy wrote:
On 10/13/2014 4:31 PM, Dennis Lee Bieber wrote:
On Mon, 13 Oct 2014 10:49:27 +0100, Robin Becker ro...@reportlab.com
declaimed the following:
c:\users\rptlab\tmp\tmcallister\build\pysqlite\src\connection.h(33) : fatal
error C1083: Cannot open include
specially. I don't remember this happening on my old
win32 XP system, but that died and I now am forced to use 64bit win7.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
from the module in hte __dict__?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 24/09/2014 12:54, Dave Angel wrote:
Robin Becker ro...@reportlab.com Wrote in message:
...
Is a loader supposed to reset all the reused module's attributes and reset the
__dict__ or does it just run the code from the module in hte __dict__?
Nothing gets reset or run. It simply
On 22/08/2014 18:53, Stefan Behnel wrote:
Robin Becker schrieb am 22.08.2014 um 17:50:
I'm trying to build a bunch of extensions in a 2.7 virtual environment on a
.
Has anyone else seen this error? It's entirely possible that it might be I
don't have enough memory or something
be I don't
have enough memory or something, lxml builds almost always take a long time.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
):
... return False
...
a=NeverEqual(1)
a
1
a==1
False
a==a
False
not (a != a)
True
a!=a
False
so I think that assignment doesn't always make things equal even
chronologically.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
Robin Becker added the comment:
I'll repeat the post I made to BreamoreBoy regarding this bug:
re: http://bugs.python.org/issue1047397
this bug is now 10 years old. I'm not sure why it's to be considered
closed because the original intent of the bug report was that the html
output of the cgitb
am able to clone etc etc without issue, but those are almost
all 12.04 machines and were fully updated at the time of heartbleed.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
or urllib2 to use my host name and a specifed ip
address?
I can always change my hosts file, but that is inconvenient and potentially
dangerous.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
seems like a good choice and I would not really want to hack
the hosts files back and forth on a regular basis.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
it hasn't
been updated beyond that), pull up urllib2.py, and step through
manually, seeing where the hostname gets turned into an IP address.
Hence, this code:
.
in practice this approach worked well with urllib in python27.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 10/06/2014 11:14, alister wrote:
On Mon, 09 Jun 2014 21:54:25 +0100, Carlos Anselmo Dias wrote:
I'm sorry
What does all this relate to?
Turing test?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 05/06/2014 22:56, Mark Lawrence wrote:
On 05/06/2014 22:42, Ned Deily wrote:
In article b91c428a-514d-4ddd-84a2-a4bdeb1ed...@googlegroups.com,
Rustom Mody rustompm...@gmail.com wrote:
On Thursday, June 5, 2014 10:21:06 PM UTC+5:30, Robin Becker wrote:
I used to create exe files
continued to do the wrong thing :)
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
strings are second class
which I think is wrong; apparently pressure from influential users is pushing to
make byte strings more first class which is a good thing.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
. The reportlab code is now a mess of hacks
to keep it alive for 2.7 =3.3; I'm probably never going to be convinced that
uncode types are good. Bytes are the underlying concept and should have remained
so for simplicity's sake.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
a zip so is there perhaps a way to make the wheel installation
run a post installation script?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
incompatible legacy encodings.
I've never understood why not use UTF-8 for everything.
me too
-mojibaked-ly yrs-
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
of computing is still western
centric so searching a byte string for latin characters is still efficient;
searching for an n with a tilde on top might not be so easy.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
. There are quite a few diacritics and a fair few glyphs
they could be applied to. I don't think it likely they could map all possible
combinations to a private range.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
give meaning to binary data using encodings is a
bit limiting. A zip or gif file has structure, but I don't think it's reasonable
to regard such a file as having an encoding in the python unicode sense.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
in the way.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
error messages failing to be printable etc etc. Since bytes
in Python 3 are not equivalent to the old str (Python 3 bytes != Python 2 str)
using bytes everywhere has its own problems.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 08/05/2014 04:46, Steven D'Aprano wrote:
On Wed, 07 May 2014 11:42:24 +0100, Robin Becker wrote:
I have an outstanding request for ReportLab to allow images to be opened
using the data: scheme. That used to be supported in python 2.7 using
urllib, but in python 3.3 urllib2 -- urllib
instance.
Using a director would be possible, but it's not much cleaner than special
casing the function and I don't have to worry about which opener to use; I use
the one provided by the user
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
.
Any ideas?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
will silently fail
because re will reset and consider any metacharacter as literal?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
specification errors.
I've abandoned this translation anyhow as all that was intended was to split the
string into non-overlapping strings of size at most k. I find this works faster
than the regexp even if the regexp is pre-compiled.
[p[i:i+k] for i in xrange(0,len(p),k)]
--
Robin Becker
re.compile('.{1,+3}')
raise an error? It doesn't on python 2.7 or 3.3.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
they are
so randomly tryes to run inspect.routine over one of the bad instances.
-bumbling-ly yrs-
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
be
compatible with 3.3.x
Is my only hope to add more print statements or use pdb or should I try and
compile python 3.3.x myself and get the search narrowed with VS? The issue is
complicated by my having redirected all outputs to some message windows using
fake files for stderr stdout.
--
Robin Becker
, but in addition something about the platform name is
causing the crash later on.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 17/01/2014 21:10, Terry Reedy wrote:
On 1/17/2014 7:14 AM, Robin Becker wrote:
..
I never got how you are using doctests. There were certainly not meant for
heavy-duty unit testing, but for testing combined with explanation. Section
26.2.3.7. (in 3.3) Warnings warns
make the test utility harder. If the test fails I don't see the actual
outcome and expected I see expected True got False.
Is there an easy way to make these kinds of tests work in python 2 3?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
failures.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
to be
better than depending on the strings being ASCII, though.
ChrisA
I tried this approach with a few more complicated outcomes and they fail in
python2 or 3 depending on how I try to render the result in the doctest.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
), but it copies OK.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
understand why the latter seems slower especially since we try to convert early
to unicode/str as a desirable internal form. Probably I have some horrible error
going on(eg one of the C extensions is working in 2.7 and not in 3.3).
-stupidly yrs-
Robin Becker
--
https://mail.python.org/mailman/listinfo
the gurus here in achieving this.
I have had a lot of support from the gurus thanks to all of them :)
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
to isolate so
called graphemes I need an algorithm even for python's unicode ie when it really
matters, python3 str is just another encoding.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
of its api), but that didn't count for the developers.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
a sequence of
bytes or a sequence of codepoints. They are both encodings of the graphemes;
what unicode says is an encoding doesn't define what encodings are ie mappings
from some source alphabet to a target alphabet.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
, but in fact they will remain until we force
printers/designers to stop using complicated multi-codepoint graphemes. I
suspect that won't happen.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 15/01/2014 17:14, Chris Angelico wrote:
On Thu, Jan 16, 2014 at 3:55 AM, Robin Becker ro...@reportlab.com wrote:
I think about these as encodings, because that's what they are
mathematically, logically practically. I can encode the target grapheme
sequence as a sequence of bytes using
,
swapping their labels and making subtle changes is a real pain.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
porting and that is going the wrong way.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 02/01/2014 18:37, Terry Reedy wrote:
On 1/2/2014 12:36 PM, Robin Becker wrote:
I just spent a large amount of effort porting reportlab to a version
which works with both python2.7 and python3.3. I have a large number of
functions etc which handle the conversions that differ between the two
reference manual also appear to be slower in 3.3.
Regards
Antoine.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
english text.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
is then a real hindrance.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
)
! self.library_dirs.insert(0,new_lib)
! else:
! self.library_dirs.append(new_lib)
elif MSVC_VERSION == 8:
self.library_dirs.append(os.path.join(sys.exec_prefix,
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python
On 09/12/2013 20:46, Dave Angel wrote:
On Mon, 09 Dec 2013 15:54:36 +, Robin Becker ro...@reportlab.com wrote:
On 06/12/2013 22:07, Joel Goldstick wrote:
end, start = start, end
a similar behaviour for simple assignments
for less than 4 variables the tuple method is faster
\optichrome\74663python -mtimeit -sa=1;b=2;c=3;d=4;e=5;f=6;g=7;h=8
a=e;b=f;c=g;d=h
1000 loops, best of 3: 0.103 usec per loop
for less than 4 variables the tuple method is faster.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
% of the strings I need to parse. I think I can live with the
non-reparsing of the map output, but can I get Python 3 to do the UseForeignDTD
thing?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
broad conclusion. I think
this particular module may get lost in the wash. If it ever needs
re-implementing we can presumably rely on some more general approach as used in
the various remote object proxies like pyro or similar.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
module testing. Is there a way to recover the old behaviour(s)?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
that.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 18/11/2013 11:47, Robin Becker wrote:
...
#c:\python33\lib\site-packages\sitecustomize.py
import sys, codecs
sys.stdout = codecs.getwriter(utf-8)(sys.stdout.detach())
sys.stderr = codecs.getwriter(utf-8)(sys.stderr.detach())
it seems that the above needs extra stuff to make
:(
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
say an Ascii rendering?
-confused-ly yrs-
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
(), and a corresponding %a format string.
--Ned.
thanks for this, edoesn't make the split across python2 - 3 any easier.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
that into
one of the global environment vars and have it work for all python invocations.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
and laughed when 8 bits became
popular.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
as
from __future__ import print_function
nothing fixes all those %r formats to be %a though :(
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
tricks with inverted multiplications
etc etc :(
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
, then came the IBM 7094 which had 36 bits and finally the
CDC6000 7600 machines with 60 bits, some one must have liked 6's
-mumbling-ly yrs-
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
this route and
are reasonably ok, but there's no doubt the change made things more difficult.
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
I be using virtualenv?
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 14/10/2013 16:17, Robin Becker wrote:
I'm trying to port reportlab extensions to Python 3.3. On windows I get a
missing library error when trying to build/install the trial reportlab in a
virtual environment eg
C:\code\hg-repos\reportlab\python33\python -m venv tpy33
.ns\rl_accel
On 14/10/2013 17:01, Marco Buttu wrote:
On 10/14/2013 05:17 PM, Robin Becker wrote:
I'm trying to port reportlab extensions to Python 3.3. On windows I get
a missing library error when trying to build/install the trial reportlab
in a virtual environment eg
This is my configuration file
?
ChrisA
Electrical Engineers use j (probably to avoid conflicts with i (current).
--electrically yrs--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 01/10/2013 18:26, MRAB wrote:
On 01/10/2013 17:41, Robin Becker wrote:
..
I've tried it in a minimal console program, and it seems to work for me.
thanks for the test. I thought this might be an issue with the macro call
argument being spread out over several lines, but since
201 - 300 of 735 matches
Mail list logo