unexpected syntax errors

2013-05-07 Thread Robin Becker
ised from various distros which are apparently making changes to 2.7 which change the external behaviour eg spelling corrections to attribute names. Could this be one of those? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing Extensions for Python 3 in C

2013-06-19 Thread Robin Becker
xxsubtype.c. They may give you some idea of how to proceed. Of course all the other .c codes in there are the actual extensions that Python uses so they are also good examples. I started with "Extending and Embedding the Python Interpreter" from the python documentation thou

substituting proxy

2013-07-29 Thread Robin Becker
vascript file(s) might work. Has anyone done this in twisted pymiproxy etc etc? -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

looping versus comprehension

2013-01-30 Thread Robin Becker
print 20*'#','END n=%s'%n,20*'#','\n\n' if __name__=='__main__': if len(sys.argv)==1: N = [86000] else: N = map(int,sys.argv[1:]) for n in N: main(n) # -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: looping versus comprehension

2013-01-30 Thread Robin Becker
On 30/01/2013 15:49, Chris Angelico wrote: On Thu, Jan 31, 2013 at 1:58 AM, Robin Becker wrote: however, when I tried an experiment in python 2.7 using the script below I find that the looping algorithms perform better. A naive loop using list += list would appear to be an O(n**2) operation

client ssl verification

2012-03-15 Thread Robin Becker
return self.do_open(self.specialized_conn_class, req) def secureDataGet(uri,ca_certs='cacert.pem',key_file=None,cert_file=None, explicit_check=False): https_handler = SecuredHTTPSHandler(key_file=key_file,cert_file=cert_file, ca_certs=ca_certs,explicit_check=explicit_check)

How good is security via hashing

2011-06-07 Thread Robin Becker
e process is switched to fastcgi and the initialization is only carried out once and then say 50 rrr values are generated. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: How good is security via hashing

2011-06-07 Thread Robin Becker
stic and such a scheme is useless. If I use cgi then we're re-initializing the sequence hopefully using some other unrelated randomness for each number. Uuid apparently uses machine internals etc etc to try and produce randomness, but urandom and similar can block so are probably not entir

Re: How good is security via hashing

2011-06-07 Thread Robin Becker
/dev/urandom does not block, that's the point of it as compared to / dev/random. Jean-Paul my mistake, I thought it was the other way round, on FreeBSD they're the same anyway which is what we test on. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: How good is security via hashing

2011-06-07 Thread Robin Becker
ropy might run out or something like that so reading from /dev/urandom always was not a good idea. FreeBSD re-uses the entropy, but the end target is Solaris so I'm not really sure about the details of /dev/urandom. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: How good is security via hashing

2011-06-08 Thread Robin Becker
eimal for stuff like that, unless the number of chars is a significant problem. Go for a more complicated encoding if you must. we have been using base62 ie 0-9A-Za-z just to reduce the name length. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: How to read barcoded value from PDF

2011-06-28 Thread Robin Becker
barcode value. So when you draw the barcode you also need to add the magic string using some prefix/postfix that allows easy extraction with pypdf or similar eg "===radamajfisa===123456789===radamajfisa===". Your text extractor should be able to find this without too much trouble. -- Ro

Re: Implicit initialization is EVIL!

2011-07-05 Thread Robin Becker
On 03/07/2011 23:21, Chris Angelico wrote: . var(0x14205359) x # Don't forget to provide an address where the object will be located x=42 did you forget to specify the memory bank and computer (and presumably planet etc etc) -molly-coddled-ly yrs- Robin Becker --

Re: Implicit initialization is EVIL!

2011-07-05 Thread Robin Becker
On 05/07/2011 16:33, nn wrote: .. Ah, I see we have a mainframe programmer among us ... :-) so long since I manipulated the switches of that old pdp-8 -anciently yrs- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: reportlab import error after dundled using py2exe

2011-07-25 Thread Robin Becker
x27;reportlab.graphics', 'reportlab.lib', 'reportlab.pdfbase', 'reportlab.pdfgen', 'reportlab.platyp

