On 03/11/2014 08:25 PM, Terry Reedy wrote:
On 3/11/2014 10:01 PM, Rick Johnson wrote:
On Thursday, February 27, 2014 4:18:01 PM UTC-6, Ian wrote:
x += y is meant to be equivalent, except possibly in-place and
more efficient, than x = x + y.
The manual actually says "An augmented assignment e
Christopher Welborn wrote:
> On 03/06/2014 02:22 PM, teddyb...@gmail.com wrote:
>> I am using beautifulsoup to get the title and date of the website.
>> title is working fine but I am not able to pull the date. Here is the
>> code in the url:
>>
>> October 22, 2011
>>
>> In Python, I am using th
Op 11-03-14 00:24, Roy Smith schreef:
> In article <8761nmrnfk@elektro.pacujo.net>,
> Marko Rauhamaa wrote:
>
>> Anyway, this whole debate is rather unnecessary since every developer is
>> supposed to have both weapons in their arsenal.
> The problem with having a choice is that it opens up
Op 12-03-14 07:28, Steven D'Aprano schreef:
> On Tue, 11 Mar 2014 23:25:19 -0400, Terry Reedy wrote:
>
>> Nope, 'similar' is not 'equivalent'. Evaluating x twice instead of once
>> and possibly allocating a new object versus not take extra time. In a
>> statement like "x.y.z[3*n+m] += 1", calculati
On Wed, Mar 12, 2014 at 12:28 AM, Steven D'Aprano wrote:
> On Tue, 11 Mar 2014 23:25:19 -0400, Terry Reedy wrote:
>> Nope, 'similar' is not 'equivalent'. Evaluating x twice instead of once
>> and possibly allocating a new object versus not take extra time. In a
>> statement like "x.y.z[3*n+m] += 1
On Wed, Mar 12, 2014 at 3:39 AM, Antoon Pardon
wrote:
> The documentation is wrong at that point as the following code illustrates.
Either way it still has to do a getitem and a setitem, but if you have
a more nested structure then the extra getitems are not repeated. For
example, using your log
On Tue, Mar 11, 2014 at 5:38 PM, Chris Angelico wrote:
> On Wed, Mar 12, 2014 at 10:18 AM, Marko Rauhamaa wrote:
>> Chris Angelico :
>>
>>> What corner cases are there with threads that you don't have with
>>> anything else?
>>
>> There are numerous. Here's one example: deadlocks due to two threa
Hi
I use logging.handlers.SMTPHandler and i have tried to change subject of mail.
Are there exists easy way to do that ?
Subject of mail can change repeatedly depends on content of mail.
Eras
--
https://mail.python.org/mailman/listinfo/python-list
On 12 March 2014 03:25, Terry Reedy wrote:
> On 3/11/2014 10:01 PM, Rick Johnson wrote:
>>
>>
>> On Thursday, February 27, 2014 4:18:01 PM UTC-6, Ian wrote:
>>>
>>> x += y is meant to be equivalent, except possibly in-place and
>>> more efficient, than x = x + y.
>
>
> The manual actually says "An
Eras,
You have to override getSubject method of SMTPHandler.
http://hg.python.org/cpython/file/677327810121/Lib/logging/handlers.py#l907
Thanks.
Andriy Kornatskyy
On Mar 12, 2014, at 12:08 PM, eras.rasmu...@gmail.com wrote:
> Hi
>
> I use logging.handlers.SMTPHandler and i have tried to chan
On 03/11/2014 08:36 PM, Terry Reedy wrote:
On 3/11/2014 6:13 PM, John Gordon wrote:
In Ethan Furman
writes:
if missing:
raise ValueError('invoices %r missing from batch' % missing)
It's been a while since I wrote test cases, but I recall using the assert*
methods (
Grant Edwards wrote:
> On 2014-03-11, Antoine Pitrou wrote:
>> Sturla Molden gmail.com> writes:
>>>
>>> Chris Withers simplistix.co.uk> wrote:
>>> > Hi All,
>>> >
>>> > I see python now has a plethora of async frameworks and I need to try
>>> > and pick one to use from:
>>> >
>>> > - asyncio
Op 12-03-14 10:51, Ian Kelly schreef:
> On Wed, Mar 12, 2014 at 3:39 AM, Antoon Pardon
> wrote:
>> The documentation is wrong at that point as the following code illustrates.
> Either way it still has to do a getitem and a setitem, but if you have
> a more nested structure then the extra getitems
Hi,
locale.getlocale() sometimes returns (None, None) under OSX (Python 2, not sure
about Python 3, but I think so). The problem is outlined here:
http://stackoverflow.com/questions/1629699/locale-getlocale-problems-on-osx
What is the cause of this? Is it limited to just Darwin systes? Does the
Hi!
I would like to assure that when writing to a file I do not overwrite an
existing file, but I'm unsure which is the best way to approach to this
problem. As I can see, there are at least two possibilities:
1. I could use fd = os.open("x", os.O_WRONLY | os.O_CREAT | os.O_EXCL)
which will f
It works. Thank you :)
Eras
--
https://mail.python.org/mailman/listinfo/python-list
This seems to be an application-level decision. If so, in your
application, why not just check to see if the file exists, and
implement whatever workaround you deem correct for your needs? For
example (to choose a simple, but rather silly, file naming strategy):
fname = "x"
while os.path.exists(fn
Hi,
I am using Thread class to create threads.
thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3="val"])
thread.start()
This code is throwing compilation error(Ipython).
In [19]: import threading
In [20]: def Fun(agr1, arg2, arg3=None):
: pass
:
In [21]: thread =
On 2014-03-12 13:29, zoom wrote:
> 2. Alternatively, a unique string could be generated to assure that
> no same file exists. I can see one approach to this is to include
> date and time in the file name. But this seems to me a bit clumsy,
> and is not unique, i.e. it could happen (at least in theo
In article ,
Ethan Furman wrote:
> I've tried it both ways, and both ways my process is being killed, presumably
> by the O/S.
What evidence do you have the OS is killing the process?
Some systems have an oom (Out Of Memory) process killer, which nukes
(semi-random) process when the system e
- Original Message -
> Hi,
> I am using Thread class to create threads.
>
> thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3="val"])
> thread.start()
>
> This code is throwing compilation error(Ipython).
> In [19]: import threading
> In [20]: def Fun(agr1, arg2, arg3=No
On Wed, Mar 12, 2014 at 8:09 AM, Piyush Verma <114piy...@gmail.com> wrote:
> Hi,
>
> I am using Thread class to create threads.
>
> thread = threading.Thread(target=Fun, args=[arg1, arg2, arg3="val"])
> thread.start()
>
>
> This code is throwing compilation error(Ipython).
> In [19]: import threa
I think I understand the difference between deep vs. shallow copies but
I was bitten by this:
with open(os.path.join('path', 'foo.txt', 'rb') as txt:
reader = csv.reader(txt)
data = [row.append(year) for row in reader]
This does not work although the append does complete. The below wor
On Wed, Mar 12, 2014 at 9:25 AM, Alex van der Spek wrote:
> with open(os.path.join('path', 'foo.txt', 'rb') as txt:
> reader = csv.reader(txt)
> data = [row.append(year) for row in reader]
Forget deep v. shallow copies. What is the value of the variable year?
And why would you expect li
On Wed, Mar 12, 2014 at 9:25 AM, Alex van der Spek wrote:
> I think I understand the difference between deep vs. shallow copies but
> I was bitten by this:
>
> with open(os.path.join('path', 'foo.txt', 'rb') as txt:
> reader = csv.reader(txt)
> data = [row.append(year) for row in reader]
On Wed, 12 Mar 2014 10:00:09 -0500, Zachary Ware wrote:
> On Wed, Mar 12, 2014 at 9:25 AM, Alex van der Spek
> wrote:
>> I think I understand the difference between deep vs. shallow copies but
>> I was bitten by this:
>>
>> with open(os.path.join('path', 'foo.txt', 'rb') as txt:
>> reader =
On 03/12/2014 06:44 AM, Roy Smith wrote:
In article ,
Ethan Furman wrote:
I've tried it both ways, and both ways my process is being killed, presumably
by the O/S.
What evidence do you have the OS is killing the process?
I put a bare try/except around the call to unittest.main, with a pr
Barry Scott, 11.03.2014 22:37:
> On 5 Mar 2014, at 00:14, Bill wrote:
>> I can't figure out how to create an instance
>> of a python class from 'C++':
>
> Why not use pycxx from http://sourceforge.net/projects/cxx/?
>
> This lib does all the heavy lifting for you for both python2 and python3.
> H
In article ,
Ethan Furman wrote:
> > Alternatively, maybe something inside your process is just calling
> > sys.exit(), or even os._exit(). You'll see the exit() system call in
> > the strace output.
>
> My bare try/except would have caught that.
A bare except would catch sys.exit(), but not
zoom Wrote in message:
> Hi!
>
> I would like to assure that when writing to a file I do not overwrite an
> existing file, but I'm unsure which is the best way to approach to this
> problem. As I can see, there are at least two possibilities:
>
> 1. I could use fd = os.open("x", os.O_WRONLY |
On 12 Mar 2014 15:29:59 GMT, Alex van der Spek
wrote:
>On Wed, 12 Mar 2014 10:00:09 -0500, Zachary Ware wrote:
>
>> On Wed, Mar 12, 2014 at 9:25 AM, Alex van der Spek
>> wrote:
=== 8< ===
>Having been taught programming in Algol60 Python still defeats me at times!
>Particularly since Algol60 w
Hi all.
I was wondering if someone could explain gc.get_objects() in a bit
more detail to me.
Does it return a list of 'all objects known to Python'? Only some of
them? Which does it return? Which it does not?
For example (done using CPython 3.4 interactive interpreter) here it
doe
On 3/12/2014 5:29 AM, zoom wrote:
2. Alternatively, a unique string could be generated to assure that no
same file exists. I can see one approach to this is to include date and
time in the file name. But this seems to me a bit clumsy, and is not
unique, i.e. it could happen (at least in theory)
>
> From: Albert-Jan Roskam
>To: Python
>Sent: Wednesday, March 12, 2014 1:22 PM
>Subject: locale getlocale returns None on OSX
>
>
>Hi,
>
>locale.getlocale() sometimes returns (None, None) under OSX (Python 2, not
>sure about Python 3, but I think so). The pr
On Wed, Mar 12, 2014 at 12:34 PM, Jurko Gospodnetić
wrote:
> Hi all.
>
> I was wondering if someone could explain gc.get_objects() in a bit more
> detail to me.
>
> Does it return a list of 'all objects known to Python'? Only some of them?
> Which does it return? Which it does not?
>
> For
On 2014-03-12 19:34, Jurko Gospodnetić wrote:
Hi all.
I was wondering if someone could explain gc.get_objects() in a bit
more detail to me.
Does it return a list of 'all objects known to Python'? Only some of
them? Which does it return? Which it does not?
[snip]
gc.is_tracked(...
In article
<1394626979.46880.yahoomailba...@web163806.mail.gq1.yahoo.com>,
Albert-Jan Roskam wrote:
> locale.getlocale() sometimes returns (None, None) under OSX (Python 2, not
> sure about Python 3, but I think so). The problem is outlined here:
> http://stackoverflow.com/questions/1629699/loc
Hi.
On 12.3.2014. 21:02, MRAB wrote:
I was wondering if someone could explain gc.get_objects() in a bit
more detail to me.
Does it return a list of 'all objects known to Python'? Only some of
them? Which does it return? Which it does not?
gc.is_tracked(...) might be relevant to you
I've stumbled on a problem with the python-sybase module. If I have a
stored procedure like this:
create stored procedure test_proc
as
return 1
and call it from Python like this:
curs.callproc("test_proc", {})
it's not clear to me where the return status is stored. Currently, the
python-syb
On Thu, Mar 13, 2014 at 8:28 AM, Jurko Gospodnetić
wrote:
> So gc.collect() returns a list of all the objects GC is in charge of, and
> which instances are and are not tracked by the GC is, I guess, an
> interpreter implementation detail.
I assume you don't mean collect() there, as that returns
EVIDENCE THAT HUMANS LIVED IN THE DEVONIAN:
https://groups.google.com/group/sci.bio.paleontology/browse_thread/thread/6f501c469c7af24f#
https://groups.google.com/group/sci.bio.paleontology/browse_thread/thread/3aad75c16afb0b82#
http://thrinaxodon.word
On Wed, Mar 12, 2014 at 3:44 PM, Chris Angelico wrote:
> The concept is that the GC tracks (in that sense; everything in
> CPython is refcounted, but that's not what these functions look at)
> anything that could be a part of a reference cycle. That's all it
> concerns itself with, so something th
On Wed, Mar 12, 2014 at 4:35 PM, Ian Kelly wrote:
>> So not all optimizations are done that could be done.
>
> Or is it?
>
a = 1,2,3
gc.is_tracked(a)
> True
gc.collect()
> 0
gc.is_tracked(a)
> False
I guess the reason for this is that when PyTuple_New is called, it
knows how m
On 12Mar2014 13:29, zoom wrote:
> I would like to assure that when writing to a file I do not
> overwrite an existing file, but I'm unsure which is the best way to
> approach to this problem. As I can see, there are at least two
> possibilities:
>
> 1. I could use fd = os.open("x", os.O_WRONLY |
On Wed, Mar 12, 2014 at 3:44 PM, Skip Montanaro wrote:
> What do other database adaptors do about stored procedure return
> values? Does PEP 249 need revision?
I can't speak generally, but in cx_Oracle you either execute a query like this:
result = cursor.var(cx_Oracle.NUMBER)
cursor.exe
On 12/03/2014 22:19, Cameron Simpson wrote:
On 12Mar2014 13:29, zoom wrote:
I would like to assure that when writing to a file I do not
overwrite an existing file, but I'm unsure which is the best way to
approach to this problem. As I can see, there are at least two
possibilities:
1. I could u
On Wed, Mar 12, 2014 at 5:00 PM, Ian Kelly wrote:
> result = cursor.var(cx_Oracle.NUMBER)
> cursor.execute(":1 := test_proc()", [result])
> print(result.getvalue())
Sorry, that should properly be:
result = cursor.var(cx_Oracle.NUMBER)
cursor.execute("BEGIN :1 := test_proc();
On Wed, 12 Mar 2014 15:29:59 +, Alex van der Spek wrote:
> Having been taught programming in Algol60 Python still defeats me at
> times! Particularly since Algol60 wasn't very long lived and what came
> thereafter (FORTRAN) much worse.
Fortran came first. Fortran was the first high-level lang
On Thu, Mar 13, 2014 at 9:35 AM, Ian Kelly wrote:
> Or is it?
>
a = 1,2,3
gc.is_tracked(a)
> True
gc.collect()
> 0
gc.is_tracked(a)
> False
Huh, *that* is interesting!
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On Mar 13, 2014, at 12:00 AM, Ian Kelly wrote:
> As a general solution, one might wrap a stored procedure that returns
> a value into a stored procedure that has an output parameter and call
> it with callproc. Some implementations might include a return value
> in the parameter list anyway.
A
On Wed, 12 Mar 2014 08:32:29 -0700, Ethan Furman wrote:
> There must
> be waaay too much stuff being kept alive by the stack traces of the
> failed tests.
I believe that unittest does keep stack traces alive until the process
ends. I thought that there was a recent bug report for it, but th
On Tue, 11 Mar 2014 17:06:43 -0600, Ian Kelly wrote:
> On Tue, Mar 11, 2014 at 10:46 AM, Steven D'Aprano
> wrote:
>>> There are a number of possible solutions. One possibility would be to
>>> copy the Circle as an Ellipse and return the new object instead of
>>> mutating it. Then you have the si
On Tue, 11 Mar 2014 13:58:17 -0700, Ethan Furman wrote:
> class Test_wfbrp_20140225(TestCase):
>
> @classmethod
> def setUpClass(cls):
> cls.pp = wfbrp.PaymentProcessor(
> '.../lockbox_file',
> '.../aging_file',
> [
> Path
On Wed, 12 Mar 2014 08:32:29 -0700, Ethan Furman wrote:
>> Some systems have an oom (Out Of Memory) process killer, which nukes
>> (semi-random) process when the system exhausts memory. Is it possible
>> this is happening? If so, you should see some log message in one of
>> your system logs.
>
Cameron Simpson writes:
> Therefore you need to continue _only_ if you get EEXIST. Otherwise
> abort.
If you target Python 3.3 or later, you can catch “FileExistsError”
http://docs.python.org/3/library/exceptions.html#FileExistsError>
which is far simpler than messing around with ‘errno’ values.
On 03/12/2014 04:47 PM, Steven D'Aprano wrote:
top -Mm -d 0.5
Cool, thanks!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
On 03/12/2014 04:38 PM, Steven D'Aprano wrote:
[snip lots of good advice for unit testing]
I was just removing the Personally Identifiable Information. Each test is pulling a payment from a batch of payments,
so the first couple asserts are simply making sure I have the payment I think I hav
On Wed, Mar 12, 2014 at 5:20 PM, Steven D'Aprano
wrote:
> On Tue, 11 Mar 2014 17:06:43 -0600, Ian Kelly wrote:
>
>> That's true but irrelevant to my point, which was to counter the
>> assertion that mutable types can always be assumed to be able to perform
>> operations in-place.
>
> "Always"? Not
On 3/12/2014 9:35 PM, Ian Kelly wrote:
On Wed, Mar 12, 2014 at 5:20 PM, Steven D'Aprano
wrote:
On Tue, 11 Mar 2014 17:06:43 -0600, Ian Kelly wrote:
That's true but irrelevant to my point, which was to counter the
assertion that mutable types can always be assumed to be able to perform
operati
On 3/12/2014 11:32 AM, Ethan Furman wrote:
I strongly suspect it's memory. When I originally wrote the code I
tried to include six months worth of EoM data, but had to back it down
to three as my process kept mysteriously dying at four or more months.
There must be waaay too much stuff bein
On 13Mar2014 11:22, Ben Finney wrote:
> Cameron Simpson writes:
> > Therefore you need to continue _only_ if you get EEXIST. Otherwise
> > abort.
>
> If you target Python 3.3 or later, you can catch “FileExistsError”
> http://docs.python.org/3/library/exceptions.html#FileExistsError>
> which is
On 3/12/2014 3:34 PM, Jurko Gospodnetić wrote:
I was wondering if someone could explain gc.get_objects() in a bit
more detail to me.
Does it return a list of 'all objects known to Python'? Only some of
them? Which does it return? Which it does not?
This took about 10 seconds.
>>> impor
On Thursday, March 13, 2014 4:37:53 AM UTC+5:30, Steven D'Aprano wrote:
> On Wed, 12 Mar 2014 15:29:59 +, Alex van der Spek wrote:
> > Having been taught programming in Algol60 Python still defeats me at
> > times! Particularly since Algol60 wasn't very long lived and what came
> > thereafter
If you want a much more fully-featured mail handler for the standard
logging framework, there's this:
https://pypi.python.org/pypi/mailinglogger/3.8.0
cheers,
Chris
On 12/03/2014 12:25, eras.rasmu...@gmail.com wrote:
It works. Thank you :)
Eras
--
Simplistix - Content Management, B
64 matches
Mail list logo