Re: Python 3 raising an error where Python 2 did not

2016-08-26 Thread d...@forestfield.co.uk
Thanks for the replies. My example seems to be from the fairly harmless end of 
a wedge of behaviours that are being handled much more sensibly in Python 3.


-- 
https://mail.python.org/mailman/listinfo/python-list


Python 3 raising an error where Python 2 did not

2016-08-26 Thread d...@forestfield.co.uk
In a program I'm converting to Python 3 I'm examining a list of divisor values, 
some of which can be None, to find the first with a value greater than 1.

Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> None > 1
False

Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> None > 1
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unorderable types: NoneType() > int()

I can live with that but I'm curious why it was decided that this should now 
raise an error.

David Hughes
Forestfield Software
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: make an object read only

2016-08-02 Thread d...@forestfield.co.uk
On Tuesday, 2 August 2016 16:13:01 UTC+1, Robin Becker  wrote:
> A reportlab user found he was doing the wrong thing by calling canvas.save 
> repeatedly, our documentation says you should not use Canvas objects after 
> the 
> save method has been used. The user had mixed results :(
> 
> It would be better to make the canvas object completely immutable all the way 
> down when save has been called, ..
> 
> Is there a way to recursively turn everything immutable?
> -- 
> Robin Becker

Years ago I contributed a recipe to the O'Reilly Python Cookbook, 2nd Ed - 6.12 
Checking an Instance for any State Changes. My original submission was rather 
more naive than that but Alex Martelli, one of the editors, rather took a fancy 
to the idea and knocked into the more presentable shape that got published. I'm 
wondering whether there would be any way of turning this idea around to achieve 
what you want.
--
Regards
David Hughes
Forestfield Software
-- 
https://mail.python.org/mailman/listinfo/python-list


Frozen apps (py2exe, cx_freeze) built with Python 3.5

2015-12-04 Thread d...@forestfield.co.uk
Python 3.5 will not run under Windows XP, but what about applications created 
using py2exe or cx_freeze under Windows 7, 8 or 10, is there any knowledge of 
whether they will run under XP?

Regards,
David Hughes
Forestfield Software
-- 
https://mail.python.org/mailman/listinfo/python-list