Re: arbitrary precision linear algebra

2011-03-02 Thread Robin Becker
in finite precision the eigenvalues require infinite precision. Eigenvalues are roots of a polynomial in the elements and root solving may require an infinite number of steps so it will be difficult with arbitrary matrices to keep arbitrary precision. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

Re: Generate PDF with Tamil font problem

2011-03-08 Thread Robin Becker
nvas.drawString and similar. There you need to use either unicode or a utf8 encoded byte string. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

full reload of fastcgi

2011-04-12 Thread Robin Becker
an import is required during the last request. Normally the upgrade process is supposed to move software into place and then new data and then restart the fastcgi scripts; for whatever reason the error seems to have been that the process was restarted with old data around. Any ideas? -- Ro

Re: Abandoning Python

2011-05-23 Thread Robin Becker
me kind of interfaces (contracts I think), but it needs net or mono. -- Robin Becker -- http://mail.python.org/mailman/listinfo/python-list

windows 8 versus urllib2 certificate verify

2017-09-11 Thread Robin Becker
this fail only on windows 8? -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: windows 8 versus urllib2 certificate verify

2017-09-12 Thread Robin Becker
On 12/09/2017 08:35, dieter wrote: Robin Becker writes: Certificate verification generally depends on local configuration: specifically, the set of installed trusted root certificates. I do not know about Windows, but often the root certificates installed for other packages, e.g. the browser

Re: How do I check all variables returned buy the functions exists

2017-09-20 Thread Robin Becker
; 100 loops, best of 3: 0.504 usec per loop C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(None,2,None)" "None in values" 1000 loops, best of 3: 0.0309 usec per loop C:\usr\share\robin\pythonDoc>python -m timeit -s"values=(1,2,None)" "None

Re: Even Older Man Yells At Whippersnappers

2017-09-27 Thread Robin Becker
On 20/09/2017 10:54, Chris Angelico wrote: What, you take silicon that someone else created?! ChrisA well I had germanium for flipflops and dekatron tubes with neon for counters never built anything digital with valves though -- Robin Becker -- https://mail.python.org/mailman

Re: The "loop and a half"

2017-10-04 Thread Robin Becker
l 117 C:\Python36\Lib>grep "while True" *.py | wc -l 131 C:\Python36\Lib>grep "while 1" *.py | wc -l 44 How much does the while True actually cost compared to nothing? -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-04 Thread Robin Becker
On 04/10/2017 11:57, Rhodri James wrote: On 04/10/17 10:01, Robin Becker wrote: Given the prevalence of the loop and a half idea in python I wonder why we don't have a "do" or "loop" statement to start loops without a test. See PEP 315.  Guido's rejection note is

Re: why del is not a function or method?

2017-10-18 Thread Robin Becker
take a syntax we are famillar with? It can look like a function x = 3 del(x) x Traceback (most recent call last): File "", line 1, in NameError: name 'x' is not defined -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

efficient way to get a sufficient set of identifying attributes

2017-10-19 Thread Robin Becker
about determining what tests to use? A particular problem might be dynamic in that the list may be being constructed from the probes. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: efficient way to get a sufficient set of identifying attributes

2017-10-19 Thread Robin Becker
On 19/10/2017 16:42, Stefan Ram wrote: Robin Becker writes: Presumably the information in any attribute is highest if the number of distinct occurrences is the the same as the list length and pairs of attributes are more likely to be unique, but is there some proper way

Re: efficient way to get a sufficient set of identifying attributes

