MRAB at 2016/11/15 11:31:41AM wrote:
> When you say "from deen import *" you're copying names and their
> references from the module's namespace to your local namespace:
>
> [module deen] [locally]
>
> tblm > [0, 0, 0] <- tb
On Tue, Nov 15, 2016 at 3:15 AM, Cem Karan wrote:
> if my C code allocates memory via GC_MALLOC() (the standard call for
> allocating memory
> in the garbage collector), and I access some object via ctypes in python,
> will the python
> garbage collector assume that it owns it and attempt to dis
On Mon, 14 Nov 2016 16:20:49 +1100, Steven D'Aprano wrote:
> import library
> SPAMIFY = False # only affects this module, no other modules
> result = library.make_spam(99)
I must be missing something, because it seems too obvious:
import library
# only affects this module, no other modu
On 2016-11-15 01:36, jf...@ms4.hinet.net wrote:
Ned Batchelder at 2016/11/15 6:33:54AM wrote:
> But I get a wrong answer this way:
> >>> from deen import *
> >>> tblm = tbli
> >>> gpa(0x7d)
> 125 # it's 0x7d, the tblm[2] is 0
>
> Why? why! why:-(
Here you are assigning a value to your own tblm
Hi all, I'm hoping that this will be an easy question.
I have a pile of C code that I wrote that I want to interface to via the ctypes
module (https://docs.python.org/3/library/ctypes.html). The C code uses the
Boehm-Demers-Weiser garbage collector (http://www.hboehm.info/gc/) for all of
its m
Ned Batchelder at 2016/11/15 6:33:54AM wrote:
> > But I get a wrong answer this way:
> > >>> from deen import *
> > >>> tblm = tbli
> > >>> gpa(0x7d)
> > 125 # it's 0x7d, the tblm[2] is 0
> >
> > Why? why! why:-(
>
> Here you are assigning a value to your own tblm, not deen.tblm,
> so gpa does n
On Sunday, November 13, 2016 at 9:39:12 PM UTC-5, jf...@ms4.hinet.net wrote:
> Running the following codes (deen.py) under Win32 python 3.4.4 terminal:
>
> tbli = [0x66, 0x27, 0xD0]
> tblm = [0 for x in range(3)]
> def gpa(data):
> td = data ^ tblm[2]
> return td
The function gpa referenc
Hi group,
this is not really a Python question, but I use Python to lex/parse some
input. In particular, I use the amazing TPG (http://cdsoft.fr/tpg/).
However, I'm now stuck at a point and am sure I'm not doing something
correctly -- since there's a bunch of really smart people here, I hope
to ge
Hello,
I'm a french student and I'm running Python 3.5.2 on windows.
When I installed Anaconda3 4.2.0 version, Pyzo couldn't find a module named
conda.
Then I registered it as my default Python 3.5.2 version, but I couldn't use
Pyzo anymore (I sent you a screenshot). So I tried to fix this problem
On Monday, November 14, 2016 at 12:21:00 AM UTC-5, Steven D'Aprano wrote:
> Don't tell me to make SPAMIFY a parameter of the function. I know that.
> That's
> what I would normally do, but *occasionally* it is still useful to have a
> global configuration setting, and those are the cases I'm ta
38016226...@gmail.com wrote:
> L=[2,1]
> L[0],L[L[0]-1]=L[L[0]-1],L[0]
>
> The L doesn't change. Can someone provide me the detail procedure of this
> expression?
Better question: Why does that list swap exist? If you're just trying
to put the language through its paces that's one thing, but I
38016226...@gmail.com writes:
> L=[2,1]
> L[0],L[L[0]-1]=L[L[0]-1],L[0]
>
> The L doesn't change. Can someone provide me the detail procedure of
> this expression?
From:
https://docs.python.org/3/reference/simple_stmts.html#grammar-token-assignment_stmt
| Although the definition of assignment i
38016226...@gmail.com writes:
> L=[2,1]
> L[0],L[L[0]-1]=L[L[0]-1],L[0]
>
> The L doesn't change. Can someone provide me the detail procedure of
> this expression?
The right-hand side evaluates to (1,2), but then the assignments to the
targets on the left-hand side are processed in order from lef
L=[2,1]
L[0],L[L[0]-1]=L[L[0]-1],L[0]
The L doesn't change. Can someone provide me the detail procedure of this
expression?
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> Suppose I have a library function that reads a global configuration setting:
>
> # Toy example
> SPAMIFY = True
> def make_spam(n):
> if SPAMIFY:
> return "spam"*n
> else:
> return "ham"*n
>
>
> Don't tell me to make SPAMIFY a parameter of the funct
I am looking for a way to stop a ThreadPoolExecutor immediately under the
assumption that I don't care about what's currently running or pending.
```
limit = 2
executor = ThreadPoolExecutor(10)
posts = itertools.islice(mygen(executor=executor, **kwargs), 0, limit)
for post in posts:
print(post)
16 matches
Mail list logo