Correct me if I'm wrong, but at a high level you appear to basically
just have a mapping of strings to values and you are then shifting all
of those values by a fixed constant (in this case, `z = 5`). Why are you
using a dict at all? It would be better to use something like a numpy
array or a serie
On 19/10/2017 17:50, Stefan Ram wrote:
Robin Becker writes:
...
this sort of makes sense for single attributes, but ignores the possibility of
combining the attributes to make the checks more discerning.
What I wrote also applies to compound attributes
(sets of base attributes).
Hello, I tried the following:
import copy
a = 5
b = copy.copy(a)
a is b
True
I was expecting False
I am aware that it is useless to copy an integer
(or any immutable type).
I know that for small integers, there is always a
single integer object in memory, and that for larger
one's there ma
"ast" a écrit dans le message de
news:59e9b419$0$3602$426a7...@news.free.fr...
Neither works for large integers which is
even more disturbing
a = 6555443
b = copy.copy(a)
a is b
True
--
https://mail.python.org/mailman/listinfo/python-list
"ast" writes:
> "ast" a écrit dans le message de
> news:59e9b419$0$3602$426a7...@news.free.fr...
>
> Neither works for large integers which is
> even more disturbing
>
> a = 6555443
> b = copy.copy(a)
> a is b
>
> True
In copy.py:
| [...]
| def _copy_immutable(x):
| return x
| for t in (t
On 10/20/2017 10:30 AM, ast wrote:
> I am aware that it is useless to copy an integer
> (or any immutable type).
>
> ...
>
> any comments ?
>
>
Why is this a problem for you?
Cheers,
Thomas
--
https://mail.python.org/mailman/listinfo/python-list
"Thomas Nyberg" a écrit dans le message de
news:mailman.378.1508491267.12137.python-l...@python.org...
On 10/20/2017 10:30 AM, ast wrote:
I am aware that it is useless to copy an integer
(or any immutable type).
...
any comments ?
Why is this a problem for you?
Cheers,
Thomas
It is no
ast,
For what it's worth,
After
a = 5
b = 5
afloat = float(a)
bfloat = float(b)
afloat is bfloat
returns False.
Stephen Tucker.
On Fri, Oct 20, 2017 at 9:58 AM, ast wrote:
>
> "ast" a écrit dans le message de
> news:59e9b419$0$3602$426a7...@news.free.fr...
>
> Neither works for large int
On 2017-10-20 10:58, ast wrote:
>
> "ast" a écrit dans le message de
> news:59e9b419$0$3602$426a7...@news.free.fr...
>
> Neither works for large integers which is
> even more disturbing
>
> a = 6555443
> b = copy.copy(a)
> a is b
>
> True
Why is this disturbing? As you said, it'd be complete
Thanks MRAB, your solution works a treat.
I'm replying to the list so others can know that this solution works.
Note that sys.stderr.detach() is only available in >= 3.1, so one might
need to do some version checking to get it to work properly in both
versions. It also can mess up with the buf
On 20/10/2017 10:09, Thomas Jollans wrote:
Read the source if you want to know how this is done.
https://github.com/python/cpython/blob/master/Lib/copy.py#L111
Good, informative comment block at the top of the type that you don't
see often. Usually they concern themselves with licensing or wi
On 2017-10-20 13:17, bartc wrote:
> On 20/10/2017 10:09, Thomas Jollans wrote:
>
>> Read the source if you want to know how this is done.
>> https://github.com/python/cpython/blob/master/Lib/copy.py#L111
>
> Good, informative comment block at the top of the type that you don't
> see often. Usuall
On Oct 19, 2017, at 5:18 PM, Steve D'Aprano wrote:
> What t1 and t2 are, I have no idea. Your code there suggests that they are
> fields in your data records, but the contents of the fields, who knows?
t1 and t2 are *independent* timestamp fields. My apologies - I made the
obviously false assump
tldr: I have an object that can't be picked. Is there any way to do a "raw"
dump of the binary data to a file, and re-load it later?
Details: I am using a java (I know, I know - this is a python list. I'm not
asking about the java - honest!) library (Jasper Reports) that I access from
python us
On 2017-10-20 18:05, Israel Brewster wrote:[snip]
In a sense, in that it supports my initial approach.
As Stefan Ram pointed out, there is nothing wrong with the solution I have: simply using
if statements around the calculated lateness of t1 and t2 to increment the appropriate
counters. I was
On 2017-10-20 18:19, Israel Brewster wrote:
tldr: I have an object that can't be picked. Is there any way to do a "raw"
dump of the binary data to a file, and re-load it later?
Details: I am using a java (I know, I know - this is a python list. I'm not asking
about the java - honest!) library
Yes, it is a simplification and I am using numpy at lower layers. You correctly
observe that it's a simple operation, but it's not a shift it's actually
multidimensional vector algebra in numpy. So the - is more conceptual and takes
the place of hundreds of subtractions. But the example dies dem
On Oct 20, 2017, at 11:09 AM, Stefan Ram wrote:
>
> Israel Brewster writes:
>> Given that, is there any way I can write out the "raw" binary
>> data to a file
>
> If you can call into the Java SE library, you can try
>
> docs.oracle.com/javase/9/docs/api/java/io/ObjectOutputStream.html#writeO
On Fri, 20 Oct 2017 09:05:15 -0800, Israel Brewster wrote:
> On Oct 19, 2017, at 5:18 PM, Steve D'Aprano
> wrote:
>> What t1 and t2 are, I have no idea. Your code there suggests that they
>> are fields in your data records, but the contents of the fields, who
>> knows?
>
> t1 and t2 are *indepen
Is there a recommended library for manipulating grapheme clusters?
In particular, in devanagari
क् + ि = कि
in (pseudo)unicode names
KA-letter + I-sign = KI-composite-letter
I would like to be able to handle KI as a letter rather than two code-points.
Can of course write an automaton to group bu
There is a trick that I use when data transfer is the performance killer. Just
save your big array first (for instance on and .hdf5 file) and send to the
workers the indices to retrieve the portion of the array you are interested in
instead of the actual subarray.
Anyway there are cases where m
On Sat, Oct 21, 2017 at 3:25 PM, Stefan Ram wrote:
> Rustom Mody writes:
>>Is there a recommended library for manipulating grapheme clusters?
>
> The Python Library has a module "unicodedata", with functions like:
>
> |unicodedata.normalize( form, unistr )
> |
> |Returns the normal form »form«
22 matches
Mail list logo