2017-10-20 Thread Robin Becker
On 19/10/2017 17:50, Stefan Ram wrote: Robin Becker writes: ... this sort of makes sense for single attributes, but ignores the possibility of combining the attributes to make the checks more discerning. What I wrote also applies to compound attributes (sets of base attributes

Re: Let's talk about debuggers!

2017-10-27 Thread Robin Becker
setattr(fd, when, attrs.as_list()) error is here class Term(TermState): TS__init__ = TermState.__init__ def __init__(self, fd=0): self.TS__init__(termios.tcgetattr(fd)) self.fd = fd -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

headless python app for android/ios

2017-10-27 Thread Robin Becker
nd of background app with listening sockets etc etc? Can applications call out to the world to download updated templates and so on? Any pointers would be useful. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Templating Language

2017-12-20 Thread Robin Becker
On 17/12/2017 06:41, Abdur-Rahmaan Janhangeer wrote: Hi all, Can somebody point out to me some py-based template languages interpreters resources? Thank you ! https://bitbucket.org/rptlab/preppy -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

unicode direction control characters

2018-01-02 Thread Robin Becker
ard way to deal with these? I assume that some browser+settings combination is putting these in eg perhaps the language is normally right to left but numbers are not. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: unicode direction control characters

2018-01-02 Thread Robin Becker
On 02/01/2018 15:18, Chris Angelico wrote: On Wed, Jan 3, 2018 at 1:30 AM, Robin Becker wrote: I'm seeing some strange characters in web responses eg u'\u200e28\u200e/\u200e09\u200e/\u200e1962' for a date of birth. The code \u200e is LEFT-TO-RIGHT MARK according to unicodedata

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-10 Thread Robin Becker
http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

py2exe output flagged as malware

2018-02-28 Thread Robin Becker
hon programs to get this kind of reputation. Anyone know if the same happens with PyInstaller etc etc? -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: py2exe output flagged as malware

2018-02-28 Thread Robin Becker
On 28/02/2018 11:46, alister via Python-list wrote: On Wed, 28 Feb 2018 09:53:09 +, Robin Becker wrote: I see this has happened to others in the past. I'm using 32 bit python 2.7.10 with py2exe 3.3 on windows 7. The exes work fine, but when I try to download into windows 10 I'm g

Re: py2exe output flagged as malware

2018-02-28 Thread Robin Becker
On 28/02/2018 16:25, Hartmut Goebel wrote: Am 28.02.2018 um 16:47 schrieb Robin Becker: I upgraded pyinstaller using the very latest pip and now the version of pyinstaller at least is 3.3.1. I don't actually know how to check the validity of the installed code or the binary stubs. The cu

is mypy failing here

2022-11-24 Thread Robin Becker
py312) robin@minikat:~/devel/reportlab DC.a is supposed to be a str and I expected mypy to indicate a type error should typing work for this case? -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: is mypy failing here

2022-11-25 Thread Robin Becker
d mypy 0.910 and I still don't get an error. I'll break out the windows 10 laptop and see what happens there. You ran with the py runner. I wonder if that does something special. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: is mypy failing here

2022-11-25 Thread Robin Becker
lso finds the real typing error. So it seems the tool fails in the simplest cases if you forget some typing. Interesting that it works in windows without --strict though. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

C extension custom types in abi3 module

2022-12-08 Thread Robin Becker
like I have to use a different mechanism to setup custom types in the abi3 world. I looked in Modules/xxlimited_35.c, but that seems much more complex and provides for a type which supports GC. Are there any ABI3 examples using the old style strategy? -- Robin Becker -- https://mail.python.org

Re: C extension custom types in abi3 module

2022-12-08 Thread Robin Becker
On 08/12/2022 12:52, Robin Becker wrote: I am trying to split off reportlab C extensions to simplify installations and make use of more advanced packages. A simple extension is easily converted to being an abi3 module. However, another has a custom type which uses the old style mechanisms

lxml with python-3.12.0a5

2023-02-23 Thread Robin Becker
simple workaround. Anyone know how to get around this problem. I did try rebuilding the cpython stuff using make, but that also failed. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: lxml with python-3.12.0a5

2023-02-24 Thread Robin Becker
installing into python-3.12.0a5 I used latest lxml source and python setup.py bdist_wheel --with-cython which built without error. The installed lxml seems fine (at least for reportlab tests). -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.12.0 alpha 6 released

