Re: more python3 regex?

2016-09-11 Thread Doug OLeary
Hey, all; The print suggestion was the key clue. Turned out my loop was slurping the whole of data in one big line. Searching for a line that begins with Name when it's in the middle of the string is... obviously not going to work so well. Took me a bit to get that working and, once I did, I

Re: [Python-ideas] Inconsistencies

2016-09-11 Thread MRAB
On 2016-09-12 03:26, Chris Angelico wrote: On Mon, Sep 12, 2016 at 12:04 PM, Lawrence D’Oliveiro wrote: On Monday, September 12, 2016 at 1:11:39 PM UTC+12, Chris Angelico wrote: I have some _extremely_ strong views about absolutes (they come from the Creator of the Universe) ... By “Universe

Re: mssql date format

2016-09-11 Thread Chris Angelico
On Mon, Sep 12, 2016 at 11:15 AM, MRAB wrote: > On 2016-09-12 01:37, sum abiut wrote: >> >> Hi, >> I am pulling data from an mssql server database and got a date in this >> format: 733010 >> please advise what of date is this and how to i convert it to a readable >> date? >> >> i use pyssql to con

Re: [Python-ideas] Inconsistencies

2016-09-11 Thread Chris Angelico
On Mon, Sep 12, 2016 at 12:04 PM, Lawrence D’Oliveiro wrote: > On Monday, September 12, 2016 at 1:11:39 PM UTC+12, Chris Angelico wrote: >> I have some _extremely_ strong views about absolutes (they come from the >> Creator of the Universe) ... > > By “Universe” do you mean “everything that exists

Re: more python3 regex?

2016-09-11 Thread Lawrence D’Oliveiro
On Monday, September 12, 2016 at 6:21:57 AM UTC+12, Peter Otten wrote: > By the way, many simple text-processing problems can be solved without > regular expressions. The old JWZ quote instantly comes to mind... -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-ideas] Inconsistencies

2016-09-11 Thread Lawrence D’Oliveiro
On Monday, September 12, 2016 at 1:11:39 PM UTC+12, Chris Angelico wrote: > I have some _extremely_ strong views about absolutes (they come from the > Creator of the Universe) ... By “Universe” do you mean “everything that exists”? So if the Creator exists, then the Creator, too, must be part of

Re: mssql date format

2016-09-11 Thread MRAB
On 2016-09-12 01:37, sum abiut wrote: Hi, I am pulling data from an mssql server database and got a date in this format: 733010 please advise what of date is this and how to i convert it to a readable date? i use pyssql to connect to the database and pull data fro the database. Does the date "

Re: [Python-ideas] Inconsistencies

2016-09-11 Thread Chris Angelico
On Mon, Sep 12, 2016 at 6:30 AM, Sven R. Kunze wrote: > > I could not agree more with what you said above, so I hope this will put the > discussion in better perspective, especially when people here trying to be > overly absolute in their views (which was the quote about). > Strange that you thin

mssql date format

2016-09-11 Thread sum abiut
Hi, I am pulling data from an mssql server database and got a date in this format: 733010 please advise what of date is this and how to i convert it to a readable date? i use pyssql to connect to the database and pull data fro the database. thanks in advance, cheers -- https://mail.python.org/m

Re: [Python-ideas] Inconsistencies

2016-09-11 Thread Sven R. Kunze
On 10.09.2016 15:00, Chris Angelico wrote: Some things are absolute hard facts. There is no way in which 1 will ever be greater than 2, ergo "1 is less than 2" is strictly true, and not a matter of opinion. If you hear someone trying to claim otherwise, would you let him have his opinion, or woul

Re: pymssql

