I am new to Python. As an exercise of it, I try to port a program which was
written more than 10 years ago. This program use the Borland C++ Builder as its
GUI front end and a DLL does the real work(it will takes a few seconds to
complete). I saw a strange phenomenon in the following codes. The
"ramjee a.g." writes:
> I am using python 2.7 for extending my C++ application with python.
>
> And when two pthread of C is executing Py_NewInterpreter() it is throwing
> faltal error with ceval-orphan tstate. There is no problem when sequential
> thread execution.
"tstate" likely stands for "
Cecil Westerhof wrote:
> On Thursday 26 Nov 2015 09:29 CET, Steven D'Aprano wrote:
>
>> On Thursday 26 November 2015 18:00, Cecil Westerhof wrote:
>>
>>> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote:
>>>
In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof
write
On Thu, Nov 26, 2015 at 3:39 PM, Cecil Westerhof wrote:
> On Thursday 26 Nov 2015 12:07 CET, Dave Farrance wrote:
>> zypper in -f
>>
>> So you'll want to try package names like "python" and "python2.7".
>
> Sadly that also only installs only libraries and no applications.
Try "python-base". (Se
Steven D'Aprano writes:
> On Fri, 27 Nov 2015 12:40 pm, Ben Finney wrote:
>
> > It's still not been expressed what “fake” refers to here. Or, rather,
> > what “real” thing was being expected, and how these don't qualify.
>
> They are faked in the sense that in this implementation, the object
> li
Steven D'Aprano writes:
> On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote:
>
>
>> (Conversely, I see that unlike CPython, all PyPy's numbers have
>> unchanging ids, even after exiting PyPy and restarting, so it seems that
>> PyPy's numerical ids are "faked".)
>>
>> [PyPy 2.6.1 with GCC 4.9.2]
On Fri, Nov 27, 2015 at 1:56 PM, MRAB wrote:
> You could argue that it _does_ continue to exist, it just changes its
> form...
PyPy: The Quantum Mechanics of Python programming. If you aren't
actually looking at something right at this instant, it might exist in
a different form... or not exist a
On 2015-11-27 02:44, Steven D'Aprano wrote:
On Fri, 27 Nov 2015 12:40 pm, Ben Finney wrote:
Steven D'Aprano writes:
On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote:
> (Conversely, I see that unlike CPython, all PyPy's numbers have
> unchanging ids, even after exiting PyPy and restarting,
On Fri, 27 Nov 2015 12:40 pm, Ben Finney wrote:
> Steven D'Aprano writes:
>
>> On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote:
>>
>>
>> > (Conversely, I see that unlike CPython, all PyPy's numbers have
>> > unchanging ids, even after exiting PyPy and restarting, so it seems
>> > that PyPy's n
On Fri, 27 Nov 2015 07:00 am, Ben Finney wrote:
> Dave Farrance writes:
>
>> >> >Dave Farrance :
>> >> >
>> >> >> (Conversely, I see that unlike CPython, all PyPy's numbers have
>> >> >> unchanging ids, even after exiting PyPy and restarting, so it seems
>> >> >> that PyPy's numerical ids are "f
On 27/11/2015 01:46, Steven D'Aprano wrote:
On Thu, 26 Nov 2015 12:52 pm, Ned Batchelder wrote:
For someone who claims to be interested in language design, you're
remarkably dismissive of pretty much the entire industry. I don't think
it's worth the effort to try to change your mind.
In fair
On Thu, 26 Nov 2015 12:52 pm, Ned Batchelder wrote:
> For someone who claims to be interested in language design, you're
> remarkably dismissive of pretty much the entire industry. I don't think
> it's worth the effort to try to change your mind.
In fairness to BartC, I don't think that's malici
On Thu, 26 Nov 2015 10:23 pm, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> On Thu, Nov 26, 2015 at 9:54 PM, Marko Rauhamaa wrote:
>>>
>>>>>> hash([])
>>>Traceback (most recent call last):
>>> File "", line 1, in
>>>TypeError: unhashable type: 'list'
>>>
>>> Annoying.
>>
>> Yes
Steven D'Aprano writes:
> On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote:
>
>
> > (Conversely, I see that unlike CPython, all PyPy's numbers have
> > unchanging ids, even after exiting PyPy and restarting, so it seems
> > that PyPy's numerical ids are "faked".)
>
> I'm pretty sure that they ar
On Thu, 26 Nov 2015 09:34 pm, Dave Farrance wrote:
> (Conversely, I see that unlike CPython, all PyPy's numbers have
> unchanging ids, even after exiting PyPy and restarting, so it seems that
> PyPy's numerical ids are "faked".)
>
> [PyPy 2.6.1 with GCC 4.9.2] on linux2
> id(1+2j)
> 67990011
On Thu, 26 Nov 2015 08:02 pm, fl wrote:
> Hi,
>
> I see the following from a previous post:
>
>
> Python 1.5.2 (#1, Aug 27 2012, 09:09:18) [GCC 4.1.2 20080704 (Red Hat
> 4.1.2-52)] on linux2
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
import dis
code = compile("(1
All were really helpful thanks a lot. Now I'm interested in identifying a
particular index after being able to print out each word. Printing each word
to the console I have :
['METEOSAT-7']
['1', '24932U', '97049B', '15319.57839525', '.0058', '0-0', '0+0',
'0', '9994']
['2', '249
On Thu, 26 Nov 2015 07:27 pm, Marko Rauhamaa wrote:
> What I'm saying is that Python does not prevent mutable keys but tries
> to do that with lists and tuples.
>
> I think Python should stop trying.
>
> I have wanted to use lists as keys, and there should be no reason to
> allow mutable tuples.
On 2015-11-27 00:15, Random832 wrote:
Chris Angelico writes:
Windows: I'm not sure, and frankly, I don't trust it. A quick test
showed a couple of failures:
It might be case insensitive only for ASCII.
Windows uses a simple WCHAR->WCHAR (lower->upper) mapping for case
comparison. it doesn't
On Thu, 26 Nov 2015 12:23 pm, BartC wrote:
> On 26/11/2015 00:31, Steven D'Aprano wrote:
>> In 2015, it's hard to think of any non-obsolete, non-toy language which
>> doesn't treat functions as first-class values, including creating them on
>> the fly. Fortran and C perhaps.
>
> It's funny then
On Fri, Nov 27, 2015 at 11:15 AM, Random832 wrote:
> Chris Angelico writes:
>> Windows: I'm not sure, and frankly, I don't trust it. A quick test
>> showed a couple of failures:
>>
>> It might be case insensitive only for ASCII.
>
> Windows uses a simple WCHAR->WCHAR (lower->upper) mapping for ca
Chris Angelico writes:
> Windows: I'm not sure, and frankly, I don't trust it. A quick test
> showed a couple of failures:
>
> It might be case insensitive only for ASCII.
Windows uses a simple WCHAR->WCHAR (lower->upper) mapping for case
comparison. it doesn't handle those cases, but it does ha
On Fri, Nov 27, 2015 at 9:27 AM, BartC wrote:
> On 26/11/2015 13:15, Chris Angelico wrote:
>>
>> On Thu, Nov 26, 2015 at 11:53 PM, BartC wrote:
>
>
>>> http://pastebin.com/JrVTher6
>
>
>> #14 and #15: Are you assuming that a character is a byte and that
>> diacritical-free English is the only lan
On 26/11/2015 13:15, Chris Angelico wrote:
On Thu, Nov 26, 2015 at 11:53 PM, BartC wrote:
http://pastebin.com/JrVTher6
#14 and #15: Are you assuming that a character is a byte and that
diacritical-free English is the only language in the world?
I don't think that need be the assumption.
BartC wrote:
I simply stated that Python's approach was novel. Steven D'Aprano then
responded by belittling my view, and effectively trashing every language
I've ever used.
He pointed out that many other dynamic languages construct
functions on the fly the same way that Python does, going
all
On Thursday 26 Nov 2015 12:07 CET, Dave Farrance wrote:
> Cecil Westerhof wrote:
>
>> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote:
>>>
>>> Your Suse system probably wants to use python for something. If
>>> your system python is damaged, you badly need to fix that, using
>>> the sys
On Thursday 26 Nov 2015 09:29 CET, Steven D'Aprano wrote:
> On Thursday 26 November 2015 18:00, Cecil Westerhof wrote:
>
>> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote:
>>
>>> In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof
>>> writes:
My system python was
On 26/11/2015 20:00, Ben Finney wrote:
Dave Farrance writes:
Dave Farrance :
(Conversely, I see that unlike CPython, all PyPy's numbers have
unchanging ids, even after exiting PyPy and restarting, so it seems
that PyPy's numerical ids are "faked".)
Hence
https://en.wikipedia.org/wiki/Scar
Gregory Ewing :
> Marko Rauhamaa wrote:
>> What I'm saying is that Python does not prevent mutable keys but
>> tries to do that with lists and tuples.
>>
>> I think Python should stop trying.
>
> Do you volunteer to answer all the posts from beginners complaining
> that "the dict type is broken" b
Marko Rauhamaa wrote:
What I'm saying is that Python does not prevent mutable keys but tries
to do that with lists and tuples.
I think Python should stop trying.
Do you volunteer to answer all the posts from beginners
complaining that "the dict type is broken" because they
used a list as a key
On 11/26/2015 12:34 PM, vincentype...@gmail.com wrote:
Hey, I'm wondering how to read individual strings in a text file. I can read a
text file by lines with .readlines() ,
but I need to read specifically by strings, not including spaces. Thanks in
advance
Read the lines with readlines(), a
>
> Hey, I'm wondering how to read individual strings in a text file. I can
> read a text file by lines with .readlines() ,
> but I need to read specifically by strings, not including spaces. Thanks
> in advance
>
How about:
for a_string in open("/path/to/file").read().split():
print(a_stri
On Thu, 26 Nov 2015 12:34:36 -0800, vincentypedro wrote:
> Hey, I'm wondering how to read individual strings in a text file. I can
> read a text file by lines with .readlines() ,
> but I need to read specifically by strings, not including spaces.
> Thanks in advance
How do you define a string?
Hey, I'm wondering how to read individual strings in a text file. I can read a
text file by lines with .readlines() ,
but I need to read specifically by strings, not including spaces. Thanks in
advance
--
https://mail.python.org/mailman/listinfo/python-list
Dave Farrance writes:
> >> >Dave Farrance :
> >> >
> >> >> (Conversely, I see that unlike CPython, all PyPy's numbers have
> >> >> unchanging ids, even after exiting PyPy and restarting, so it seems
> >> >> that PyPy's numerical ids are "faked".)
>
> Hence
>
> https://en.wikipedia.org/wiki/Scare_
Op 26-11-15 om 16:36 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> [ for in ]
>>
>> would implicitly be rewritten as follows:
>>
>> [ (lambda : )() for in ]
>
> Funny enough, that's how "list comprehensions" are created in Scheme:
>
>(map (lambda (i)
> (lambda (x) (* i
In a message of Thu, 26 Nov 2015 15:15:43 -0200, jorge.conr...@cptec.inpe.br wr
ites:
>Hi,
>
>
>I'm startig in Python and I have a 4D binary data. The dimension of my
>data is:
>
>67 > longitude points
>41 > latitude points
>10 > pressure levels points
>33 > time points
>
>
>How ca
On Thu, 26 Nov 2015 15:15:43 -0200, jorge.conrado wrote:
> I'm startig in Python and I have a 4D binary data. The dimension of my
> data is:
>
> 67 > longitude points 41 > latitude points 10 > pressure
> levels points 33 > time points
>
> How can I read this data and what can I d
On 26/11/2015 17:15, jorge.conr...@cptec.inpe.br wrote:
Hi,
I'm startig in Python and I have a 4D binary data. The dimension of my
data is:
67 > longitude points
41 > latitude points
10 > pressure levels points
33 > time points
How can I read this data and what can I do to ge
Hi,
I'm startig in Python and I have a 4D binary data. The dimension of my
data is:
67 > longitude points
41 > latitude points
10 > pressure levels points
33 > time points
How can I read this data and what can I do to get a 2D array
(longitude,latitude) for a specific press
On 2015-11-26 12:53, BartC wrote:
On 26/11/2015 01:52, Ned Batchelder wrote:
On Wednesday, November 25, 2015 at 8:23:36 PM UTC-5, BartC wrote:
On 26/11/2015 00:31, Steven D'Aprano wrote:
It really, truly isn't. Your viewpoint is clouded by too much immersion in
crippled languages. *Old and o
Antoon Pardon writes:
> Op 26-11-15 om 14:56 schreef Marko Rauhamaa:
>> Antoon Pardon wrote:
>>
>>> I don't understand. What I propose would be a minor change in how
>>> list comprehension works. I don't see how your example can be turned
>>> into a list comprehension.
>>
>> The list comprehension
On 2015-11-26 14:40, BartC wrote:
On 26/11/2015 13:15, Chris Angelico wrote:
On Thu, Nov 26, 2015 at 11:53 PM, BartC wrote:
FWIW here is that list of features that are different between Python and my
language, or that work a different way, or that I think could be a useful
addition. (Although
> PyPi: https://pypi.python.org/pypi/tornadostreamform
> Documentation: https://pypi.python.org/pypi/tornadostreamform
Wrong paste. Here is the good one:
https://pythonhosted.org/tornadostreamform/
--
https://mail.python.org/mailman/listinfo/python-list
Pure python module that let’s you upload *huge* files to a tornado web
server.
This project provides the
|tornadostreamform.multipart_streamer.MultiPartStreamer| class that
incrementally parses incoming multipart/form-data, splits it into form
fields, and streams the fields into file like objects
Antoon Pardon :
> [ for in ]
>
> would implicitly be rewritten as follows:
>
> [ (lambda : )() for in ]
Funny enough, that's how "list comprehensions" are created in Scheme:
(map (lambda (i)
(lambda (x) (* i x)))
'(0 1 2 3
> There would no change on how lamb
On 11/25/2015 3:34 PM, francis funari wrote:
I have tried installing Python 3 on windows 10 it install OK but I do
not get Idle. When I type Idle in the interpreter nothing happen
Starting programs by typing their names into the interactive interpreter
does not work.
Use Start Menu | All App
In a message of Wed, 25 Nov 2015 20:34:01 +, francis funari writes:
>I have tried installing Python 3 on windows 10 it install OK but I do not get
>Idle. When I type Idle in the interpreter nothing happen can you send me a
>link to latest release of Python 3 with Idle that will run on windows
On Wed, 25 Nov 2015 12:42:00 -0800, ryguy7272 wrote:
> Hello experts. I'm looking at this url:
> https://en.wikipedia.org/wiki/Wikipedia:Unusual_place_names
>
> I'm trying to figure out how to list all 'a title' elements.
a is the element tag, title is an attribute of the htmlanchorelement.
co
On 26/11/2015 13:15, Chris Angelico wrote:
On Thu, Nov 26, 2015 at 11:53 PM, BartC wrote:
FWIW here is that list of features that are different between Python and my
language, or that work a different way, or that I think could be a useful
addition. (Although Python's internal workings make man
Op 26-11-15 om 14:56 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> I don't understand. What I propose would be a minor change in
>> how list comprehension works. I don't see how your example
>> can be turned into a list comprehension.
> The list comprehension is only a special case of the interact
On Thu, Nov 26, 2015 at 11:53 PM, BartC wrote:
> FWIW here is that list of features that are different between Python and my
> language, or that work a different way, or that I think could be a useful
> addition. (Although Python's internal workings make many impractical.)
>
> http://pastebin.com/
Antoon Pardon :
> I don't understand. What I propose would be a minor change in
> how list comprehension works. I don't see how your example
> can be turned into a list comprehension.
The list comprehension is only a special case of the interaction between
closures and variables. If you dabble wi
On Thu, Nov 26, 2015 at 7:46 AM, Devin Jeanpierre
wrote:
> Why not take ownership of the file object, instead of requiring users
> to manage lifetimes?
Yeah, I've kind of been coming to this conclusion. So my question
then becomes: how do I "take ownership" of it? I already keep a
reference to
Op 26-11-15 om 13:56 schreef Marko Rauhamaa:
> Antoon Pardon :
>
>> Personnaly I would prefer:
>>
> q = [(lambda i: lambda x: i * x)(i) for i in range(4)]
> q[0](1), q[3](1)
>> (0, 3)
>>
>> And this is where I ask whether it would be worth the effort to change
>> the behaviour of python.
>
On Thu, Nov 26, 2015 at 7:36 AM, MRAB wrote:
> Why pass a file descriptor? Why not a filename?
The reason for a file descriptor is so that I can also add other
file-like objects, such as StringIO. My unit tests, for instance,
rely heavily on this. That being said, it is not *strictly* required
In Scott Montreuil
writes:
> I have an if statement which seems to run both commands and I cannot
> figure out why.
I'm not sure what you mean by "both commands". Do you mean that the
'if' and 'else' branches both execute?
Your if/else branches are in a loop, so perhaps you're seeing the 'if
Antoon Pardon :
> Personnaly I would prefer:
>
q = [(lambda i: lambda x: i * x)(i) for i in range(4)]
q[0](1), q[3](1)
> (0, 3)
>
> And this is where I ask whether it would be worth the effort to change
> the behaviour of python.
Don't go there.
Consider:
q = []
n = 0
x =
In the last weeks I have asked here some beginners questions and got great
response. I was able to solve all my problems.
Now, my first real Python program is ready: fexit, a F*EX client.
And what is F*EX?
==> Frams' Fast File EXchange, a service for transfering files of ANY size
from any user A
On 26/11/2015 01:52, Ned Batchelder wrote:
On Wednesday, November 25, 2015 at 8:23:36 PM UTC-5, BartC wrote:
On 26/11/2015 00:31, Steven D'Aprano wrote:
It really, truly isn't. Your viewpoint is clouded by too much immersion in
crippled languages. *Old and obsolete versions* of crippled langu
Why not take ownership of the file object, instead of requiring users
to manage lifetimes?
-- Devin
On Wed, Nov 25, 2015 at 12:52 PM, Chris Lalancette
wrote:
> Hello,
> I'm currently developing a library called pyiso (
> https://github.com/clalancette/pyiso), used for manipulating ISO disk
On 2015-11-25 20:52, Chris Lalancette wrote:
Hello,
I'm currently developing a library called pyiso (
https://github.com/clalancette/pyiso), used for manipulating ISO disk
images. I'm pretty far along with it, but there is one part of the API
that I really don't like.
Typical usage of
Chris Angelico :
> On Thu, Nov 26, 2015 at 10:23 PM, Marko Rauhamaa wrote:
>> It's not letting me in the case of list.
>
> Actually it is. Your mistake is trying to use a list as a dict key.
> You have a solution available: use a tuple.
Yes, or wrap the list in a class.
Marko
--
https://mail.
Op 26-11-15 om 12:49 schreef Chris Angelico:
> I can't remember which language it was (maybe Lua?), but I know
> there's one that uses a machine word to store either a pointer to a
> heap object, or an integer of at most one less bit than the machine
> word, represented by 2*n+1.
I think that was
On Thu, Nov 26, 2015 at 10:24 PM, Ben Finney wrote:
> Dave Farrance writes:
>
>> Marko Rauhamaa wrote:
>>
>> >Dave Farrance :
>> >
>> >> (Conversely, I see that unlike CPython, all PyPy's numbers have
>> >> unchanging ids, even after exiting PyPy and restarting, so it seems
>> >> that PyPy's num
Ben Finney wrote:
>Dave Farrance writes:
>
>> Marko Rauhamaa wrote:
>>
>> >Dave Farrance :
>> >
>> >> (Conversely, I see that unlike CPython, all PyPy's numbers have
>> >> unchanging ids, even after exiting PyPy and restarting, so it seems
>> >> that PyPy's numerical ids are "faked".)
>> >
>> >
Op 26-11-15 om 12:13 schreef Nobody:
> Returning to the original expression:
>
> > q = [lambda x: i * x for i in range(4)]
> > q[0](1), q[3](1)
> (3, 3)
> > q = [lambda x,i=i: i * x for i in range(4)]
> > q[0](1), q[3](1)
> (0, 3)
Personnaly I would prefer:
>>>
On Thu, Nov 26, 2015 at 10:23 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> On Thu, Nov 26, 2015 at 9:54 PM, Marko Rauhamaa wrote:
>>>
>>>>>> hash([])
>>>Traceback (most recent call last):
>>> File "", line 1, in
>>>TypeError: unhashable type: 'list'
>>>
>>> Annoying.
>>
>>
Dave Farrance :
> Marko Rauhamaa wrote:
>>What's a faked id?
>
> You can figure out what I'm getting at -- i.e. I presume that the ids
> are not pointers to stored numbers in memory (as with CPython) but are
> a translation of the numerical variable's value.
CPython is within its rights to fake
On Thu, Nov 26, 2015 at 10:12 PM, Dave Farrance wrote:
> Marko Rauhamaa wrote:
>
>>Dave Farrance :
>>
>>> (Conversely, I see that unlike CPython, all PyPy's numbers have
>>> unchanging ids, even after exiting PyPy and restarting, so it seems
>>> that PyPy's numerical ids are "faked".)
>>
>>What's
Chris Angelico :
> On Thu, Nov 26, 2015 at 9:54 PM, Marko Rauhamaa wrote:
>>
>>>>> hash([])
>>Traceback (most recent call last):
>> File "", line 1, in
>>TypeError: unhashable type: 'list'
>>
>> Annoying.
>
> Yes, it's really annoying that you get an immediate exception instead
Dave Farrance writes:
> Marko Rauhamaa wrote:
>
> >Dave Farrance :
> >
> >> (Conversely, I see that unlike CPython, all PyPy's numbers have
> >> unchanging ids, even after exiting PyPy and restarting, so it seems
> >> that PyPy's numerical ids are "faked".)
> >
> >What's a faked id?
>
> You can
On 26/11/2015 06:52, Marko Rauhamaa wrote:
Steven D'Aprano :
Making tuples mutable would break their use as dictionary keys, which is a
*critical* use.
No, it wouldn't. Any object that provides __hash__() and __eq__() can be
used as a key.
Almost, see https://wiki.python.org/moin/Dictionar
Marko Rauhamaa wrote:
>Dave Farrance :
>
>> (Conversely, I see that unlike CPython, all PyPy's numbers have
>> unchanging ids, even after exiting PyPy and restarting, so it seems
>> that PyPy's numerical ids are "faked".)
>
>What's a faked id?
You can figure out what I'm getting at -- i.e. I pre
On Wed, 25 Nov 2015 14:51:23 +0100, Antoon Pardon wrote:
> Am I missing something?
The issue is with lambdas rather than with list comprehensions per se.
Python's lambdas capture free variables by reference, not value.
> x = 3
> f = lambda y: x + y
> f(0)
3
Cecil Westerhof wrote:
>On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote:
>>
>> Your Suse system probably wants to use python for something. If your
>> system python is damaged, you badly need to fix that, using the
>> system package managers tools, before Suse does some sort of update
>
On Thu, Nov 26, 2015 at 9:54 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> On Thu, Nov 26, 2015 at 7:27 PM, Marko Rauhamaa wrote:
>>> I have wanted to use lists as keys, and there should be no reason to
>>> allow mutable tuples. It should be enough to say that the behavior of
>>> a dictionary
Dave Farrance :
> (Conversely, I see that unlike CPython, all PyPy's numbers have
> unchanging ids, even after exiting PyPy and restarting, so it seems
> that PyPy's numerical ids are "faked".)
What's a faked id?
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico :
> On Thu, Nov 26, 2015 at 7:27 PM, Marko Rauhamaa wrote:
>> I have wanted to use lists as keys, and there should be no reason to
>> allow mutable tuples. It should be enough to say that the behavior of
>> a dictionary is undefined if a key should mutate on the fly.
>
> Python def
Alan Bawden wrote:
>Chris Angelico writes:
> ...
>> Python 2.7.8 (2.4.0+dfsg-3, Dec 20 2014, 13:30:46)
>> [PyPy 2.4.0 with GCC 4.9.2] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> tuple([]) is tuple([])
>> False
>
>I said I wouldn't be suprised if it
On Thu, Nov 26, 2015 at 8:02 PM, fl wrote:
> Are there something, my input or Python difference
> make the output different?
Anything involving the disassembly of Python code depends heavily on
internal interpreter details. You just quoted something showing that
ancient versions of Python did at
fl writes:
> Python 1.5.2 (#1, Aug 27 2012, 09:09:18) [GCC 4.1.2 20080704 (Red Hat
> 4.1.2-52)] on linux2
The context of the post was discussing the behavior of a
very old version of python. I'm not sure how you missed
this.
> When I run the above three line code, I get the following:
Further
Hi,
I see the following from a previous post:
Python 1.5.2 (#1, Aug 27 2012, 09:09:18) [GCC 4.1.2 20080704 (Red Hat
4.1.2-52)] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import dis
>>> code = compile("(1, 2, 3)", "", "eval")
>>> dis.dis(code)
0 S
Op 26-11-15 om 09:27 schreef Marko Rauhamaa:
> Chris Angelico :
>
>> On Thu, Nov 26, 2015 at 5:52 PM, Marko Rauhamaa wrote:
>>> Nothing prevents using mutable objects as keys in Python.
>> Sure, you _can_. But if the key's hash changes between dict insertion
>> and retrieval, all manner of invaria
Hi,
I am using python 2.7 for extending my C++ application with python.
And when two pthread of C is executing Py_NewInterpreter() it is throwing
faltal error with ceval-orphan tstate. There is no problem when sequential
thread execution.
Let me know if any solution to be fixed in my python lib
I have tried installing Python 3 on windows 10 it install OK but I do not get
Idle. When I type Idle in the interpreter nothing happen can you send me a link
to latest release of Python 3 with Idle that will run on windows 10 64 bit
Hello,
I'm currently developing a library called pyiso (
https://github.com/clalancette/pyiso), used for manipulating ISO disk
images. I'm pretty far along with it, but there is one part of the API
that I really don't like.
Typical usage of the library is something like:
import pyiso
p
On Thu, Nov 26, 2015 at 7:27 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> On Thu, Nov 26, 2015 at 5:52 PM, Marko Rauhamaa wrote:
>>> Nothing prevents using mutable objects as keys in Python.
>>
>> Sure, you _can_. But if the key's hash changes between dict insertion
>> and retrieval, all man
On Thursday 26 November 2015 18:00, Cecil Westerhof wrote:
> On Wednesday 25 Nov 2015 23:58 CET, Laura Creighton wrote:
>
>> In a message of Wed, 25 Nov 2015 22:52:23 +0100, Cecil Westerhof
>> writes:
>>>
>>> My system python was all-ready damaged: that is why I wanted to
>>> build myself.
>>
>>
Op 26-11-15 om 02:52 schreef Ned Batchelder:
> I almost started to explain about how yes, Python is often written in
> conservative static ways. I was going to mention that a little dynamic
> nature goes a long way, and is never far from the surface in even the
> simplest Python programs.
>
> But I
Chris Angelico :
> On Thu, Nov 26, 2015 at 5:52 PM, Marko Rauhamaa wrote:
>> Nothing prevents using mutable objects as keys in Python.
>
> Sure, you _can_. But if the key's hash changes between dict insertion
> and retrieval, all manner of invariants will break, and likewise if
> two equal object
Op 25-11-15 om 23:38 schreef Ian Kelly:
> On Wed, Nov 25, 2015 at 2:05 PM, Antoon Pardon
> wrote:
>> Op 25-11-15 om 21:39 schreef Ian Kelly:
>>
>>> I believe that sentence from the docs is using "some" to mean "not
>>> all", whereas you are apparently using it to mean "any".
>>>
>>> frozenset([1,2
On Thu, Nov 26, 2015 at 5:52 PM, Marko Rauhamaa wrote:
> Steven D'Aprano :
>
>> Making tuples mutable would break their use as dictionary keys, which is a
>> *critical* use.
>
> No, it wouldn't. Any object that provides __hash__() and __eq__() can be
> used as a key.
>
> Nothing prevents using mut
93 matches
Mail list logo