2023-03-09 Thread Robin Becker
Wouters Ned Deily Steve Dower -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: [RELEASE] Python 3.12.0 beta 1 released.

2023-05-25 Thread Robin Becker
On 22/05/2023 22:04, Thomas Wouters wrote: > I'm pleased to announce the release of Python 3.12 beta 1 (and feature > freeze for Python 3.12). > ... I see a major difference between 3.12.0a7 and 3.12.0b1 Basically in preppy an importer is defined to handle imports of '.prep' files. This work

Re: [RELEASE] Python 3.12.0 beta 1 released.

2023-05-25 Thread Robin Becker
On 25/05/2023 12:23, Robin Becker wrote: On 22/05/2023 22:04, Thomas Wouters wrote: > I'm pleased to announce the release of Python 3.12 beta 1 (and feature > freeze for Python 3.12). > ... I see a major difference between 3.12.0a7 and 3.12.0b1 Basically in preppy an impor

advice on debugging a segfault

2021-01-17 Thread Robin Becker
I have a segfault in the 3.10 alpha 4 when running the reportlab document generation; all the other tests seem to have worked. I would like to ask experts here how to approach getting the location of the problem. I run recent archlinux. Below is the output of a test run with -Xdev -Xtracemalloc

Re: advice on debugging a segfault

2021-01-18 Thread Robin Becker
things -- not segfaulting-ly yrs Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

idlelib re-use

2021-01-28 Thread Robin Becker
I googled in vain for instances where parts of idlelib are re-used in a simplistic way. I would like to use the editor functionality in a tkinter window and also probably run code in a subprocess. Are there any examples around that do these sorts of things? -- Robin Becker -- https

Re: idlelib re-use

2021-01-29 Thread Robin Becker
Thanks, On 28/01/2021 19:57, Terry Reedy wrote: On 1/28/2021 5:53 AM, Robin Becker wrote: I googled in vain for instances where parts of idlelib are re-used in a simplistic way. I would like to use the editor functionality in a tkinter window and also probably run code in a subprocess. Are

new match statement and types

2021-03-15 Thread Robin Becker
roduces is an A is a type <__main__.A object at 0x7fe5a2248fd0> is an A instance <__main__.B object at 0x7fe5a2248fd0> is an instance is this the right approach to this problem of distinguishing instances ? -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Python script accessing own source code

2021-05-12 Thread Robin Becker
he self writing script python find-tomorrows-lotto-numbers.py since GvR has been shown to have time traveling abilities such a script could paradoxically appear acausally. -- yrs-not-too-seriously Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Python script accessing own source code

2021-05-13 Thread Robin Becker
On 12/05/2021 20:17, Mirko via Python-list wrote: Am 12.05.2021 um 20:41 schrieb Robin Becker: ... ... since GvR has been shown to have time traveling abilities such a script could paradoxically appear acausally. -- yrs-not-too-seriously Robin Becker Not sure, if that's

error from pypa build

2021-08-05 Thread Robin Becker
uild/env.py", line 92, in __enter__ > executable, scripts_dir = _create_isolated_env_venv(self._path) > File "/home/user/devel/reportlab/.py39/lib/python3.9/site-packages/build/env.py", line 221, in _create_isolated_env_venv > pip_distribution = next(iter(metad

basic auth request

2021-08-17 Thread Robin Becker
auth value? As an additional issue I find I have no clear idea what encoding is allowed for the components of a basic auth input. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: basic auth request

2021-08-18 Thread Robin Becker
equests package or 2) setting up an opener. Both of these seem to be much more complex than is required to add the header. I thought there might be a shortcut or more elegant way to replace the old code, but it seems not thanks -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

what to do with multiple BOMs

2021-08-19 Thread Robin Becker
is xml file 014.xml ]> &e;\xef\xbb\xbfdata' which implies seems as though the extra BOM in the entity has been kept and processed into a different BOM meaning utf8. I think the test file is wrong and that multiple BOM chars in the entiry should have been removed. Am I rig