2016-09-11 Thread sum abiut
Thanks heaps for your comments, manage to get it work using the as_dict` parameter of the `cursor` object, cus=conn.cursor(as_dict=True) cus.execute("SELECT budget_code,budget_description,rate_type FROM glbud") for row in cus: print(row['budget_code'],row['budget_description'],row['rate_type']

Re: iterating over multi-line string

2016-09-11 Thread Terry Reedy
On 9/11/2016 11:34 AM, Doug OLeary wrote: Hey; I have a multi-line string that's the result of reading a file filled with 'dirty' text. I read the file in one swoop to make data cleanup a bit easier - getting rid of extraneous tabs, spaces, newlines, etc. That part's done. Now, I want to co

Re: Python source repo

2016-09-11 Thread Terry Reedy
On 9/10/2016 11:27 AM, Steve D'Aprano wrote: On Sun, 11 Sep 2016 01:04 am, Steve D'Aprano wrote: I ran hg fetch to update the CPython repo. I use pull (to local repository) and update (working directory) separately in the following script (pull.bat), based on either the devguide or what Tor

sphinx (or other means to document python)

2016-09-11 Thread chitturk
Excuse me for being frustrated (!) (with documenting python with Sphinx) I have a source file myfile.py which contains documentation with "docstrings" I am trying to have Sphinx create the pdf (from latex) I have run through sphinx-quickstart - which creates build, source (there is some conf.py

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Nagy László Zsolt
> Yes, the get part works. The set part is a pain, and a bit ugly: > > super(B, B).foo.__set__(self, value) > > There is an issue for this on the tracker: > http://bugs.python.org/issue14965 > Thank you Ethan! The superprop pure Python implementation is very promising. ( http://bugs.python.or

Re: more python3 regex?

2016-09-11 Thread Peter Otten
Doug OLeary wrote: > Hey > > This one seems like it should be easy but I'm not getting the expected > results. > > I have a chunk of data over which I can iterate line by line and print out > the expected results: > > for l in q.findall(data): > # if re.match(r'(Name|")', l): > # contin

Re: iterating over multi-line string

2016-09-11 Thread Peter Otten
Doug OLeary wrote: > Hey; > > I have a multi-line string that's the result of reading a file filled with > 'dirty' text. I read the file in one swoop to make data cleanup a bit > easier - getting rid of extraneous tabs, spaces, newlines, etc. That > part's done. > > Now, I want to collect data

more python3 regex?

2016-09-11 Thread Doug OLeary
Hey This one seems like it should be easy but I'm not getting the expected results. I have a chunk of data over which I can iterate line by line and print out the expected results: for l in q.findall(data): # if re.match(r'(Name|")', l): # continue print(l) $ ./testies.py | wc -l 1

Re: iterating over multi-line string

2016-09-11 Thread Doug OLeary
Hey; Never mind; I finally found the meaning of stopiteration. I guess my google-foo is a bit weak this morning. Thanks Doug -- https://mail.python.org/mailman/listinfo/python-list

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Ethan Furman
On 09/11/2016 08:28 AM, Peter Otten wrote: Nagy László Zsolt wrote: Yes, I believe it does. (Others may disagree. This is a design question and very much a matter of style, not hard fact.) I would have an explicit action "set_content" which will set the value of an input field, the inner text

iterating over multi-line string

2016-09-11 Thread Doug OLeary
Hey; I have a multi-line string that's the result of reading a file filled with 'dirty' text. I read the file in one swoop to make data cleanup a bit easier - getting rid of extraneous tabs, spaces, newlines, etc. That part's done. Now, I want to collect data in each section of the data. Sec

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Peter Otten
Nagy László Zsolt wrote: > >> Yes, I believe it does. (Others may disagree. This is a design >> question and very much a matter of style, not hard fact.) I would have >> an explicit action "set_content" which will set the value of an input >> field, the inner text of a textarea, the checked state

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Nagy László Zsolt
Yes, I believe it does. (Others may disagree. This is a design question and very much a matter of style, not hard fact.) I would have an explicit action "set_content" which will set the value of an input field, the inner text of a textarea, the checked state of a check box, etc. In other words,

Re: How to split value where is comma ?

2016-09-11 Thread Andrea D'Amore
On 2016-09-08 09:27:20 +, Joaquin Alzola said: Cannot do anything about it. It is not on my MTA client and it is added by the company server :( If it depended on my I will remove it but I can not do that. This email is confidential and may be subject to privilege. If you are not the inten

Re: How to split value where is comma ?

2016-09-11 Thread Chris Angelico
On Thu, Sep 8, 2016 at 7:27 PM, Joaquin Alzola wrote: >>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 > > Cannot do anything about it. It is not on my MTA client and it is added by

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Chris Angelico
On Sun, Sep 11, 2016 at 9:31 PM, Nagy László Zsolt wrote: > The "value of a form field" must have a unified interface. So when I do > " textfield.value = some_value " then I expect that the changed value > will be represented on the UI *if it has an UI representation*. The > widget needs to be abl

RE: How to split value where is comma ?

2016-09-11 Thread Joaquin Alzola
>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 Cannot do anything about it. It is not on my MTA client and it is added by the company server :( If it depended on my I will remove i

Re: Override property setter of base class in Python 3

2016-09-11 Thread Chris Angelico
On Sun, Sep 11, 2016 at 9:17 PM, Nagy László Zsolt wrote: >> Subclassing and overriding are part of the interface of a class, >> albeit an interface that only a subset of other classes will use. >> Think carefully about why, if this is meant to be made available, it >> isn't simply a method call.

Re: Override property setter of base class in Python 3 - USE CASE

2016-09-11 Thread Nagy László Zsolt
> Even the problem seems to rather defeat the purpose of a property. A > property should be very simple - why do you need to override it and > call super()? Doesn't this rather imply that you've gone beyond the > normal use of properties *already*? Here are some of my classes that can represent da

Re: Override property setter of base class in Python 3

2016-09-11 Thread Nagy László Zsolt
> Even the problem seems to rather defeat the purpose of a property. A > property should be very simple - why do you need to override it and > call super()? Doesn't this rather imply that you've gone beyond the > normal use of properties *already*? I'm not sure about that. I'm going to send a USE

Re: Override property setter of base class in Python 3

2016-09-11 Thread Chris Angelico
On Sun, Sep 11, 2016 at 8:02 PM, Nagy László Zsolt wrote: > But this solution almost defeats the purpose of properties. E.g. a > property should look like an attribute, and its behaviour should be > manipulated through its name (and not another special method that must > be exposed to subclasses.)

Re: Override property setter of base class in Python 3

2016-09-11 Thread Nagy László Zsolt
By the way, I know that I can use a "property virtualizer", something like this: import inspect class A: def __init__(self, prop=0): self.__prop = prop def _prop_get(self): return self.__prop def _prop_set(self, value): self.prop_set(value)

Override property setter of base class in Python 3

2016-09-11 Thread Nagy László Zsolt
Example code: class A: def __init__(self, prop=0): self.__prop = prop @property def prop(self): return self.__prop @prop.setter def prop(self, value): self.__prop = value class B(A): @A.prop.setter def prop(self, value): print

Re: Python source repo

2016-09-11 Thread Andrea D'Amore
On 2016-09-10 15:27:07 +, Steve D'Aprano said: Never mind. I got bored and frustrated and Ctrl-C'ed the process and ran it again. This time it took about 15 seconds to complete. Out of curiosity I checked for python debugger with "attach" feature (aking to gdb/lldb) and I found a few but