On 19/07/2020 16:11, Dino wrote:
> On 7/19/2020 4:54 PM, duncan smith wrote:
>>
>> It depends on what you expect the result to be. There's nothing
>> inherently wrong with transforming variables before using least squares
>> fitting. Whether it gives you the "best" estimates for the coefficients
On 7/19/20 10:54 AM, duncan smith wrote:
> On 19/07/2020 11:19, Dino wrote:
>> Hi, I am looking at someone else's code trying to understand their use
>> of numpy.polyfit.
>>
>> My understanding was that you can use it to fit polynomials, but
>> apparently, the original author has used it for
On 19/07/2020 11:19, Dino wrote:
>
> Hi, I am looking at someone else's code trying to understand their use
> of numpy.polyfit.
>
> My understanding was that you can use it to fit polynomials, but
> apparently, the original author has used it for logarithmic and
> exponential curves as well this
On 01/08/18 12:49, Chris Angelico wrote:
On Wed, Aug 1, 2018 at 8:40 PM, Thomas Jollans wrote:
On 01/08/18 05:16, Jeffrey Zhang wrote:
I found a interesting issue when checking the Lib/datetime.py
implementation in python3
This patch is introduced by cf86e368ebd17e10f68306ebad314eea31daaa1e
On Wed, Aug 1, 2018 at 8:40 PM, Thomas Jollans wrote:
> On 01/08/18 05:16, Jeffrey Zhang wrote:
>>
>> I found a interesting issue when checking the Lib/datetime.py
>> implementation in python3
>>
>> This patch is introduced by cf86e368ebd17e10f68306ebad314eea31daaa1e [0].
>> But if you
>> check
On 01/08/18 05:16, Jeffrey Zhang wrote:
I found a interesting issue when checking the Lib/datetime.py
implementation in python3
This patch is introduced by cf86e368ebd17e10f68306ebad314eea31daaa1e [0].
But if you
check the github page[0], or using git tag --contains, you will find v2.7.x
@eryk sun: Thank you for useful reply.
But note that I don't propose to touch the python interpeters (python*.exe),
neither to change anything in how distutils work (about entry points).
My proposal is only for the Windows-specific Py launcher. For those who runs
python*.exe thru associations
On Mon, Nov 7, 2016 at 1:11 AM, ddbug wrote:
>
> In Windows, the user-local directory for scripts is %APPDATA%\Python\Scripts.
> It is not in
> PATH by default and finding it is hard (because Microsoft made it hidden in
> their infinite
> wisdom).
POSIX "~/.local" is
On 07.11.2016 4:11, ddbug wrote:
Dear experts,
I need to install some scripts for current user (to skip sudo, UAC popups and
whatever).
So I make a sdist and use python -m pip install --user
This should work for either Python 2 or 3.
On Linux, pip installs the scripts into ~/.local/bin
So basically I want to modify py.exe to not only detect the Python version from
a script file, but also help locating the script file.
-- d
--
https://mail.python.org/mailman/listinfo/python-list
On Mon, Feb 8, 2016 at 8:36 AM, wrote:
> I'm playing around with some existing code that uses wxpython. I've
> been trying to understand a basic bit about the import statement and
> so went to the beginning of the wxPython on line documents.
>
> Going from the top to the "Hello
Ian Kelly wrote:
> On Mon, Feb 8, 2016 at 8:36 AM, wrote:
> > I'm playing around with some existing code that uses wxpython. I've
> > been trying to understand a basic bit about the import statement and
> > so went to the beginning of the wxPython on line
On Saturday, July 19, 2014 8:44:25 PM UTC+8, Wojciech Giel wrote:
On 19/07/14 12:40, Jerry lu wrote:
oh yeah i forgot about the decorators. Um say that you wanted to decorate a
function with the outer() func you would just put @outer on top of it? And
this is the same as passing another
On Mon, 21 Jul 2014 00:30:00 -0700, CHIN Dihedral wrote:
Uhn, a local object inside a function can be passed back in Python.
Of course, a local function is treated as an object in Python,and the GC
is built-in.
Sigh, the Dihedral bot is not what it used to be...
--
Steven
--
On Sat, 19 Jul 2014 03:52:18 -0700, Jerry lu wrote:
Ok so i am trying to learn this and i do not understand some of it. I
also tried to searched the web but i couldnt find any answers.
1. I dont understand when i will need to use a function that returns
another function. eg
On Sat, Jul 19, 2014 at 8:52 PM, Jerry lu nicholascann...@gmail.com wrote:
Ok so i am trying to learn this and i do not understand some of it. I also
tried to searched the web but i couldnt find any answers.
1. I dont understand when i will need to use a function that returns another
oh yeah i forgot about the decorators. Um say that you wanted to decorate a
function with the outer() func you would just put @outer on top of it? And this
is the same as passing another func into the outer func?
and also with the first example you say x is in the scope when is was created
On Sat, Jul 19, 2014 at 9:40 PM, Jerry lu nicholascann...@gmail.com wrote:
oh yeah i forgot about the decorators. Um say that you wanted to decorate a
function with the outer() func you would just put @outer on top of it? And
this is the same as passing another func into the outer func?
and
Ok thanks man I have never used forums and stuff before but it is great help
thank you so much.
--
https://mail.python.org/mailman/listinfo/python-list
On 19/07/14 11:52, Jerry lu wrote:
Ok so i am trying to learn this and i do not understand some of it. I also
tried to searched the web but i couldnt find any answers.
1. I dont understand when i will need to use a function that returns another
function.
eg
def outer():
On 19/07/14 11:52, Jerry lu wrote:
Ok so i am trying to learn this and i do not understand some of it. I also
tried to searched the web but i couldnt find any answers.
1. I dont understand when i will need to use a function that returns another
function.
eg
def outer():
On 19/07/14 12:40, Jerry lu wrote:
oh yeah i forgot about the decorators. Um say that you wanted to decorate a
function with the outer() func you would just put @outer on top of it? And this
is the same as passing another func into the outer func?
yes.
syntax was added because with very long
ok I seem to very confused about this. Is there like a page or web page that
like completely sums this up so i can study. I am going to look up 'functions
in python'. I am not sure if this is what we a talking about as a whole here
but I'am sure that I'll find something. I am all good with
On Sun, Jul 20, 2014 at 12:24 PM, Jerry lu nicholascann...@gmail.com wrote:
ok I seem to very confused about this. Is there like a page or web page that
like completely sums this up so i can study. I am going to look up 'functions
in python'.
Yep, look up stuff like that. I gave you some
Ok thanks so much i really want to get good. I also found this MIT open course
lectures for python. Is this good to use as a source of learning? I think it
would because it is MIT.
--
https://mail.python.org/mailman/listinfo/python-list
snip
On 5/25/14 7:55 PM, Deb Wyatt wrote:
I am confused about how various built-in functions are called. Some are
called with dot notation
snip
How do you know/remember which way to call them?
TIA,
Deb in WA, USA
It can be confusing. Generally, built-in functions (like sum, len,
On 5/26/2014 11:15 AM, Deb Wyatt wrote:
snip
On 5/25/14 7:55 PM, Deb Wyatt wrote:
I am confused about how various built-in functions are called. Some are
called with dot notation
snip
How do you know/remember which way to call them?
It can be confusing. Generally, built-in functions
Terry Reedy tjre...@udel.edu:
Part of the answer is Python's history. Up to about 2.1, most built-in
types did not have methods, though I know lists did. Ints and strings
did not, or chr and ord might have been int.chr() and str.ord(). (The
current string methods were originally functions in
On 26.05.2014 21:00, Marko Rauhamaa wrote:
Terry Reedy tjre...@udel.edu:
Part of the answer is Python's history. Up to about 2.1, most built-in
types did not have methods, though I know lists did. Ints and strings
did not, or chr and ord might have been int.chr() and str.ord(). (The
current
Christian Heimes christ...@python.org:
Python creates a new bound method object every time. A bound method
object is a callable object that keeps a strong reference to the
function, class and object. The bound method object adds the object as
first argument to the function (aka 'self').
I
Marko Rauhamaa ma...@pacujo.net:
Christian Heimes christ...@python.org:
Python creates a new bound method object every time. A bound method
object is a callable object that keeps a strong reference to the
function, class and object. The bound method object adds the object as
first argument
Marko Rauhamaa wrote:
IOW, you can override a method with setattr() but you cannot delete a
method with delattr().
Actually, you can -- but you need to delete it from
the class, not the instance:
delattr(X, 'f')
x.f()
Traceback (most recent call last):
File stdin, line 1, in module
On Mon, 26 May 2014 23:58:37 +0300, Marko Rauhamaa wrote:
Marko Rauhamaa ma...@pacujo.net:
Christian Heimes christ...@python.org:
Python creates a new bound method object every time. A bound method
object is a callable object that keeps a strong reference to the
function, class and
On 5/26/2014 4:32 PM, Marko Rauhamaa wrote:
I stand corrected. I had thought the trampoline (bound method object)
was created once and for all.
Assuming that bound methods are immutable, this is an implementation
detail, either way. However, it is common for a specific method to be
called
On 5/25/14 7:55 PM, Deb Wyatt wrote:
I am confused about how various built-in functions are called. Some are
called with dot notation
each_item.isalpha()
and some are called like 'normal'
sum(numlist)
How do you know/remember which way to call them?
TIA,
Deb in WA, USA
It can be
On 25May2014 15:55, Deb Wyatt codemon...@inbox.com wrote:
I am confused about how various built-in functions are called. Some are
called with dot notation
each_item.isalpha()
and some are called like 'normal'
sum(numlist)
How do you know/remember which way to call them?
Documentation.
LOCAL_TZ.localize(dt1).utcoffset()
datetime.timedelta(-1, 68400)
LOCAL_TZ.localize(dt2).utcoffset()
datetime.timedelta(-1, 64800)
Why is the UTC offset the same for both datetime objects despite the
presence/absence of Daylight Savings?
Brain freeze! A quick glance told me they were the
On 10/23/2013 12:00 PM, Skip Montanaro wrote:
-- LOCAL_TZ.localize(dt1).utcoffset()
datetime.timedelta(-1, 68400)
-- LOCAL_TZ.localize(dt2).utcoffset()
datetime.timedelta(-1, 64800)
Why is the UTC offset the same for both datetime objects despite the
presence/absence of Daylight Savings?
In article 50de7a0a$0$29967$c3e8da3$54964...@news.astraweb.com,
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
In Python 3.2 and 3.3, the message about no handlers is not printed,
which is an interesting difference. (Somebody who knows more about the
logging package than I do
On 12/29/2012 8:48 AM, Roy Smith wrote:
In article 50de7a0a$0$29967$c3e8da3$54964...@news.astraweb.com,
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
In Python 3.2 and 3.3, the message about no handlers is not printed,
which is an interesting difference. (Somebody who knows
In article mailman.1455.1356826759.29569.python-l...@python.org,
Terry Reedy tjre...@udel.edu wrote:
On 12/29/2012 8:48 AM, Roy Smith wrote:
In article 50de7a0a$0$29967$c3e8da3$54964...@news.astraweb.com,
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
In Python 3.2 and
similarly, if i run the following, i see only done:
from logging import DEBUG, root, getLogger
if __name__ == '__main__':
root.setLevel(DEBUG)
getLogger(__name__).debug(hello world)
print('done')
--
http://mail.python.org/mailman/listinfo/python-list
andrew cooke wrote:
similarly, if i run the following, i see only done:
from logging import DEBUG, root, getLogger
if __name__ == '__main__':
root.setLevel(DEBUG)
getLogger(__name__).debug(hello world)
print('done')
You need a handler. The easiest way to get one
On Friday, 28 December 2012 21:56:46 UTC-3, Peter Otten wrote:
Other revolutionary ideas: read the docs
http://docs.python.org/dev/howto/logging.html#logging-basic-tutorial ;)
how do you think i knew about the root handler without reading the damn docs
you condescending asshole?
anyway,
On 12/28/2012 09:29 PM, andrew cooke wrote:
On Friday, 28 December 2012 21:56:46 UTC-3, Peter Otten wrote:
snip
reading the damn docs you condescending *?
You've made four posts this year to this forum, in two threads, to ask
for help. In that same year, Peter Otten has voluntarily
On Fri, 28 Dec 2012 11:57:29 -0800, andrew cooke wrote:
When I use a config file things seem to work (in other projects), but
for my current code I hoped to configure logging from Python.
I distilled my problem down to the following test, which does not print
anything. Please can someone
On Fri, 28 Dec 2012 16:41:20 -0800, andrew cooke wrote:
similarly, if i run the following, i see only done:
from logging import DEBUG, root, getLogger
if __name__ == '__main__':
root.setLevel(DEBUG)
getLogger(__name__).debug(hello world)
print('done')
In Python
On 2012-12-08 07:17, Chris Angelico wrote:
On Sat, Dec 8, 2012 at 6:01 PM, Terry Reedy tjre...@udel.edu wrote:
Unfortunately, catching exceptions may be and often is as slow as the
redundant check and even multiple redundant checks.
It depends on how often you're going to catch and how often
On Thursday, 6 December 2012 17:44:17 UTC+5:30, Chris Angelico wrote:
On Thu, Dec 6, 2012 at 10:47 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Not so. Which one is faster will depend on how often you expect to fail.
If the keys are nearly always present, then:
On Sun, Dec 9, 2012 at 2:07 PM, Ramchandra Apte maniandra...@gmail.com wrote:
Not really. I remember a bug saying that only 256 hashes were required of
known texts and then the randomization becomes useless.
That requires that someone be able to get you to hash some text and
give back the
On Sun, 09 Dec 2012 14:22:21 +1100, Chris Angelico wrote:
On Sun, Dec 9, 2012 at 2:07 PM, Ramchandra Apte maniandra...@gmail.com
wrote:
Not really. I remember a bug saying that only 256 hashes were required
of known texts and then the randomization becomes useless.
That requires that
Calling it 'found' is misleading, because it's True only if it updated.
If it found a match but didn't update, 'found' will still be False.
Using a loop within a loop like this could be the cause of your
problem. It's certainly not the most efficient way of doing it.
I will keep you posted
On 2012-12-07, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
On Thu, 06 Dec 2012 13:51:29 +, Neil Cerutti wrote:
On 2012-12-06, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
total = 0
for s in list_of_strings:
try:
total += int(s)
except
On Thu, 06 Dec 2012 23:14:17 +1100, Chris Angelico wrote:
Setting up the try/except is a constant time cost,
It's not just constant time, it's constant time and *cheap*. Doing
nothing inside a try block takes about twice as long as doing nothing:
[steve@ando ~]$ python2.7 -m timeit try: pass
On 12/7/2012 5:16 PM, Steven D'Aprano wrote:
On Thu, 06 Dec 2012 23:14:17 +1100, Chris Angelico wrote:
Setting up the try/except is a constant time cost,
It's not just constant time, it's constant time and *cheap*. Doing
nothing inside a try block takes about twice as long as doing nothing:
On Sat, Dec 8, 2012 at 6:01 PM, Terry Reedy tjre...@udel.edu wrote:
Unfortunately, catching exceptions may be and often is as slow as the
redundant check and even multiple redundant checks.
It depends on how often you're going to catch and how often just flow
through. In Python, as in most
On Thu, Dec 06, 2012 at 04:32:34AM +, Steven D'Aprano wrote:
On Thu, 06 Dec 2012 03:22:53 +, Rotwang wrote:
On 06/12/2012 00:19, Bruno Dupuis wrote:
[...]
Another advice: never ever
except XXXError:
pass
at least log, or count, or warn, or anything, but don't
On Thu, Dec 6, 2012 at 7:49 PM, Bruno Dupuis
python.ml.bruno.dup...@lisael.org wrote:
The point is Exceptions are made for error handling, not for normal
workflow. I hate when i read that for example:
try:
do_stuff(mydict[k])
except KeyError:
pass
(loads of them
On Thu, Dec 6, 2012 at 1:31 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Wed, 05 Dec 2012 23:50:49 +0100, Anatoli Hristov wrote:
def Change_price():
Misleading function name. What price does it change?
total = 0
tnf = 0
tnf? Does that mean something?
On Thu, 06 Dec 2012 09:49:26 +0100, Bruno Dupuis wrote:
The point is Exceptions are made for error handling, not for normal
workflow.
That's certainly not the case in Python. Using exceptions for flow
control is a standard part of the language.
IndexError and StopIteration are used to
On 12/06/2012 08:47 AM, Steven D'Aprano wrote:
On Thu, 06 Dec 2012 09:49:26 +0100, Bruno Dupuis wrote:
The point is Exceptions are made for error handling, not for normal
workflow.
That's certainly not the case in Python. Using exceptions for flow
control is a standard part of the language.
On Thu, Dec 6, 2012 at 10:47 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Not so. Which one is faster will depend on how often you expect to fail.
If the keys are nearly always present, then:
try:
do_stuff(mydict[k])
except KeyError:
pass
will be faster. Setting
On 6/12/12 12:55:16, peter wrote:
Is perfectly right to use try catch for a flow control.
Just think in something more complex like this.
try:
self._conn = MySQLdb.connect(host=host,
user=user,
passwd=passwd,
db=db)
Am 06.12.2012 09:49 schrieb Bruno Dupuis:
The point is Exceptions are made for error handling, not for normal
workflow. I hate when i read that for example:
try:
do_stuff(mydict[k])
except KeyError:
pass
I as well, but for other reasons (see below). But basically
On Fri, Dec 7, 2012 at 12:32 AM, Hans Mulder han...@xs4all.nl wrote:
On 6/12/12 12:55:16, peter wrote:
Is perfectly right to use try catch for a flow control.
Just think in something more complex like this.
try:
self._conn = MySQLdb.connect(host=host,
On 2012-12-06, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
total = 0
for s in list_of_strings:
try:
total += int(s)
except ValueError:
pass # Not a number, ignore it.
If it's internal data, perhaps. Of course, that would mean I had
the option of
On Fri, Dec 7, 2012 at 12:33 AM, Thomas Rachel
nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de
wrote:
Am 06.12.2012 09:49 schrieb Bruno Dupuis:
The point is Exceptions are made for error handling, not for normal
workflow. I hate when i read that for example:
try:
Guys I'm still confusing my script is working better, but not enough.
I did a logfile to see which products are not found anymore in the CSV
and I found some that are present but python says they are not ??
Here is the product in the CSV:
MONIIE2407HDS-B1;MON;II;E2407HDS-B1;E2407HDS-B1;IIYAMA LCD
On 6/12/12 14:58:01, Chris Angelico wrote:
On Fri, Dec 7, 2012 at 12:33 AM, Thomas Rachel
nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de
wrote:
Am 06.12.2012 09:49 schrieb Bruno Dupuis:
The point is Exceptions are made for error handling, not for normal
workflow. I
On Fri, Dec 7, 2012 at 1:21 AM, Hans Mulder han...@xs4all.nl wrote:
Errhm, no. Look again. The do_stuff(value) call is in the else:
clause, so it will only be done of there was no Exception of any
kind, and in that case the assignment to value must have succeeded.
DOH! My bad. Sorry! I
On 12/06/2012 08:58 AM, Chris Angelico wrote:
On Fri, Dec 7, 2012 at 12:33 AM, Thomas Rachel
nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de
wrote:
Am 06.12.2012 09:49 schrieb Bruno Dupuis:
The point is Exceptions are made for error handling, not for normal
workflow. I
On 12/06/2012 10:58 AM, Chris Angelico wrote:
On Fri, Dec 7, 2012 at 12:33 AM, Thomas Rachel
nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de
wrote:
Am 06.12.2012 09:49 schrieb Bruno Dupuis:
The point is Exceptions are made for error handling, not for normal
workflow. I hate
On Thu, Dec 6, 2012 at 3:22 PM, Anatoli Hristov toli...@gmail.com wrote:
Guys I'm still confusing my script is working better, but not enough.
I did a logfile to see which products are not found anymore in the CSV
and I found some that are present but python says they are not ??
Here is the
On 06/12/2012 16:16, Anatoli Hristov wrote:
No one have an idea ?
Thanks
Basically because your code is crap. Others have already suggested
refactoring your code to make it easier to follow. Try (diabolical pun
very deliberate) following that advice. Failing that find out how much
No one have an idea ?
Thanks
Basically because your code is crap. Others have already suggested
refactoring your code to make it easier to follow.
Thank you Mark for your notes. I changed the name of the variables as
was suggested before.
I know my code should be crappy, but at least I
On 2012-12-06 14:22, Anatoli Hristov wrote:
Guys I'm still confusing my script is working better, but not enough.
I did a logfile to see which products are not found anymore in the CSV
and I found some that are present but python says they are not ??
Here is the product in the CSV:
Here is the product in the CSV:
MONIIE2407HDS-B1;MON;II;E2407HDS-B1;E2407HDS-B1;IIYAMA LCD 24 Wide
1920x1080TN Speakers 2ms Black DVI HDMI;133;20;RECTD0.41;0,41;
This one is still not found and it is in the CSV file - I just don't
get it why !
if len(db_sku) != 0
On 2012-12-06 17:31, Anatoli Hristov wrote:
Here is the product in the CSV:
MONIIE2407HDS-B1;MON;II;E2407HDS-B1;E2407HDS-B1;IIYAMA LCD 24 Wide
1920x1080TN Speakers 2ms Black DVI HDMI;133;20;RECTD0.41;0,41;
This one is still not found and it is in the CSV file - I just don't
get it why
Here is the product in the CSV:
MONIIE2407HDS-B1;MON;II;E2407HDS-B1;E2407HDS-B1;IIYAMA LCD 24 Wide
1920x1080TN Speakers 2ms Black DVI HDMI;133;20;RECTD0.41;0,41;
[snip]
It's not saying that it's not found, it's saying that it wasn't updated
because:
You are right, the price at the
gmane.comp.python.general:
But basically, the code seems to run a pair of nested for-loops:
for SKU in database:
for SKU in csv file:
if the two SKUs match:
compare their prices and update the database
OUCH...
I'm presuming the CSV is restarted
On 06/12/2012 08:49, Bruno Dupuis wrote:
On Thu, Dec 06, 2012 at 04:32:34AM +, Steven D'Aprano wrote:
On Thu, 06 Dec 2012 03:22:53 +, Rotwang wrote:
On 06/12/2012 00:19, Bruno Dupuis wrote:
[...]
Another advice: never ever
except XXXError:
pass
at least log, or count, or
On 06/12/2012 04:32, Steven D'Aprano wrote:
On Thu, 06 Dec 2012 03:22:53 +, Rotwang wrote:
[...]
Is there a problem with either of the above? If so, what should I do
instead?
They're fine.
Never, ever say that people should never, ever do something.
*cough*
Thanks.
--
I have made
On Thu, 06 Dec 2012 13:51:29 +, Neil Cerutti wrote:
On 2012-12-06, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
total = 0
for s in list_of_strings:
try:
total += int(s)
except ValueError:
pass # Not a number, ignore it.
If it's internal data,
On Wed, Dec 05, 2012 at 11:50:49PM +0100, Anatoli Hristov wrote:
I'm confused again with a compare update function. The problem is that
my function does not work at all and I don't get it where it comes
from.
in my DB I have total of 754 products. when I run the function is says:
Total
On Wed, 05 Dec 2012 23:50:49 +0100, Anatoli Hristov wrote:
def Change_price():
Misleading function name. What price does it change?
total = 0
tnf = 0
tnf? Does that mean something?
for row in DB: # DB is mySQL DB, logically I get out
# 1 SKU and I
On Thu, 06 Dec 2012 01:19:58 +0100, Bruno Dupuis wrote:
I tried, I swear I did try, I didn't understand the whole algorithm of
the function. However, in a first sight, I find it way to deeply nested.
Yes!
But basically, the code seems to run a pair of nested for-loops:
for SKU in database:
On 06/12/2012 00:19, Bruno Dupuis wrote:
[...]
Another advice: never ever
except XXXError:
pass
at least log, or count, or warn, or anything, but don't pass.
Really? I've used that kind of thing several times in my code. For
example, there's a point where I have a list of strings and
On Thu, 06 Dec 2012 03:22:53 +, Rotwang wrote:
On 06/12/2012 00:19, Bruno Dupuis wrote:
[...]
Another advice: never ever
except XXXError:
pass
at least log, or count, or warn, or anything, but don't pass.
Really? I've used that kind of thing several times in my code. For
月忧茗 wrote:
HI, I have some test code:
def num(num):
def deco(func):
def wrap(*args, **kwargs):
inputed_num = num
return func(*args, **kwargs)
return wrap
return deco
@num(5)
def test(a):
return a + inputed_num
print
On 12/26/11 21:48 , Fredrik Tolf wrote:
On Mon, 26 Dec 2011, K. Richard Pixley wrote:
I don't understand. Can anyone explain?
I'm also a bit confused about __new__. I'd very much appreciate it if
someone could explain the following aspects of it:
* The manual
On Tue, 27 Dec 2011, Ian Kelly wrote:
On Mon, Dec 26, 2011 at 10:48 PM, Fredrik Tolf fred...@dolda2000.com wrote:
I'm also a bit confused about __new__. I'd very much appreciate it if
someone could explain the following aspects of it:
* The manual
On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixley r...@noir.com wrote:
The conceptual leap for me was in recognizing that a class is just an
object. The best way, (imo, so far), to create a singleton in python is to
use the class itself as the singleton rather than ever instantiating it.
On Tue, Dec 27, 2011 at 1:31 PM, K Richard Pixley r...@noir.com wrote:
On 12/27/11 10:28 , Ian Kelly wrote:
On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixleyr...@noir.com wrote:
The conceptual leap for me was in recognizing that a class is just an
object. The best way, (imo, so far), to
On 12/27/11 10:28 , Ian Kelly wrote:
On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixleyr...@noir.com wrote:
The conceptual leap for me was in recognizing that a class is just an
object. The best way, (imo, so far), to create a singleton in python is to
use the class itself as the singleton
On 12/27/11 12:34 , Ian Kelly wrote:
On Tue, Dec 27, 2011 at 1:31 PM, K Richard Pixleyr...@noir.com wrote:
On 12/27/11 10:28 , Ian Kelly wrote:
On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixleyr...@noir.comwrote:
The conceptual leap for me was in recognizing that a class is just an
On Tue, Dec 27, 2011 at 3:19 PM, K Richard Pixley r...@noir.com wrote:
Are you trying to demonstrate that I haven't prevented you from
instantiating Foo? If so, then I will cede that point. I certainly don't
know enough about python internals just now to even claim to be capable of
On Mon, 26 Dec 2011 20:28:26 -0800, K. Richard Pixley wrote:
I'm confused about the following. The idea here is that the set of
instances of some class are small and finite, so I'd like to create them
at class creation time, then hijack __new__ to simply return one of the
preexisting classes
On 12/26/11 20:53 , Steven D'Aprano wrote:
On Mon, 26 Dec 2011 20:28:26 -0800, K. Richard Pixley wrote:
I'm confused about the following. The idea here is that the set of
instances of some class are small and finite, so I'd like to create them
at class creation time, then hijack __new__ to
On Mon, 26 Dec 2011, K. Richard Pixley wrote:
I don't understand. Can anyone explain?
I'm also a bit confused about __new__. I'd very much appreciate it if
someone could explain the following aspects of it:
* The manual (http://docs.python.org/reference/datamodel.html) says
that
On Mon, Dec 26, 2011 at 10:48 PM, Fredrik Tolf fred...@dolda2000.com wrote:
I'm also a bit confused about __new__. I'd very much appreciate it if
someone could explain the following aspects of it:
* The manual (http://docs.python.org/reference/datamodel.html) says
that __new__ is a static
1 - 100 of 339 matches
Mail list logo