c extension finding the module in object initialization

2021-09-21 Thread Robin Becker
I might use the __module__ to locate the module object via PyImport_GetModuleDict. Any expertise or advice gratefully received. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: c extension finding the module in object initialization

2021-09-27 Thread Robin Becker
rt_GetModule, but that seems more complex than is actually required for this simple case and has to wait until 3.6 dies for me :( -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

lxml parsing with validation and target?

2021-11-02 Thread Robin Becker
I'm having a problem using lxml.etree to make a treebuilding parser that validates; I have test code where invalid xml is detected and an error raised when the line below target=ET.TreeBuilder(), is commented out. The validation error looks as expected > python tlxml.py invalid.rml re.compile(

Re: lxml parsing with validation and target?

2021-11-03 Thread Robin Becker
On 02/11/2021 12:55, Robin Becker wrote: I'm having a problem using lxml.etree to make a treebuilding parser that validates; I have test code where invalid xml is detected and an error raised when the line below target=ET.TreeBuilder(), is commented out. . I managed to overcome

preserving entities with lxml

2022-01-12 Thread Robin Becker
g xxml=b'a &mysym; &lt; &amp; &gt; &#33; A' ET.tostring(tree)=b'a &mysym; &lt; &amp; &gt; &#33; A' using attributes tree.text='a &mysym; < & > ! A' tree.getchildren()=[] tree.tail=None -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: preserving entities with lxml

2022-01-13 Thread Robin Becker
On 12/01/2022 20:49, Dieter Maurer wrote: ... when run I see this $ python tmp/tlp.py using tostring xxml=b'a &mysym; < & > ! A' ET.tostring(tree)=b'a &mysym; < & > ! A' using attributes tree.text='a &mysym; < & > ! A' tree.getchildren(

Re: preserving entities with lxml

2022-01-13 Thread Robin Becker
On 13/01/2022 09:29, Dieter Maurer wrote: Robin Becker wrote at 2022-1-13 09:13 +: On 12/01/2022 20:49, Dieter Maurer wrote: ... Apparently, the `resolve_entities=False` was not effective: otherwise, your tree content should have more structure (especially some entity reference children

lxml empty versus self closed tag

2022-03-02 Thread Robin Becker
I'm using lxml.etree.XMLParser and would like to distinguish from I seem to have e.getchildren()==[] and e.text==None for both cases. Is there a way to get the first to have e.text=='' -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: lxml empty versus self closed tag

2022-03-03 Thread Robin Becker
On 02/03/2022 18:39, Dieter Maurer wrote: Robin Becker wrote at 2022-3-2 15:32 +: I'm using lxml.etree.XMLParser and would like to distinguish from I seem to have e.getchildren()==[] and e.text==None for both cases. Is there a way to get the first to have e.text==''

strange problem building non-pure wheel for apple M1 arm64

2022-03-07 Thread Robin Becker
hing is compiled for arm64, but gcc doesn't want to use an arm64 dylib. Can macos experts assist? -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: strange problem building non-pure wheel for apple M1 arm64

2022-03-08 Thread Robin Becker
On 08/03/2022 16:08, Christian Gollwitzer wrote: Am 07.03.22 um 17:22 schrieb Robin Becker: I use brew to install freetype version 2.11.1. I find via google that homebrew/apple have split the installation of intel and arm64 into /usr/local and /opt/homebrew so I must modify the include_dirs

Re: Reportlab / platypus bug?

2022-03-15 Thread Robin Becker
many years) at https://pairlist2.pair.net/mailman/listinfo/reportlab-users is that the address you used? I see messages in the archives so some people can use it.-- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Reportlab / platypus bug?

2022-03-15 Thread Robin Becker
.. Hi Les, so far as I know the reportlab-users list is still running it is hosted (nad has been for many years) at https://pairlist2.pair.net/mailman/listinfo/reportlab-users is that the address you used? I see messages in the archives so some people can use it.-- Robin Becker

Re: Reportlab / platypus bug?

2022-03-15 Thread Robin Becker
On 15/03/2022 13:20, Les wrote: Robin Becker ezt írta (időpont: 2022. márc. 15., K, 14:06): Hi Les, so far as I know the reportlab-users list is still running it is hosted (nad has been for many years) at https://pairlist2.pair.net/mailman/listinfo/reportlab-users is that the address you

Re: How to split value where is comma ?

2016-09-08 Thread Robin Becker
upon receipt. Do you realize how stupid it is to put this on a message sent all around the world? I have worked places where they put stuff like this at the bottom of emails sent to the person sitting next to them :) -raising entropy-ly yrs- Robin Becker -- https://mail.python.org/ma

Re: [Python-ideas] Inconsistencies

2016-09-12 Thread Robin Becker
omewhat moot under such assumptions. Also presumably there are other constructions of 'our' familiar arithmetic. Perhaps someone could probably make an arithmetic where most of standard ZF is true except for 1<2. Gödel definitely says there are holes in arithmetic :) -possibly non-

