Re: Clarification on Immutability please

2020-01-21 Thread Stephen Tucker
Oh dear, I am sorry. I have created quite a storm. Moreover, I am sorry because I misremembered what I had typed into Idle. My original tuple only had two elements, not three, so the slicing [:2] didn't affect the tuple at all - and so the second id() gave the same address as the first one. So, y

Re: Fun with IO

2020-01-21 Thread Frank Millman
On 2020-01-21 6:17 PM, Maxime S wrote: Hi, Le ven. 17 janv. 2020 à 20:11, Frank Millman a écrit : It works perfectly. However, some pdf's can be large, and there could be concurrent requests, so I wanted to minimise the memory footprint. So I tried passing the client_writer directly to the h

Re: Sandboxing eval()

2020-01-21 Thread Frank Millman
On 2020-01-21 3:14 PM, inhahe wrote: I have written a simple parser/evaluator that is sufficient for my simple requirements, and I thought I was safe. Then I saw this comment in a recent post by Robin Becker of ReportLab - "avoiding simple things like ' '*(10**200) seems quite difficult"

Re: Clarification on Immutability please

2020-01-21 Thread Michael Torrie
On 1/21/20 6:52 PM, Ethan Furman wrote: > On 01/21/2020 10:55 AM, Michael Torrie wrote: > >> Slicing >> returns a new object whether one is slicing a tuple, list, or a string, >> the latter two are mutable objects. > > Strings are not mutable. Yup I got my items in the wrong order. I meant to sa

Re: Clarification on Immutability please

2020-01-21 Thread MRAB
On 2020-01-22 01:52, Ethan Furman wrote: On 01/21/2020 10:55 AM, Michael Torrie wrote: Slicing returns a new object whether one is slicing a tuple, list, or a string, the latter two are mutable objects. Strings are not mutable. In the case of tuples and strings, if the slicing encompasses th

Re: Clarification on Immutability please

2020-01-21 Thread Ethan Furman
On 01/21/2020 10:55 AM, Michael Torrie wrote: Slicing returns a new object whether one is slicing a tuple, list, or a string, the latter two are mutable objects. Strings are not mutable. -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: Clarification on Immutability please

