loop (r in this case) takes on the
values of the elements of the list, not the indexes of the elements.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
65]
def function(m):
m2 = m
m3 = m[:]
takethenameof(m)
takethenameof(m2)
takethenameof(m3)
takethenameof(m[:])
takethenameof(2)
takethenameof(2+2)
There are samples online that try to do a "reasonable" job of this, but
On 1/5/14 8:22 AM, Ned Batchelder wrote:
On 1/5/14 8:14 AM, Mark Lawrence wrote:
http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/
Please don't shoot the messenger :)
With all of the talk about py 2 vs. py3 these days, this is the blog
post that I think deserves the most real atte
On 1/5/14 8:48 PM, Chris Angelico wrote:
On Mon, Jan 6, 2014 at 12:16 PM, Ned Batchelder wrote:
So now we have two revered developers vocally having trouble with Python 3.
You can dismiss their concerns as niche because it's only network
programming, but that would be a mistake.
IMO, ne
On 1/5/14 11:26 PM, Terry Reedy wrote:
On 1/5/2014 8:16 PM, Ned Batchelder wrote:
OK, let's see what we got from three core developers on this list:
To me, the following is a partly unfair summary.
I apologize, I'm sure there were details I skipped in my short summary.
oded bytes as text is the problem here.
I think the whole forking community is confused at because of your own
arrogance. Foo(l)s.
markj
If you want to participate in this discussion, do so. Calling people
strange, arrogant, and fools with no technical content is just rude.
Typing "YO
On 1/6/14 12:50 PM, Steven D'Aprano wrote:
Ned Batchelder wrote:
You are still talking about whether Armin is right, and whether he
writes well, about flaws in his statistics, etc. I'm talking about the
fact that an organization (Python core development) has a product
(Python
On 1/6/14 11:29 AM, Antoine Pitrou wrote:
Ned Batchelder nedbatchelder.com> writes:
You can look through his problems and decide that he's "wrong," or that
he's "ranting," but that doesn't change the fact that Python 3 is
encountering friction. What
'm not going to tell you why" approach.
Please stop baiting people.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
On 1/6/14 5:08 PM, Mark Lawrence wrote:
On 06/01/2014 21:42, Ned Batchelder wrote:
On 1/6/14 4:33 PM, Mark Lawrence wrote:
On 06/01/2014 21:17, Gene Heskett wrote:
On Monday 06 January 2014 16:16:13 Terry Reedy did opine:
On 1/6/2014 9:32 AM, Gene Heskett wrote:
And from my lurking here
On 1/6/14 5:16 PM, Antoine Pitrou wrote:
Ned Batchelder nedbatchelder.com> writes:
I never said they were the whole community, of course. But they are not
outliers either. By your own statistics above, 23% of respondents think
Python 3 was a mistake. Armin and Kenneth are just two v
On 1/6/14 5:30 PM, Mark Lawrence wrote:
On 06/01/2014 22:22, Ned Batchelder wrote:
On 1/6/14 5:08 PM, Mark Lawrence wrote:
On 06/01/2014 21:42, Ned Batchelder wrote:
On 1/6/14 4:33 PM, Mark Lawrence wrote:
That strikes me as being as useful as "The PEP 393 FSR is completely
wrong but I&
On 1/6/14 11:01 PM, Steven D'Aprano wrote:
On Mon, 06 Jan 2014 16:32:01 -0500, Ned Batchelder wrote:
On 1/6/14 12:50 PM, Steven D'Aprano wrote:
Ned Batchelder wrote:
You are still talking about whether Armin is right, and whether he
writes well, about flaws in his statistics,
0.3803570633857589
timeit.timeit("len(unicodedata.normalize('NFKD', 'ǟ'))", "import unicodedata")
0.9359970320201683
pdf, typography, linguistic, scripts, ... in mind, in other word the real
*unicode* world.
jmf
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
When we
forget, there can be bugs. I'm sure that I'll get used to it eventually.
On Python-Dev, Dan Stromberg posted this link with the results:
http://stromberg.dnsalias.org/~strombrg/python-2.x-vs-3.x-survey/
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
?
The PYTHONPATH contains the directories that will be searched for
modules and packages. Your package is called foo, and is in
c:\workspace\PyFoo\src. That directory is not on the Python path, and
it isn't the current directory. Therefore, your package can't be found
and i
On 1/10/14 2:43 PM, John Ladasky wrote:
On Friday, January 10, 2014 9:48:43 AM UTC-8, Ned Batchelder wrote:
On Python-Dev, Dan Stromberg posted this link with the results:
http://stromberg.dnsalias.org/~strombrg/python-2.x-vs-3.x-survey/
That link gave me a 404. :^(
Sorry, it worked
onfusing. Here's an explanation of
the mechanics: http://nedbatchelder.com/text/names.html
HTH,
--Ned.
Thanks!
Regards,
Albert-Jan
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
unction is called. After the first import, the cost is about the
same as a dict lookup (very fast).
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
ke a point, you have to put some English around it. You
know what is in your head, but we do not.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
n this example, but if you have more than one value being
formatted, this (and the "{0.foo}" syntax) can make digging into nested
data more convenient.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
getting at, I suspect he was
talking at a more refined "principles of object design" level rather
than "dicts don't happen to work that way" level.
Also, I've never done it, but I understand that deriving from
collections.MutableMapping avoids this problem.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
s up a grapheme, and that
you'll need code to deal with the correspondence between them. But let's
not muddy these already confusing waters by referring to that mapping as
an encoding.
In Unicode terms, an encoding is a mapping between codepoints and bytes.
Python 3'
are. The value
assigned to p can be reclaimed if you reassign the name p, and nothing
else is referring to the value.
The rationale behind these question is to avoid object creation within
application() whose content is same and do not change between requests calling
application() function
dis module for disassembling it.
How to protect your code depends an awful lot on what kinds of secrets
are in the code, and how valuable those secrets are, and therefore how
hard someone will work to get at them.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailma
.
The standard library has the compileall module that can be used to
create .pyc files from .py files, but as we've been discussing in
another thread, you may not want .pyc files.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
ssing mess i ended up
using sqlite access to DB in exclusive transaction mode.
But this was not pythonic :-)
Asaf
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
made the design for whole code. Just stuck at this part
You should collect all your thoughts and write one message, not six in
30 minutes. That's just pestering.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
hing.
This is covered in more detail here:
http://nedbatchelder.com/text/names.html
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
l = [1, 2, 3, 4, 5, 6, 7, 8]
return l
def main():
for i in test():
print(i)
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
try to convince someone, convince me. Write to me
offline: n...@nedbatchelder.com
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
ocal variable 'GLOBAL' referenced before assignment
And I don't know why :(
Anyone ?
Thanks!!
Assignment statements in functions implicitly make local names. If you
want to assign a new value to a global name in a function, you have to
use a global statement:
def update()
antics of the word "constructor" any
more than we have to tied to its semantics of the word "variable" or "for".
Why can't we call __init__ the constructor and __new__ the allocator?
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
On 1/31/14 3:57 PM, Ethan Furman wrote:
On 01/31/2014 12:48 PM, MRAB wrote:
On 2014-01-31 19:52, Ned Batchelder wrote:
Why can't we call __init__ the constructor and __new__ the allocator?
The advantage of calling it the "initialiser" is that it explains why
it's cal
On 1/31/14 6:05 PM, Ben Finney wrote:
Ned Batchelder writes:
On 1/31/14 2:33 PM, Mark Lawrence wrote:
From http://docs.python.org/3/reference/datamodel.html#object.__init__
[…]
Should the wording of the above be changed to clearly reflect that
we have an initialiser here and that __new__
derstood) that most
user-defined classes define __init__, and that very very few define __new__.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
On 1/31/14 10:42 PM, Steven D'Aprano wrote:
On Fri, 31 Jan 2014 14:52:15 -0500, Ned Batchelder wrote:
Why can't we call __init__ the constructor and __new__ the allocator?
__new__ constructs the object, and __init__ initialises it. What's wrong
with calling them the
use this technique, it is not
particular to the Python docs.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
manuals, this
kind of response is completely unacceptable. Please don't do it again.
Please read this: http://www.python.org/psf/codeofconduct
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
than about my (jmf) software.
(*) Luckily, that's already the case for the users using
serious tools.
We've been over this too many times already, and we won't be discussing
it with you again.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
27;a EURO', 'aa EURO']*3])
261
sum([sys.getsizeof(c.encode('utf-32')) for c in ['aa EURO aa EURO']*3])
135
jmf
JMF, we've told you I-don't-know-how-many-times to stop this.
Seriously: think hard about what your purpose is in sending thes
utes
dictionary.
Why do you need to prevent attribute creation? If someone uses your
class and wants to use it in ways you didn't anticipate, why should you
try to stop them?
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
On 2/8/14 1:29 PM, Ned Batchelder wrote:
On 2/8/14 1:06 PM, Eric Jacoboni wrote:
Hi,
Say i want create a class with a __slots__ tuple in order to prevent
creation of new attributes from outside the class.
Say i want to serialize instances of this class... With pickle, all is
ok : i can dump
https://mail.python.org/mailman/listinfo/python-list
--
Best Regards,
David Hutto
/*CEO:*/ _http://www.hitwebdevelopment.com_
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
In my book this
classic trolling." I don't think he was, I think he was referring to JMF.
In any case, perhaps it would be best to just take a break?
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
ndexing
while saving space when a string doesn't need to use a full 32-bit
width.
-tkc
Please don't engage in this debate with JMF. His mind is made up, and
he will not be swayed, no matter how persuasive and reasonable your
arguments. Just ignore him.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
ut also, you might find it easier to use the "six" module from PyPI to
handle these sorts of differences. It's easier than doing it ad-hoc
with your own logic.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
need "foo().something" ? In
what cases does the word foo invoke the function, and when doesn't it?
It's not possible to make a programming language error-proof. There
will always be mistakes programmers can make.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
class)
map(myfunc, range(10))
x = property(x_get, x_set)
would still work?
I guess neither would:
except ValueError:
:(
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
On Tuesday, November 24, 2015 at 9:34:36 AM UTC-5, Antoon Pardon wrote:
> Op 20-11-15 om 13:12 schreef Ned Batchelder:
> > On Friday, November 20, 2015 at 6:59:54 AM UTC-5, BartC wrote:
> >> On 20/11/2015 01:05, Steven D'Aprano wrote:
> >>> On Fri
On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote:
> Op 24-11-15 om 15:18 schreef Ned Batchelder:
>
> > 2) In Python, "value" means, what object does a name refer to, or what
> > object did an evaluation produce.
>
> I don't think t
On Tuesday, November 24, 2015 at 9:29:30 AM UTC-5, Mark Lawrence wrote:
> On 24/11/2015 14:07, Denis McMahon wrote:
> > On Tue, 24 Nov 2015 02:04:56 -0800, Cai Gengyang wrote:
> >
> >> Here's a dictionary with 3 values :
> >>
> >> results = {
> >>"gengyang": 14,
> >>"ensheng": 13, "jordan":
On Tuesday, November 24, 2015 at 12:25:54 PM UTC-5, Oscar Benjamin wrote:
> On 24 November 2015 at 15:27, Ned Batchelder wrote:
> > On Tuesday, November 24, 2015 at 10:10:51 AM UTC-5, Antoon Pardon wrote:
> >> Op 24-11-15 om 15:18 schreef Ned Batchelder:
> >>
> &g
On Tuesday, November 24, 2015 at 1:45:34 PM UTC-5, Antoon Pardon wrote:
> Whether you want to call it literals or something else, the fact
> remains that (3, 5, 8) is treated like -42 by the CPython interpreter
> and [3, 5, 8] is not.
Maybe I've lost the original point in all this minutia about wh
On Wednesday, November 25, 2015 at 8:20:59 AM UTC-5, BartC wrote:
> Accept that some things /are/ a source of confusion. When, in writing
> documentation, I find something hard to explain something, then I try
> and make it simpler in the program. But not enough of that goes on: it
> seems to be
On Wednesday, November 25, 2015 at 8:23:36 PM UTC-5, BartC wrote:
> On 26/11/2015 00:31, Steven D'Aprano wrote:
> > On Thu, 26 Nov 2015 09:41 am, BartC wrote:
> >
> >> Maybe you're too familiar with it. But the idea of executing the
> >> function and other definitions in a file, instead of they jus
For testing coverage.py, I wrote a program to generate
randomly-structured Python functions. When compiling
the results, I got a message I'd never seen before:
SyntaxError: 'continue' not supported inside 'finally' clause
I guess this makes sense, when cleaning up from an
exception, continuing t
On Sunday, December 13, 2015 at 5:28:44 PM UTC-5, Ben Finney wrote:
> Ned Batchelder writes:
> > So why treat 'continue' specially?
>
> I am inclined to agree, but in the opposite direction: a case should be
> made for allowing *any* flow-control statement in an ex
On Friday, March 18, 2016 at 10:33:46 AM UTC-4, Sven R. Kunze wrote:
> On 18.03.2016 15:23, Ian Kelly wrote:
> > On Fri, Mar 18, 2016 at 7:47 AM, Ian Kelly wrote:
> >> Your patched version takes two extra arguments. Did you add the
> >> defaults for those to the function's __defaults__ attribute?
On Sunday, March 20, 2016 at 9:15:32 PM UTC-4, BartC wrote:
>
> A tokeniser along those lines in Python, with most of the bits filled
> in, is here:
>
> http://pastebin.com/dtM8WnFZ
>
Bart, we get it: you don't like the trade-offs that Python has made.
You want Python to be faster, but it can'
On Monday, March 21, 2016 at 8:44:01 AM UTC-4, BartC wrote:
> On 21/03/2016 12:08, Ned Batchelder wrote:
> > On Sunday, March 20, 2016 at 9:15:32 PM UTC-4, BartC wrote:
> >>
> >> A tokeniser along those lines in Python, with most of the bits filled
> >> in, is
On Monday, March 21, 2016 at 3:43:40 PM UTC-4, BartC wrote:
>
> This code was adapted from a program that used:
>
> readstrfile(filename)
>
> which either returned the contents of the file as a string, or 0.
>
> That's all. My Python version was thrown together as I don't know if
> there's
On Tuesday, March 22, 2016 at 7:05:20 AM UTC-4, BartC wrote:
> On 22/03/2016 01:01, Steven D'Aprano wrote:
> > Pythonic code probably uses a lot of iterables:
> >
> > for value in something:
> > ...
>
> > in preference to Pascal code written in Python:
> >
> > for index in range(len(something
On Tuesday, March 22, 2016 at 10:02:41 AM UTC-4, BartC wrote:
> On 22/03/2016 13:13, Chris Angelico wrote:
> > On Tue, Mar 22, 2016 at 11:59 PM, BartC wrote:
>
> > The first step in any program is to write it in the very simplest way
> > possible. That usually means ignoring all error handling. A
On Wednesday, March 23, 2016 at 6:35:12 AM UTC-4, BartC wrote:
> On 23/03/2016 06:09, Ben Finney wrote:
>
> > The problem is that Bart simultaneously is a beginner at Python, and
> > expresses astonishment that everyone shrugs when Bart's
> > dreadfully-written code performs so badly.
>
> My inte
On Thursday, March 24, 2016 at 9:51:11 AM UTC-4, Steven D'Aprano wrote:
> You know what is missing from this conversation?
>
> For one of Bart's critics to actually show faster code.
>
> There's plenty of people telling him off for writing unpythonic and slow
> code, but I haven't seen anyone act
On Thursday, March 24, 2016 at 12:12:55 PM UTC-4, BartC wrote:
> On 24/03/2016 15:30, Ned Batchelder wrote:
> > On Thursday, March 24, 2016 at 9:51:11 AM UTC-4, Steven D'Aprano wrote:
> >> You know what is missing from this conversation?
> >>
> >> For one
On Thursday, March 24, 2016 at 2:03:58 PM UTC-4, BartC wrote:
> On 24/03/2016 17:13, Ned Batchelder wrote:
> > On Thursday, March 24, 2016 at 12:12:55 PM UTC-4, BartC wrote:
> >> On 24/03/2016 15:30, Ned Batchelder wrote:
> >>> On Thursday, March 24, 2016 at 9:51:11 A
On Thursday, March 24, 2016 at 7:47:34 PM UTC-4, Mark Lawrence wrote:
> On 24/03/2016 23:33, Ian Kelly wrote:
> > On Thu, Mar 24, 2016 at 4:58 PM, Mark Lawrence
> > wrote:
> >> No. While this idiot, BartC, is let loose on this forum, I'll say what I
> >> like.
> >
> > Good to know. I've been on
On Friday, March 25, 2016 at 5:17:21 PM UTC-4, Thomas 'PointedEars' Lahn wrote:
> c...@isbd.net wrote:
>
> > Occasionally I have to make forays into Javascript, can anyone
> > recommend a place similar to this list where Javascript questions can
> > be asked? The trouble is that there are very ma
On Friday, March 25, 2016 at 11:37:34 PM UTC-4, Thomas 'PointedEars' Lahn wrote:
> Chris Angelico wrote:
>
> > On Sat, Mar 26, 2016 at 12:36 PM, Thomas 'PointedEars' Lahn
> > wrote:
> >>> Thomas is not typical of the Python community. We are mostly nice
> >>> people.
> >>> :)
> >>
> >> You do not
On Saturday, March 26, 2016 at 5:59:30 AM UTC-4, Juan Dent wrote:
> I am trying to run 'python cppdep.py' but get the following:
>
>
> analyzing dependencies among all components ...
> Traceback (most recent call last
On Sunday, March 27, 2016 at 9:55:16 AM UTC-4, g vim wrote:
> Given that Python, like Ruby, is an object-oriented language
It turns out that "object-oriented" means very little, and lots
of languages that are object-oriented will behave differently
from each other, even where object behavior is c
On Sunday, March 27, 2016 at 10:43:49 AM UTC-4, BartC wrote:
> On 27/03/2016 14:47, Dennis Lee Bieber wrote:
> > On Sun, 27 Mar 2016 12:31:26 +0100, BartC declaimed the
> > following:
> >
> >> On 27/03/2016 07:34, Paul Rubin wrote:
> >>> BartC writes:
> But my suggestion was to have requi
On Sunday, March 27, 2016 at 12:58:23 PM UTC-4, BartC wrote:
> On 27/03/2016 16:48, Ned Batchelder wrote:
> > On Sunday, March 27, 2016 at 10:43:49 AM UTC-4, BartC wrote:
> >> On 27/03/2016 14:47, Dennis Lee Bieber wrote:
>
> >> Well, that could be done in Pytho
On Sunday, March 27, 2016 at 4:19:12 PM UTC-4, BartC wrote:
> On 27/03/2016 18:19, Ned Batchelder wrote:
> > On Sunday, March 27, 2016 at 12:58:23 PM UTC-4, BartC wrote:
>
> >> There would be a list of expression terms that can also form independent
> >> statements
On 10/22/14 12:28 PM, Steven D'Aprano wrote:
Ned Batchelder wrote:
On 10/22/14 5:05 AM, busca...@gmail.com wrote:
without not:
j = [j+1, 3][j>=10]
with not:
j = [3, j+1][not (j>=10)]
Why on earth would you recommend this outdated hack, when there's a true
conditional op
and False == 0.
You mention "standard Python idioms." I think this style of
conditional-via-indexing is becoming quite uncommon, and is no longer
one of the standard Python idioms. This is now in the category of
"outdated hack."
Yes, its meaning is well-defined by the
et from it.
Benefit in this case would have to include a guess as to how often real
programs would hit the optimization case.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
the first place:
a = {}
a[s] = 1
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
pends entirely on context. You'll need to find a *small* example of
what you are asking about so we can help.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
g an MD5 hash, you use the md5.hexdigest()
method, not hex(md5).
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
#x27;d be surprised the kinds of clues that lurk there.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
on the "def" token, not the "def" in
"get_default". .rindex isn't what you want in any case. Use .index in
both cases.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
d this stuff out for yourself. Ben Finney
even gave you a pointer to a helpful site for experimenting with
regexes: http://pythex.org/
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
. You are misbehaving on this list.
Everyone else: I recommend that people stop responding. Satish seems
unlikely to improve.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
ould accomplish two goals: explicitly stating what I expect of
my data, and doing so concisely and cleanly.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
or ** magic
"magic"? They're features of the language! Meanwhile, it doesn't mind
if you write multiply-inherited metaclasses
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
On 11/16/14 8:21 PM, Ben Finney wrote:
Ned Batchelder writes:
Pylint isn't useful until you've tailored the messages.
Definitely agreed.
The pylint message that always irked me was:
W0142: Used * or ** magic
"magic"? They're features of the language!
It
messages, with less bombast. I
don't know if you are aiming for humor with your messages, but to my
ears, you are verging on self-parody. I'm surprised that people are
taking you seriously.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
On 11/21/14 9:55 AM, Steven D'Aprano wrote:
- Use your OS facilities to run that process in a chroot jail.
If you are interested, this is the facility that edX uses to run
untrusted Python code on the servers: https://github.com/edx/codejail
--
Ned Batchelder, http://nedbatchelde
t). Once you make an object from it, you will have what
you want:
class RPS(object):
def __init__(self):
self.throw = random.randrange(3)
a = RPS()
b = RPS()
print a.throw
print b.throw
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.
, so where is the dangling reference?
Thanks!
This sounds tricky, and possible very difficult to do properly. Do you
mind if I ask what the larger problem is? Python might not be very good
at having modules come and go as you want.
--
Ned Batchelder, http://nedbatchelder.com
--
https
iate the
class to create objects, then even when you reload updated code, the old
objects will still refer to the old classes. This is one of the things
that makes reloading modules in Python so difficult.
On Nov 23, 2014, at 5:56 PM, Ned Batchelder mailto:n...@nedbatchelder.com>>
and “done”. This is not
being run from the interactive interpreter by via a .py file.
Let's look at this another way: Why do you need the module to be
unloaded? Isn't it enough to have the new code loaded?
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
On 11/24/14 11:51 AM, Rick Johnson wrote:
... lots of off-topic ranting ...
Everyone: as tempting as it is to respond, the best course of action
will be to completely ignore Rick's rants.
Thanks,
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/lis
to open a new issue on our issue tracker.
I found a problem with the new spell feature, but the issue tracker
(http://www.bytebucket.org/logilab/pylint/issues) seems broken:
everything I tried ended at a 403 CSRF validation failure page.
Is there another way to report problems?
--
Ned Bat
eresting_lines a pure filter, and doesn't care what sort
of sequence of strings it's operating on. This makes it easier to test,
and more flexible. The caller's code is also clearer in my opinion.
BTW: this example is taken verbatim from my PyCon presentation on
iteration, it you a
uldn't pre-fetch a URL is to
make it a POST request.
--
Ned Batchelder, http://nedbatchelder.com
--
https://mail.python.org/mailman/listinfo/python-list
ut that sort of defeats the purpose.
I would use thread locals for this:
https://docs.python.org/2/library/threading.html#threading.local
They act like global variables, in that they are available implicitly
without being passed around, but like locals in that two separate
threads will have di
401 - 500 of 852 matches
Mail list logo