Re: [RELEASE] Python 3.6.0b2 is now available

2016-10-12 Thread Robin Becker
)] on win32 Type "help", "copyright", "credits" or "license" for more information. import sys -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

htmlparser charrefs

2016-12-22 Thread Robin Becker
hat functionality safely. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: [RELEASE] Python 3.6.0 is released!

2016-12-23 Thread Robin Becker
py:81: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect warn=(impl == 'cp')): I guess this must mean I need to set something somewhere, but what? -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Enumerating all 3-tuples

2018-03-12 Thread Robin Becker
is give different outcomes, but both appear to be a correct mapping of non-negative integers to triplets. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Enumerating all 3-tuples

2018-03-12 Thread Robin Becker
On 12/03/2018 13:17, Robin Becker wrote: It's possible to generalize the cantor pairing function to triples, but that may not give you what you want. Effectively you can generate an arbitrary number of triples using an iterative method. My sample code looked like this ct mapping o

Re: Enumerating all 3-tuples

2018-03-13 Thread Robin Becker
On 12/03/2018 18:05, Chris Angelico wrote: On Tue, Mar 13, 2018 at 2:54 AM, Robin Becker wrote: On 12/03/2018 13:17, Robin Becker wrote: An alternative approach gives more orderly sequences using a variable base number construction 4 (0, 0, 1) 9 (0, 0, 1) 18 (0, 0, 2) 32 (0, 0, 2) I spy

Re: Enumerating all 3-tuples

2018-03-13 Thread Robin Becker
On 13/03/2018 11:14, Steven D'Aprano wrote: On Mon, 12 Mar 2018 13:17:15 +0000, Robin Becker wrote: It's possible to generalize the cantor pairing function to triples, but that may not give you what you want. Effectively you can generate an arbitrary number of triples using an iterat

curious asymmetry in range limiting

2018-03-20 Thread Robin Becker
or "license" for more information. >>> s = '0123456789' >>> print(repr(s[-5:5])) '' >>> print(repr(s[5:15])) '56789' >>> why is the underflow start index treated so differently from the limit index overflow? I suppose there must be some reason, but it eludes me. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: curious asymmetry in range limiting

2018-03-20 Thread Robin Becker
ght dawned :) seems the negative indexes rules apply to both On 20/03/2018 14:21, Robin Becker wrote: I don't know how I never came across this before, but there's a curious asymmetry in the way ranges are limited Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.19

Re: Enumerating all 3-tuples

2018-03-21 Thread Robin Becker
toBasics.html Since that's exactly what I need to do, that might be a problem. On the other hand, I doubt I'll need to generate more than a few thousand of these, so it might be fast enough. I guess I have to run some benchmarks to find out. But however they turn out, I appreciate your

Re: Multi-threading with a simple timer?

