Steven D'Aprano wrote:
The right way is to
set the rounding mode at the start of your application, and then let the
Decimal type round each calculation that needs rounding.
It's not clear what you mean by "rounding mode" here. If you
mean whether it's up/down/even/whatever, then yes, you can
p
On Fri, Aug 31, 2018 at 3:50 PM, Cameron Simpson wrote:
> And aim for Python 2.7 - this goes a long way to making 2 and 3 easy to work
> with. The fursther back you go in 2.x the harder it gets.
Yep; also, aim for 3.5+, since you get the ability to write u"..."
(from 3.3) and b"..."%... (from 3.5
On 30Aug2018 19:27, Stone Zhong wrote:
I think the fact is:
- There are still considerable amount of people still using python2
- Python2 user will eventually upgrade to python3
So any library not written in a compatible way will either break now for
python2 user, or will break in the future f
On Thursday, August 30, 2018 at 10:19:34 PM UTC-7, Terry Reedy wrote:
> On 8/30/2018 10:27 PM, Stone Zhong wrote:
> > Hi there,
> >
> > I think the fact is:
> > - There are still considerable amount of people still using python2
> > - Python2 user will eventually upgrade to python3
> >
> > So any
On 8/30/2018 10:27 PM, Stone Zhong wrote:
Hi there,
I think the fact is:
- There are still considerable amount of people still using python2
- Python2 user will eventually upgrade to python3
So any library not written in a compatible way will either break now for
python2 user, or will break in
Hi there,
I think the fact is:
- There are still considerable amount of people still using python2
- Python2 user will eventually upgrade to python3
So any library not written in a compatible way will either break now for
python2 user, or will break in the future for python3 user. So I suppose a
On Thursday, August 30, 2018 at 10:08:34 AM UTC-6, Νίκος Βέργος wrote:
> I did try it with 'None' and as page='index.html' Flask return an error both
> ways (while bottle framework does not)
I think you are mistaken, making the change I suggested
fixes the "TypeError: index() missing 1 required p
On Thursday, August 30, 2018 at 2:05:16 PM UTC-4, pjmc...@gmail.com wrote:
> On Thursday, August 30, 2018 at 1:29:48 PM UTC-4, MRAB wrote:
> > On 2018-08-30 17:57, pjmcle...@gmail.com wrote:
> > > On Thursday, August 30, 2018 at 9:28:09 AM UTC-4, Steven D'Aprano wrote:
> > >> On Thu, 30 Aug 2018 05
On 8/30/2018 9:43 AM, Steven D'Aprano wrote:
On Thu, 30 Aug 2018 06:01:26 -0700, Tim wrote:
I saw a thread on reddit/python where just about everyone said they
never put code in their __init__ files.
Pfft. Reddit users. They're just as bad as Stackoverflow users. *wink*
Here's a stackoverf
On Thursday, August 30, 2018 at 1:29:48 PM UTC-4, MRAB wrote:
> On 2018-08-30 17:57, pjmcle...@gmail.com wrote:
> > On Thursday, August 30, 2018 at 9:28:09 AM UTC-4, Steven D'Aprano wrote:
> >> On Thu, 30 Aug 2018 05:21:30 -0700, pjmclenon wrote:
> >>
> >> > my question is ... at the moment i can
On 2018-08-30 17:57, pjmcle...@gmail.com wrote:
On Thursday, August 30, 2018 at 9:28:09 AM UTC-4, Steven D'Aprano wrote:
On Thu, 30 Aug 2018 05:21:30 -0700, pjmclenon wrote:
> my question is ... at the moment i can only run it on windows cmd prompt
> with a multiple line entry as so::
>
> pyth
On Thursday, August 30, 2018 at 9:28:09 AM UTC-4, Steven D'Aprano wrote:
> On Thu, 30 Aug 2018 05:21:30 -0700, pjmclenon wrote:
>
> > my question is ... at the moment i can only run it on windows cmd prompt
> > with a multiple line entry as so::
> >
> > python createIndex_tfidf.py stopWords.dat t
On Wednesday, August 29, 2018 at 10:57:35 AM UTC-6, Νίκος Βέργος wrote:
> Flask app.py
> ==
> @app.route( '/' )
> @app.route( '/' )
> def index( page ):
>
> # use the variable form template for displaying
> counter = '''
>
> td> Αριθμός Επισκεπτών:
>
29.08.18 17:33, Matthieu Dartiailh пише:
I tried to look at the public C API for a way to call an unbound method with a
minimal cost (in term of speed and memory). It seems to me, but please correct
me if I am wrong, that one cannot call a MethodDef using only the public API.
To use the public
Remember to check what the res["date"] types actually are. If they're just
text, then it looked like they were in M/D/Y format, which won't sort correctly
as text, hence you might want to include using datetime.strptime() to turn them
into sortable datetimes.
-Original Message-
From: P
On Thu, 30 Aug 2018 06:01:26 -0700, Tim wrote:
> I saw a thread on reddit/python where just about everyone said they
> never put code in their __init__ files.
Pfft. Reddit users. They're just as bad as Stackoverflow users. *wink*
> Here's a stackoverflow thread saying the same thing.
> https://
On Thu, 30 Aug 2018 05:21:30 -0700, pjmclenon wrote:
> my question is ... at the moment i can only run it on windows cmd prompt
> with a multiple line entry as so::
>
> python createIndex_tfidf.py stopWords.dat testCollection.dat
> testIndex.dat titleIndex.dat
>
> and then to query and use the n
I will put imports into my __init__ files, so that I can import things from the
module directly instead of having to import from a file in the module.
I almost never put code in the __init__'s, I have a couple of times put in
something that was designed to modify which routine was imported (i.e.
On Thu, 30 Aug 2018 at 14:07, Tim wrote:
>
> I saw a thread on reddit/python where just about everyone said they never put
> code in their __init__ files.
>
> Here's a stackoverflow thread saying the same thing.
> https://stackoverflow.com/questions/1944569/how-do-i-write-good-correct-package-ini
On Thu, 30 Aug 2018 19:22:29 +1200, Gregory Ewing wrote:
> Steven D'Aprano wrote:
>> Why in the name of all that's holy would anyone want to manually round
>> each and every intermediate calculation when they could use the Decimal
>> module and have it do it automatically?
>
> I agree that Decima
I saw a thread on reddit/python where just about everyone said they never put
code in their __init__ files.
Here's a stackoverflow thread saying the same thing.
https://stackoverflow.com/questions/1944569/how-do-i-write-good-correct-package-init-py-files
That's new to me. I like to put functio
On Thursday, August 30, 2018 at 8:21:47 AM UTC-4, pjmc...@gmail.com wrote:
> On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote:
> > > 1st is this script is from a library module online open source
> >
> > If it's open source, why didn't you show the link to the soruce?
> > I assu
On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote:
> > 1st is this script is from a library module online open source
>
> If it's open source, why didn't you show the link to the soruce?
> I assume your code is this:
>
> https://github.com/siddharth2010/String-Search/blob/6770c7
> > sort = sorted(results, key=lambda res:itemgetter('date'))
> > print(sort)
> >
> >
> > I have tried the above code peter but it was showing error like
> > TypeError: '<' not supported between instances of 'operator.itemgetter'
> > and 'operator.itemgetter'
>
> lambda res: itemgetter('
Steven D'Aprano wrote:
Why in the name of all that's holy would anyone want to manually round
each and every intermediate calculation when they could use the Decimal
module and have it do it automatically?
I agree that Decimal is the safest and probably easiest way to
go, but saying that it "d
25 matches
Mail list logo