2020-01-21 Thread Jon Ribbens via Python-list
On 2020-01-21, Chris Angelico wrote: > On Wed, Jan 22, 2020 at 8:01 AM Jon Ribbens via Python-list > wrote: >> On 2020-01-21, Chris Angelico wrote: >> > On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker >> > wrote: >> >> I am left concluding that mytup is not actually a tuple (even though type >>

Re: Clarification on Immutability please

2020-01-21 Thread Cameron Simpson
On 22Jan2020 09:15, Cameron Simpson wrote: It doesn't say anything about the contents of the internal objects: >>> mytup = (1, [2, 3], (4, 5)) [...] >>> mytupl[1] = [7, 8] Traceback (most recent call last): File "", line 1, in NameError: name 'mytupl' is not defined Please igno

Re: Clarification on Immutability please

2020-01-21 Thread Cameron Simpson
On 21Jan2020 17:40, Stephen Tucker wrote: I am sure this has been answered many times before, but I need to ask it again. Given that the following is valid Python 2.7.10 (when keyboarded into Idle): mytup = ("q", "w", "e") id(mytup) mytup = mytup [:2] id(mytup) and even that the first id(myt

Re: Clarification on Immutability please

2020-01-21 Thread Chris Angelico
On Wed, Jan 22, 2020 at 8:01 AM Jon Ribbens via Python-list wrote: > > On 2020-01-21, Chris Angelico wrote: > > On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker > > wrote: > >> I am left concluding that mytup is not actually a tuple (even though type > >> (mytup) tells me that it is). > > > > If

Re: Clarification on Immutability please

2020-01-21 Thread Jon Ribbens via Python-list
On 2020-01-21, Chris Angelico wrote: > On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker wrote: >> I am left concluding that mytup is not actually a tuple (even though type >> (mytup) tells me that it is). > > If type(mytup) is tuple, then mytup really truly is a tuple. There is > no other conclusio

Re: tkinter - Changing the fontsize for the window and its widgets ?

2020-01-21 Thread R.Wieser
Terry, > A physically large display should have physically larger pixels, but see > below. :-) Although the width of the monitor on which the default font size is used is 47 cm and that of the TV is 81, the distance to the monitor is about 65 cm, while the distance to the TV is about 2.5 mete

Re: tkinter treeview widget - bind doubleclick to items only ?

2020-01-21 Thread R.Wieser
MRAB, > Huh, I never noticed that! Yep. And as that unfolding and folding is fully done inside the treeview widget itself there is no way you can fix it with a bit of python code. :-( > I think it's an issue with Tk itself. Most likely.Rather odd that that issue it still exists though. I

Re: Fun with IO

2020-01-21 Thread AAKASH JANA
i mean numba instead of number ☺ On Wed, 22 Jan 2020, 1:34 am AAKASH JANA i have been fairly confused as to what would be the best option for an all > in all python compiler (i am talking the cpython , number type compiler) to > use for basic projects. Like sorting and searching algorithms to be

ANN: Wing Python IDE 7.2 released

2020-01-21 Thread Wingware
Wing 7.2 has been released. This version adds auto-formatting with Black and YAPF, expanded support for virtualenv, support for Anaconda environments, easier debugging of modules launched with python -m, simplified manually configured remote debugging, and other improvements. == Auto-Reformat

Re: Fun with IO

2020-01-21 Thread AAKASH JANA
i have been fairly confused as to what would be the best option for an all in all python compiler (i am talking the cpython , number type compiler) to use for basic projects. Like sorting and searching algorithms to be replicated without use of any builtins. Please help On Tue, 21 Jan 2020, 9:52 p

Re: Clarification on Immutability please

2020-01-21 Thread Chris Angelico
On Wed, Jan 22, 2020 at 5:56 AM Michael Torrie wrote: > > On 1/21/20 11:38 AM, Chris Angelico wrote: > > Are you sure that it does? I can't reproduce this. When you slice the > > first two from a tuple, you create a new tuple, and until the > > assignment happens, both the new one and the original

Re: Clarification on Immutability please

2020-01-21 Thread Michael Torrie
On 1/21/20 11:38 AM, Chris Angelico wrote: > Are you sure that it does? I can't reproduce this. When you slice the > first two from a tuple, you create a new tuple, and until the > assignment happens, both the new one and the original coexist, which > means they MUST have unique IDs. And furthermo

Re: tkinter treeview widget - bind doubleclick to items only ?

2020-01-21 Thread MRAB
On 2020-01-21 06:30, R.Wieser wrote: MRAB, self.treeview.bind('', self.on_dclick) That is what I used. Doubleclicking on the heading caused the "on_dclick" code to execute, though initially the ".identify()" call in my code returns an empty ID (no row present at the location I clicked). Tha

Re: Clarification on Immutability please

2020-01-21 Thread Chris Angelico
On Wed, Jan 22, 2020 at 4:42 AM Stephen Tucker wrote: > > Hi Python-list folk, > > I am sure this has been answered many times before, but I need to ask it > again. > > Given that the following is valid Python 2.7.10 (when keyboarded into Idle): > > mytup = ("q", "w", "e") > id(mytup) > mytup = my

Re: tkinter - Changing the fontsize for the window and its widgets ?

2020-01-21 Thread Terry Reedy
On 1/21/2020 7:03 AM, R.Wieser wrote: Hello all, I've got a small tkinter based program showing (among others) a treeview. I would like to set the default font for the whole window to something larger, as its supposed to be displayed on a TV a few meters away from the user. A physically large

Clarification on Immutability please

2020-01-21 Thread Stephen Tucker
Hi Python-list folk, I am sure this has been answered many times before, but I need to ask it again. Given that the following is valid Python 2.7.10 (when keyboarded into Idle): mytup = ("q", "w", "e") id(mytup) mytup = mytup [:2] id(mytup) and even that the first id(mytup) returns the same add

Re: Fun with IO

2020-01-21 Thread Maxime S
Hi, Le ven. 17 janv. 2020 à 20:11, Frank Millman a écrit : > It works perfectly. However, some pdf's can be large, and there could be > concurrent requests, so I wanted to minimise the memory footprint. So I > tried passing the client_writer directly to the handler - > > await pdf_handler(

Re: TensorFlow with 3.8.1

2020-01-21 Thread Jason Friedman
You have another thread on this list that refers to general Python installation issues, so you'll need to work through that. I'm writing in this thread to say that tensorflow does not (today) support Python 3.8, you'll want to try 3.7, assuming that tensorflow is a critical piece for you: https://

Re: Sandboxing eval()

2020-01-21 Thread inhahe
> I have written a simple parser/evaluator that is sufficient for my > simple requirements, and I thought I was safe. > > Then I saw this comment in a recent post by Robin Becker of ReportLab - > > "avoiding simple things like ' '*(10**200) seems quite difficult" > > I realised that my method

tkinter - Changing the fontsize for the window and its widgets ?

2020-01-21 Thread R.Wieser
Hello all, I've got a small tkinter based program showing (among others) a treeview. I would like to set the default font for the whole window to something larger, as its supposed to be displayed on a TV a few meters away from the user. A few problems: 1) I have not been able to find any info

Re: Sandboxing eval()

2020-01-21 Thread Greg Ewing
On 21/01/20 6:57 pm, mus...@posteo.org wrote: If I start with empty global and local dicts, and an empty __builtins__, and I screen the input string so it can't contain the string "import", is it still possible to have "targeted" malicious attacks? Yes. Python 3.7.3 (default, Apr 8 2019, 22:2