2018-07-03 Thread Robin Becker
signal.SIGALRM,signal.SIG_IGN) print("You entered: ", data) for i in reversed(xrange(15)): print i time.sleep(1) print 'finished!' if I leave out the signal.signal(signal.SIGALRM,signal.SIG_IGN) then the timeout function gets called anyway. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Python 3.7 configuration issue

2018-07-03 Thread Robin Becker
mp; make install Something in setup.py seems to want ctypes irrespective of what I give to configure; I don't actually know what the alternative to --with-system-ffi does, but it didn't work for me. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.7 configuration issue

2018-07-04 Thread Robin Becker
work. It might be that make silently allows extension builds to fail even if they are 'required' and that later causes an error in the install phase. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: about main()

2018-07-06 Thread Robin Becker
a compiler" and one will be provided, of course by that time they will all have forgotten about eating berries in favour of soma or equivalent. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

test for absence of infinite loop

2018-07-17 Thread Robin Becker
long, but that seems a bit flaky. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: test for absence of infinite loop

2018-07-17 Thread Robin Becker
On 17/07/2018 10:32, Chris Angelico wrote: .. All you gotta do is solve the halting problem... https://en.wikipedia.org/wiki/Halting_problem ChrisA ah so it's easy :) -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: test for absence of infinite loop

2018-07-17 Thread Robin Becker
On 17/07/2018 12:16, Cameron Simpson wrote: On 17Jul2018 10:10, Robin Becker wrote: A user reported an infinite loop in reportlab. I determined a possible cause and fix and would like to test for absence of the loop. Is there any way to check for presence/absence of an infinite loop in python

Are dicts supposed to raise comparison errors

2018-07-31 Thread Robin Becker
lity, but obviously the implementation seems to be comparing b'a' with 'a' (I suppose because they hash to the same chain). Is this code erroneous or is the warning spurious or wrong? -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Are dicts supposed to raise comparison errors

2018-07-31 Thread Robin Becker
On 31/07/2018 09:16, Paul Moore wrote: On 31 July 2018 at 08:40, Robin Becker wrote: A bitbucket user complains that python 3.6.6 with -Wall -b prints warnings for some reportlab code; the example boils down to the following ## C:\code\hg-repos\reportlab\tmp>cat tb.py if __nam

Re: Are dicts supposed to raise comparison errors

2018-08-01 Thread Robin Becker
On 31/07/2018 16:52, Chris Angelico wrote: On Wed, Aug 1, 2018 at 1:28 AM, MRAB wrote: On 2018-07-31 08:40, Robin Becker wrote: A bitbucket user complains that python 3.6.6 with -Wall -b prints warnings . The warning looks wrong to be. In Python 2, u'a' and b&#

Re: Are dicts supposed to raise comparison errors

2018-08-01 Thread Robin Becker
On 01/08/2018 09:52, Chris Angelico wrote: On Wed, Aug 1, 2018 at 6:36 PM, Robin Becker wrote: On 31/07/2018 16:52, Chris Angelico wrote: .. it says explicitly that numeric keys will use numeric comparison, but no . Technically, the comparison used is: a is b or a == b

Re: Are dicts supposed to raise comparison errors

2018-08-01 Thread Robin Becker
you let the matter rest for a day or so, and then look at it with a fresh eye. .. my bad; not worrying enough about real problems -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Are dicts supposed to raise comparison errors

2018-08-01 Thread Robin Becker
tb1.py {'a': 1, b'a': 1} {b'a': 1, 'a': 1} I expected one of the assignments to warn. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Are dicts supposed to raise comparison errors

2018-08-01 Thread Robin Becker
rom this dictionary assignment. Probably the code needs tightening so that we insist on using native strings everywhere; that's quite hard for py2/3 compatible code. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: Are dicts supposed to raise comparison errors

2018-08-02 Thread Robin Becker
to find more issues. In other cases it might detect sources of bugs, so IMHO it's better to have a close look at and possibly rewrite code that triggers the warning rather than to disable it. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   >