"Roland Koebler" wrote in message news:20160826140213.GA17438@localhost...
Hi,
OMG!
So, you have a fileformat, which looks like XML, but actually isn't XML,
and will break if used with some "real" XML.
I don't want to pursue this too much further, but I would like to point out
that my fo
Gregory Ewing :
> Marko Rauhamaa wrote:
>> How about making *every* function *always* and async,
>> unconditionally? That way *every* function would be an async and
>> every function call would be an await.
>
> 1. Many people regard it as a feature that you can see where
> potential suspension poi
On Fri, Aug 26, 2016 at 11:28 AM, Jon Ribbens wrote:
> On 2016-08-24, Chris Angelico wrote:
>> On Thu, Aug 25, 2016 at 7:00 AM, eryk sun wrote:
>>> I discovered why "Logs/con.txt" isn't working right in Windows 7,
>>> while "Logs/nul.txt" does get redirected correctly to r"\\.\nul".
>>> Prior to
Marko Rauhamaa wrote:
How about making *every* function *always* and async, unconditionally?
That way *every* function would be an async and every function call
would be an await.
1. Many people regard it as a feature that you can see where
potential suspension points are.
2. Doing this would
On Sat, 27 Aug 2016 08:33 am, ddream.mercha...@gmail.com wrote:
> My log file has several sections starting with START and ending
> with END .
Um. Is this relevant? Are you saying that you only wish to search the file
between those lines, and ignore anything outside of them?
Hello all,
The official doc describes `Pool.map(func, iterable[, chunksize])` as "A
parallel equivalent of the map() built-in function.".
Since the function signature of `map` is `map(function, iterable, ...)`, I
hereby suggest that `Pool.map` should change its function signature to
`Pool.map
On 8/26/2016 4:50 AM, d...@forestfield.co.uk wrote:
In a program I'm converting to Python 3 I'm examining a list of divisor values,
some of which can be None, to find the first with a value greater than 1.
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on
win32
Type
Hi,
after reading the mails of this thread, I would recommend one of the
following ways:
1. Use a computer-readable format and some small editor for humans.
The file-format could then be very simple -- I would recommend JSON.
Or some kind of database (e.g. SQLite).
For humans, you w
"Frank Millman" :
> "Joonas Liik" wrote in message
> news:cab1gnptp0gd4s4kx07r1ujrnuxtoij4vf5unye1cfr_y0xv...@mail.gmail.com...
>> i should note tho that this example is very ad-hoc, i'm no xml expert
>> just know a bit about xml entities. if you decide to go this route
>> there are probably som
Very cool! Thanks for doing this. I can't wait to dig into your cookbook.
Regards,
Dean Gonzales
-Original Message-
From: Python-announce-list
[mailto:python-announce-list-bounces+dean.gonzales=amd@python.org] On
Behalf Of Mike Driscoll
Sent: Wednesday, August 24, 2016 12:57 PM
To:
Hi,
> It is *my* XML, and I know that I only use the offending characters inside
> attributes, and attributes are the only place where double-quote marks are
> allowed.
>
> So this is my conversion routine -
>
> lines = string.split('"') # split on attributes
> for pos, line in enumerate(lines)
"Joonas Liik" wrote in message
news:cab1gnptp0gd4s4kx07r1ujrnuxtoij4vf5unye1cfr_y0xv...@mail.gmail.com...
something like.. (untested)
def escape(untrusted_string):
''' Use on the user provided strings to render them inert for storage
escaping & ensures that the user cant type sth lik
On 26 August 2016 at 17:58, Joonas Liik wrote:
> On 26 August 2016 at 16:10, Frank Millman wrote:
>> "Joonas Liik" wrote in message
>> news:cab1gnpqnjdenaa-gzgt0tbcvwjakngd3yroixgyy+mim7fw...@mail.gmail.com...
>>
>>> On 26 August 2016 at 08:22, Frank Millman wrote:
>>> >
>>> > So this is my con
On 26 August 2016 at 16:10, Frank Millman wrote:
> "Joonas Liik" wrote in message
> news:cab1gnpqnjdenaa-gzgt0tbcvwjakngd3yroixgyy+mim7fw...@mail.gmail.com...
>
>> On 26 August 2016 at 08:22, Frank Millman wrote:
>> >
>> > So this is my conversion routine -
>> >
>> > lines = string.split('"') #
Thanks for the replies. My example seems to be from the fairly harmless end of
a wedge of behaviours that are being handled much more sensibly in Python 3.
--
https://mail.python.org/mailman/listinfo/python-list
"Joonas Liik" wrote in message
news:cab1gnpqnjdenaa-gzgt0tbcvwjakngd3yroixgyy+mim7fw...@mail.gmail.com...
On 26 August 2016 at 08:22, Frank Millman wrote:
>
> So this is my conversion routine -
>
> lines = string.split('"') # split on attributes
> for pos, line in enumerate(lines):
>if p
On 2016-08-24, Chris Angelico wrote:
> On Thu, Aug 25, 2016 at 7:00 AM, eryk sun wrote:
>> I discovered why "Logs/con.txt" isn't working right in Windows 7,
>> while "Logs/nul.txt" does get redirected correctly to r"\\.\nul".
>> Prior to Windows 8 the console doesn't use an NT device, so the base
Hello,
I'm having problems finding the "preferrably one" way to convert a
datetime instance into an xs:datetime string.
Here is an example datetime instance with is format:
dt = datetime.now()
print(dt.isoformat()) # prints "2016-08-26 12:41:13.426081+02:00"
print(dt.strftime('%Y-%m-%dT%H:%M:
On Fri, Aug 26, 2016 at 8:20 PM, mlz wrote:
> I believe there are languages that preserve exact accuracy in this way for
> rational fractions. I don't know if Python is one of them.
It is, but only if you explicitly request it (due to the performance
impact). Just import it:
#!/usr/bin/python2
(Did you mean to send this to the list? I hope so; I'm replying to the list.)
On Fri, Aug 26, 2016 at 8:30 PM, Milan Krčmář wrote:
>> Two reasons. One is that Python allows you to call any function and
>> inspect its return value - async functions are no different, and they
>> do return something
mlz writes:
> It's true that a*(b/c) yields fractions which would probably accrue
> accuracy errors depending on how those values are implemented. For
> example, it is possible to represent 1/3 internally as two numbers,
> numerator and denominator, thus avoiding the repeating decimal (or
> binima
On 26 August 2016 at 08:22, Frank Millman wrote:
> "Peter Otten" wrote in message news:npn25e$s5n$1...@blaine.gmane.org...
>
> Frank Millman wrote:
>
>>> As you have to keep the "<", why bother?
>>
>>
>> If you mean why don't I convert the '<' to '<', the answer is that I do
>> - I just omitted t
It's true that a*(b/c) yields fractions which would probably accrue accuracy
errors depending on how those values are implemented. For example, it is
possible to represent 1/3 internally as two numbers, numerator and denominator,
thus avoiding the repeating decimal (or binimal, or whatever it's
Partly it's the layout, but mathematically speaking the two should be equal.
(a*b)/c should equal a*(b/c)
The fact that they're not is surprising, because python 2 so seamlessly
supports big integers in a mathematically correct way.
I consider such surprising behavior to be abstraction leak, wh
Chris Angelico :
> On Fri, Aug 26, 2016 at 7:41 PM, Marko Rauhamaa wrote:
>> How about making *every* function *always* and async,
>> unconditionally? That way *every* function would be an async and
>> every function call would be an await.
>
> If you want threading, you know where to find it.
Ul
Aha. That's interesting.
On Friday, August 26, 2016 at 2:11:32 AM UTC-7, Peter Otten wrote:
> mlz wrote:
>
> > Yes, I just worked that out. It's the integer math that's the problem.
> >
> > I guess this has been fixed in python 3, but unfortunately it seems that
> > most people are still using
On Fri, Aug 26, 2016 at 7:41 PM, Marko Rauhamaa wrote:
> How about making *every* function *always* and async, unconditionally?
> That way *every* function would be an async and every function call
> would be an await.
If you want threading, you know where to find it.
ChrisA
--
https://mail.pyt
On 26/08/2016 08:14, mlzarathus...@gmail.com wrote:
However, precedence wasn't the problem in this case, it was the type conversion.
I think it was. I was puzzled as well.
But apparently if you have:
x * = expr
That's like:
x = x * (expr)# note the parentheses
which may not al
Kouli :
> We now have explicit syntax with keyword 'async' so why should we use
> yet the additional keyword 'await'?
This is an important question.
> This way, one would not have to differentiate between function and
> coroutine "call" from within a coroutine...
You'd still need to remember to
d...@forestfield.co.uk wrote:
> In a program I'm converting to Python 3 I'm examining a list of divisor
> values, some of which can be None, to find the first with a value greater
> than 1.
>
> Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)]
> on win32 Type "help", "copy
On Fri, Aug 26, 2016 at 6:55 PM, Kouli wrote:
> recently, I have discovered Python's coroutines and enjoyed the whole
> asyncio system a lot. But I ask you to make me understand one thing in
> Python's coroutines design: why do we have to use "await" (or "yield
> from") in coroutines? Why can coro
mlzarathus...@gmail.com wrote:
> Yes, I just worked that out. It's the integer math that's the problem.
>
> I guess this has been fixed in python 3, but unfortunately it seems that
> most people are still using python 2.
Note that you can get Python 3's default behaviour in Python 2 with
from _
On Fri, Aug 26, 2016 at 6:50 PM, d...@forestfield.co.uk
wrote:
> In a program I'm converting to Python 3 I'm examining a list of divisor
> values, some of which can be None, to find the first with a value greater
> than 1.
>
> Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Int
Hello,
recently, I have discovered Python's coroutines and enjoyed the whole
asyncio system a lot. But I ask you to make me understand one thing in
Python's coroutines design: why do we have to use "await" (or "yield
from") in coroutines? Why can coroutines etc. not be used
_from_coroutines_ (desi
In a program I'm converting to Python 3 I'm examining a list of divisor values,
some of which can be None, to find the first with a value greater than 1.
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more i
Am 26.08.16 um 09:53 schrieb Erik:
On 26/08/16 08:44, mlzarathus...@gmail.com wrote:
Here's the key:
$ python2
Python 2.7.10 ...
1/2
0
$ python
Python 3.5.1 ...
1/2
0.5
1//2
0
I read about this awhile ago, but it's not until it bites you that you
remember fully.
How is this rela
On Saturday, 20 August 2016 11:38:03 UTC+5:30, Steve D'Aprano wrote:
> state = ignore_negative # DON'T call the function yet
> for value in main_call():
> print(value) # for testing
> if state(value):
> print("changing state")
> state = TABLE[state]
Above code works at
On 26/08/16 08:14, mlzarathus...@gmail.com wrote:
I was being facetious, but behind it is a serious point. Neither the APL nor
the J languages use precedence even though their inventor, Ken Iverson, was a
mathematician.
That was to support functional programming dating back to the 1970's.
P
On 26/08/16 08:44, mlzarathus...@gmail.com wrote:
Here's the key:
$ python2
Python 2.7.10 ...
1/2
0
$ python
Python 3.5.1 ...
1/2
0.5
1//2
0
I read about this awhile ago, but it's not until it bites you that you remember
fully.
How is this related to your question? The example e
Here's the key:
$ python2
Python 2.7.10 ...
>>> 1/2
0
>>>
$ python
Python 3.5.1 ...
>>> 1/2
0.5
>>> 1//2
0
>>>
I read about this awhile ago, but it's not until it bites you that you remember
fully.
--
https://mail.python.org/mailman/listinfo/python-list
mlzarathus...@gmail.com writes:
> Yes, I just worked that out. It's the integer math that's the problem.
>
> I guess this has been fixed in python 3 [- -]
Note that division in Python 3 produces approximate results (floating
point numbers). This may or may not be what you want in this exercise.
I
I was being facetious, but behind it is a serious point. Neither the APL nor
the J languages use precedence even though their inventor, Ken Iverson, was a
mathematician.
That was to support functional programming dating back to the 1970's.
However, precedence wasn't the problem in this case, i
Yes, I just worked that out. It's the integer math that's the problem.
I guess this has been fixed in python 3, but unfortunately it seems that most
people are still using python 2.
Thanks for all the help!
--
https://mail.python.org/mailman/listinfo/python-list
43 matches
Mail list logo