Re: Proposal: === and !=== operators

2014-07-11 Thread Chris Angelico
On Sat, Jul 12, 2014 at 4:11 PM, Ethan Furman wrote: > class list: > def __eq__(self, other): > if len(self) != len(other): > return False > for this, that in zip(self, other): > if this is that or this == that: > continue >

Re: Proposal: === and !=== operators

2014-07-11 Thread Ethan Furman
On 07/11/2014 10:07 PM, Alan Bawden wrote: Steven D'Aprano writes: But perhaps we only care about changes in value, not type. NAN or no NAN, list equality works fine: py> data = [1.0, 2.0, float('nan'), 4.0] py> old = data[:] py> old == data # No changes made yet, should return True True Y

Re: Error after sympy lambdify function update using vector() dot.class

2014-07-11 Thread Chris Angelico
On Sat, Jul 12, 2014 at 3:33 AM, Niklas Troedsson wrote: > I am new to the forum and programming Python. > > Recently I updated both Canopy and its packages, I am now using Canopy > 1.4.1.1975 and sympy 0.7.5-1. > This is a general Python list, not Canopy or Sympy specific. If you don't get a use

Re: Proposal: === and !=== operators

2014-07-11 Thread Torsten Bronger
Hallöchen! Torsten Bronger writes: > Alan Bawden writes: > >> [...] >> >> You lost me right here. If list equality is determined by >> comparing lists element-by-element, and the second element of old >> is _not_ equal to the second element of data, then why should old >> and data be equal? > >

Re: Proposal: === and !=== operators

2014-07-11 Thread Torsten Bronger
Hallöchen! Alan Bawden writes: > [...] > > You lost me right here. If list equality is determined by > comparing lists element-by-element, and the second element of old > is _not_ equal to the second element of data, then why should old > and data be equal? I think Python first tests for identi

Re: Proposal: === and !=== operators

2014-07-11 Thread Chris Angelico
On Sat, Jul 12, 2014 at 3:07 PM, Alan Bawden wrote: > Steven D'Aprano writes: > >> But perhaps we only care about changes in value, not type. NAN or no NAN, >> list equality works fine: >> >> py> data = [1.0, 2.0, float('nan'), 4.0] >> py> old = data[:] >> py> old == data # No changes made yet,

Re: Save/restore breakpoints between pdb runs

2014-07-11 Thread dieter
Ed Blackman writes: > I've recently started using Python for my job (as opposed to writing > smallish scripts for personal use), and so have needed to debug quite > a bit more. > > I've been using pdb mainly via 'python -m pdb script args'. Perhaps > it's my Java background, but even when I have

Re: context manager based alternative to Re: Proposal: === and !===

2014-07-11 Thread Chris Angelico
On Sat, Jul 12, 2014 at 8:37 AM, Cameron Simpson wrote: > On 11Jul2014 14:37, Chris Angelico wrote: >> >> Does C-level code have to check this flag before comparing >> nans, > > > If you mean: > > float x, y; > [...] > if (x == y) { > action... > } > > then no. > > >> or is this appli

Re: Proposal: === and !=== operators

2014-07-11 Thread Alan Bawden
Steven D'Aprano writes: > But perhaps we only care about changes in value, not type. NAN or no NAN, > list equality works fine: > > py> data = [1.0, 2.0, float('nan'), 4.0] > py> old = data[:] > py> old == data # No changes made yet, should return True > True You lost me right here. If list e

Re: Proposal: === and !=== operators

2014-07-11 Thread Steven D'Aprano
Thanks to everyone who has commented. Some responses: * I was completely mistaken about == enforcing the rule that __eq__ returns True or False. I have no idea where I got that idea from, sorry for the noise. * I disagree that having two equals operators, == and ===, would be confusing. T

Re: context manager based alternative to Re: Proposal: === and !===

