Re: [Tutor] Behavior of dictionary in mapping keys that evaluate equal

2016-05-11 Thread Steven D'Aprano
On Wed, May 11, 2016 at 02:00:47PM +0100, khalil zakaria Zemmoura wrote: > Hi, > > Suppose we have a dict > Dic = { True: 'yes', 1: 'No'} > > According to the Python 3 documentation, the keys must have a unique value > so True is converted to integer because of the type coercion (boolean are >

Re: [Tutor] Behavior of dictionary in mapping keys that evaluate equal

2016-05-11 Thread cs
On 11May2016 14:00, khalil zakaria Zemmoura wrote: Suppose we have a dict Dic = { True: 'yes', 1: 'No'} According to the Python 3 documentation, the keys must have a unique value so True is converted to integer because of the type coercion (boolean are subtype of

[Tutor] Behavior of dictionary in mapping keys that evaluate equal

2016-05-11 Thread khalil zakaria Zemmoura
Hi, Suppose we have a dict Dic = { True: 'yes', 1: 'No'} According to the Python 3 documentation, the keys must have a unique value so True is converted to integer because of the type coercion (boolean are subtype of integer) so boolean are winded to integer to be compared. Am I missing

Re: [Tutor] postgreSQL + psycopg2

2016-05-11 Thread Danny Yoo
On Tue, May 10, 2016 at 10:37 PM, nitin chandra wrote: > Thank you Danny, Alan, > > @ Danny > > I added 'str(formt(line1[0]))' will this do ? Unfortunately, I don't know: what makes me hesitant is the following: * The above is doing something just to line1[0],