2014-07-11 Thread Cameron Simpson
On 11Jul2014 14:37, Chris Angelico wrote: On Fri, Jul 11, 2014 at 11:17 AM, Roy Smith wrote: In article , Cameron Simpson wrote: [... context manager changing NaN comparisons ...] I'm a bit wary of anything that makes a global, even if temporary, change to comparisons' behaviours. What hap

Re: context manager based alternative to Re: Proposal: === and !===

2014-07-11 Thread Cameron Simpson
On 10Jul2014 17:34, Ethan Furman wrote: On 07/10/2014 05:20 PM, Cameron Simpson wrote: Here's an alternative proposal that doesn't involve a new operator. [snip float-context manager stuff] Decimal has a context manager like that already (I don't know if it supports allowing NaNs to equal ea

Save/restore breakpoints between pdb runs

2014-07-11 Thread Ed Blackman
I've recently started using Python for my job (as opposed to writing smallish scripts for personal use), and so have needed to debug quite a bit more. I've been using pdb mainly via 'python -m pdb script args'. Perhaps it's my Java background, but even when I have permissions to change the s

Error after sympy lambdify function update using vector() dot.class

2014-07-11 Thread Niklas Troedsson
I am new to the forum and programming Python. Recently I updated both Canopy and its packages, I am now using Canopy 1.4.1.1975 and sympy 0.7.5-1. In an earlier version my code to solve algebra and substitute a lot of constants and transfer functions with more than 1001 frequency points worked.

Re: Hello. I'm new here...

2014-07-11 Thread Chris Angelico
On Fri, Jul 11, 2014 at 9:00 PM, Antonio Dalvit wrote: > Im Antonio, from Italy. I'm new here and i'd like to introduce myself: i'm > learning python language after years working in ICT sector. I decided to > study python after fortran basic, c++, java and php for fun and because i'm > tired to

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-11 Thread Albert-Jan Roskam
- Original Message - > From: Steven D'Aprano > To: python-list@python.org > Cc: > Sent: Friday, July 11, 2014 11:04 AM > Subject: Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example > > On Thu, 10 Jul 2014 23:33:27 -0400, Roy Smith wrote: > >> In article , >>   Tim Chase

Re: Standard library Help

2014-07-11 Thread Neil D. Cerutti
On 7/11/2014 4:53 AM, Wolfgang Maier wrote: On 07/11/2014 10:32 AM, Nicholas Cannon wrote: Hey i would like to know alot more about the standard library and all of its functions and so on and i know it is huge and i would basically like to learn only the useful stuff that i could use and all of

Re:Hello. I'm new here...

2014-07-11 Thread Dave Angel
Antonio Dalvit Wrote in message: > Hello! > > Im Antonio, from Italy. I'm new here and i'd like to introduce myself: i'm > learning python language after years working in ICT sector. I decided to > study python after fortran basic, c++, java and php for fun and because i'm > tired to spend lin

Hello. I'm new here...

2014-07-11 Thread Antonio Dalvit
Hello! Im Antonio, from Italy. I'm new here and i'd like to introduce myself: i'm learning python language after years working in ICT sector. I decided to study python after fortran basic, c++, java and php for fun and because i'm tired to spend lines and lines of code to make something working

Re: how can i get "body" values?

2014-07-11 Thread marco . nawijn
On Friday, July 11, 2014 11:37:17 AM UTC+2, Frank Liou wrote: > how can i get body values use variable to Separate catch? > > > > https://lh3.googleusercontent.com/-6Ywp4GukuCM/U7-vhF0nzuI/Bv4/Ovcr1O2FScs/s1600/321.jpg > > > > i want to catch name and key values > > > > now i use r

how can i get "body" values?

2014-07-11 Thread Frank Liou
how can i get body values use variable to Separate catch? https://lh3.googleusercontent.com/-6Ywp4GukuCM/U7-vhF0nzuI/Bv4/Ovcr1O2FScs/s1600/321.jpg i want to catch name and key values now i use request.data i can catch all the body but how can i use variable to separate and catch? --

Re:base64 convert to binary by binascii is that right?

2014-07-11 Thread Dave Angel
Frank Liou Wrote in message: > conn = engine.connect() > encoded = base64.b64encode(getbody) > binary_string = binascii.a2b_base64(encoded) > puresql = sqla.text("INSERT INTO friends(name) VALUES(:binary_string)") > conn.execute(puresql,binary_string = binary_string) > > Sta

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-11 Thread Steven D'Aprano
On Thu, 10 Jul 2014 23:33:27 -0400, Roy Smith wrote: > In article , > Tim Chase wrote: > >> On 2014-07-10 22:18, Roy Smith wrote: >> > > Outside this are \( and \): these are literal opening and closing >> > > bracket characters. So: >> > > >> > >\(\([^)]+\)\) >> > >> > although, even bett

Re: Standard library Help

2014-07-11 Thread Wolfgang Maier
On 07/11/2014 10:32 AM, Nicholas Cannon wrote: Hey i would like to know alot more about the standard library and all of its functions and so on and i know it is huge and i would basically like to learn only the useful stuff that i could use and all of those features. i have been looking around

Re: Standard library Help

2014-07-11 Thread Ben Finney
Nicholas Cannon writes: > Hey i would like to know alot more about the standard library and all > of its functions and so on Welcome! This is a good goal, familiarity with the standard library is a very important way to save yourself time in programming. > and i know it is huge and i would basi

python app hosting

2014-07-11 Thread Jorge Alberto Díaz Orozco
Hi, I'm looking for some server to host an xmlrpc server app I've made. Can someone help me find any? VII Escuela Internacional de Verano en la UCI del 30 de junio al 11 de julio de 2014. Ver www.uci.cu -- https://mail.python.org/mailman/listinfo/python-list

Re: Standard library Help

2014-07-11 Thread Steven D'Aprano
On Fri, 11 Jul 2014 01:32:32 -0700, Nicholas Cannon wrote: > Hey i would like to know alot more about the standard library and all of > its functions and so on and i know it is huge and i would basically like > to learn only the useful stuff that i could use and all of those > features. i have bee

Re: Standard library Help

2014-07-11 Thread marco . nawijn
On Friday, July 11, 2014 10:32:32 AM UTC+2, Nicholas Cannon wrote: > Hey i would like to know alot more about the standard library and all of its > functions and so on and i know it is huge and i would basically like to learn > only the useful stuff that i could use and all of those features. i h

Standard library Help

2014-07-11 Thread Nicholas Cannon
Hey i would like to know alot more about the standard library and all of its functions and so on and i know it is huge and i would basically like to learn only the useful stuff that i could use and all of those features. i have been looking around and i cant really find anything so i wondering i

ANN: eGenix mx Base Distribution 3.2.8 (mxDateTime, mxTextTools, etc.)

2014-07-11 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mx Base Distribution mxDateTime, mxTextTools, mxProxy, mxURL, mxUID, mxBeeBase, mxStack, mxQueue, mxTools Version 3.2.8

Re: How to decipher :re.split(r"(\(\([^)]+\)\))" in the example

2014-07-11 Thread alister
On Thu, 10 Jul 2014 23:33:27 -0400, Roy Smith wrote: > In article , > Tim Chase wrote: > >> On 2014-07-10 22:18, Roy Smith wrote: >> > > Outside this are \( and \): these are literal opening and closing >> > > bracket characters. So: >> > > >> > >\(\([^)]+\)\) >> > >> > although, even bett

base64 convert to binary by binascii is that right?

2014-07-11 Thread Frank Liou
conn = engine.connect() encoded = base64.b64encode(getbody) binary_string = binascii.a2b_base64(encoded) puresql = sqla.text("INSERT INTO friends(name) VALUES(:binary_string)") conn.execute(puresql,binary_string = binary_string) first getbody trans to base64 then i convert t