iving of malformed input and edge
cases.
I use html5lib - it's fast enough for what I do, and the most likely to
return results matching what the author saw when they maybe tried it in a
single web browser.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
e the string being repeated.
>
10 digits is only 9. That's not a very big number. Forget
nanoseconds since the epoch, that won't currently give you seconds since
the epoch - let alone combining with any other identifier.
$ date '+%s'
1575942612
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
r: __class__ assignment only supported for heap types or ModuleType
subclasses
In some implementations it is possible to subvert the Python typing system
by stepping out of Python code and into (for example) a C extension, but
that does not make Python *the language* weakly typed.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 29 January 2018 at 11:27, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Mon, 29 Jan 2018 08:55:54 +1100, Tim Delaney wrote:
>
> > I got back a Word document containing about 10 screenshots where they'd
> > apparently taken a screenshot,
otherwise, this type of thing
keeps happening.
BTW: I have nothing to do with the final persistence format of the data,
but in practice I've had to learn the DB schema and stored procedures for
everything I support. Strangely the DB team don't have to learn my parts ...
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
stralians would say that writing "an
herb" is a mistake since we pronounce the "h", but millions of people
elsewhere would disagree with us.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
e test of the way both functions would
normally be used would be to iterate over the results instead of eagerly
building a list. In this test you would also expect scandir() to use less
memory for a large directory.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
ith del)
and avoids having to think up another name for a very temporary structure
(names are hard). And I would include a comment explaining the reuse of the
name.
The alternative would be something like (replace first line by something
complex ...):
near_limit_list = [1]
near_limit = len(near
le was to pick a book
off a library shelf).
But unless otherwise qualified, a claim of being able to compress random
data is taken to mean any and all sets of random data.
Anyway, that's going to be my only contribution to this thread.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 18 April 2016 at 09:30, Chris Angelico wrote:
> On Mon, Apr 18, 2016 at 8:02 AM, Tim Delaney
> wrote:
> > I also wouldn't describe Java as a
> > "perfectly good language" - it is at best a compromise language that just
> > happened to be heavily
ed language) but worse in others (esp. that
they're implemented by erasure). I also wouldn't describe Java as a
"perfectly good language" - it is at best a compromise language that just
happened to be heavily promoted and accepted at the right time.
Python is *much* closer
me hijinks in the settings
> to expand it.
>
Personally, I've given up on 80 characters (or even 120 in rare cases) for
Java code (esp method declarations), where just specifying the generics can
often take almost that much.
But for Python code it's generally fairly easy to break a line in a natural
place.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
probably going to be most efficient whilst leaving the
file position just after the delimiter.
If reading from a stream, I think Chris' read a chunk and maintain an
internal buffer, and don't give access to the underlying stream.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 1 June 2015 at 10:30, Mark Lawrence wrote:
> On 01/06/2015 00:23, Tim Delaney wrote:
>
>> The for statement must have a colon at the end of line e.g. a complete
>> for statement and block is:
>>
>> for br in b:
>> print br
>>
>> This will o
print br
This will output the characters one per line (on Python 3.x), since that is
what the reversed() iterator will return. You will need to do something
else to get it back to a single string.
Have you read through the python tutorials?
https://docs.python.org/3/tutorial/
or for Python 2
@ in the future, but please do not CC the list.
My spam filters have learned to filter out most job spam automatically by
now, but it doesn't filter out your reply.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 5 March 2015 at 09:39, Emile van Sebille wrote:
> On 3/4/2015 12:40 PM, Tim Delaney wrote:
>
>> A related thing is when you have multiple multi-lingual people talking
>> together where at least two of their languages match (or are close
>> enough for most uses e.g
they're trying to
say, and no one will involved realise.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
e disadvantage of the former is that if you
*don't* want to rename, it violates DRY (don't repeat yourself).
The difference is so marginal that I'd leave it to personal preference, and
wouldn't pull someone up for either in a code review.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
ultitude of uses for
user interfaces, whilst other quadrilaterals are somewhat less useful.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
massively inefficient.
>
Why not put proxy objects into the list/dict? Have a look at the weakref
module for an API that may be suitable for such proxy objects (if you used
the same API, that would also allow you to transparently use weakrefs in
your lists/dicts).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
o have some methods use "z" and others
"s" in the same package. So since I'm currently working for a US company I
have to consciously remind myself to use their abominations ;)
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
ranch repo:
[feature_branch_repo:65179] [feature_branch]> hg relink default
relinking d:\home\repos\feature_branch_repo\.hg/store to
d:\home\repos\default_repo\.hg/store
tip has 22680 files, estimated total number of files: 34020
collected 229184 candidate storage files
pruned down to 49838 probabl
sy to switch between tasks - I just update to a different
changeset (normally the tip of a named branch) and force a refresh in my
IDE. When I'm happy, I merge into the feature branch, then pull the
necessary changesets into other feature branch repos to merge/graft as
appropriate.
Branches and clones are two different ways of organising, and I find that
things work best for me when I use both.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
the changeset if you don't want the graft
as-is. It's a bit messy, and could cause problems if you later do a merge
that includes the originally-grafted changeset on top of the amended
changeset (since the changes committed to the amended changeset will be
considered during the merge).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
t for major.minor.1.
What is more important is that minor and patch version increases should
avoid introducing breakage and incompatibilities wherever possible
(security fixes are one reason to allow incompatibility in a minor release).
BTW I agree with the idea that 4.0 would be an appropriate
ok shuts down after 15 minutes. I'm surprised at how well I
> was able to set up a equivalent programming environment on Windows.
I advise anyone who works cross-platform to install MSYS on their Windows
boxes (for the simplest, most consistent behaviour ignore rxvt and just
launch bash -l - i directly). Or use cygwin if you prefer.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 20 July 2014 09:19, Chris Angelico wrote:
> On Sun, Jul 20, 2014 at 7:50 AM, Tim Delaney
> wrote:
> > IMO there is no project so modest that it doesn't require version
> control.
> > Especially since version control is as simple as:
> >
> > cd projec
ect
hg init
hg add
hg commit
FWIW I also don't find a need for an IDE for Python - I'm quite happy using
EditPlus (which I preferred enough to other alternatives on Windows to pay
for many years ago).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
Congratulations.
I can't find the details of PyPy3's unicode implementation documented
anywhere. Is it equivalent to:
- a Python 3.2 narrow build
- a Python 3.2 wide build
- PEP 393
- something else?
Cheers,
Tim Delaney
On 21 June 2014 06:32, Philip Jen
on how easily their fur
gets up your nose).
Now, a cat *standing* on the keyboard, between you and the monitor, and
rubbing his head against your hands, is a whole other matter.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
oll about the FSR. Please don't
reply to him (and preferably add him to your killfile).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 2 June 2014 17:45, Wolfgang Maier <
wolfgang.ma...@biologie.uni-freiburg.de> wrote:
> Tim Delaney gmail.com> writes:
>
> > For some purposes, there needs to be a way to treat an arbitrary stream
> of
> bytes as an arbitrary stream of 8-bit characters. iso-latin-1
On 2 June 2014 11:14, Steven D'Aprano
wrote:
> On Mon, 02 Jun 2014 08:54:33 +1000, Tim Delaney wrote:
> > I'm currently working on a product that interacts with lots of other
> > products. These other products can be using any encoding - but most of
> > the f
efault would be the most sensible
option (effectively treating everything as bytes), with the option for
another encoding if/when more information is known (e.g. there's often a
call to return the encoding, and the output of that call is guaranteed to
be ASCII).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
machinery - no need
to reinvent the wheel.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
hon, because
Python either already has various patterns implemented, or obviates the
need for them. For example, if you really need a singleton (answer - you
don't) just use a module attribute. Functions as objects and iterators
being so pervasive means that visitor and related patterns are just a
normal style of programming, instead of having to be explicit.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 13 February 2014 08:02, Tim Delaney wrote:
> I received a copy of "The Beginners Computer Handbook: Understanding &
> programming the micro" (Judy Tatchell and Bill Bennet, edited by Lisa Watts
> - ISBN 0860206947)
>
I should have noted that the examples were all B
;s worth the effort, but it can be really hard when you've got an
already existing top-posted email thread with people using bizarre fonts
and colours throughout.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
w to be more than just a
programmer; came out the other end a senior developer/technical lead and
effective communicator.
And that's how I learned to program.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
e it will call the subclass method before the subclass constructor is
actually run, meaning that instance variables will have their default
values (null for objects). When the base class constructor is eventually
run the instance variables will be assigned the values in the class
definition (replacing a
mentation is a bug in
either the documentation or the implementation.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
d obtain
the data in an unambiguous manner to verify against my parser.
The only way to truly protect code is to not ship any version of it
(compiled or otherwise), but have the important parts hosted remotely under
your control (and do your best to ensure it doesn't become compromised).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
orities for Unicode handling in Python were:
1. Correctness
a. all code points must be handled correctly;
b. it must not be possible to obtain part of a code point (e.g. the
first byte only of a multi-byte code point);
2. No change in the Big O characteristics of string operations e.g.
indexing must remain O(1);
3. Reduced memory use in most cases.
It is impossible for UTF-8 to meet both criteria 1b and 2 without
additional auxiliary data (which uses more memory and increases complexity
of the implementation). The FSR meets all 3 criteria.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
t the rhetoric and
> laws coming out of the Kremlin are just like that coming out of the
> Reichstag in the thirties.
You are of course correct - I was still groggy from waking up when I
replied, and focused on the element that I had been most exposed to.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
mir Putin into a
homosexual icon (search "last leg sochi" without the quotes).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 12 December 2013 03:25, Chris Angelico wrote:
> On Thu, Dec 12, 2013 at 3:18 AM, Mark Lawrence
> wrote:
> > On 11/12/2013 16:04, Chris Angelico wrote:
> >>
> >> I strongly believe that a career
> >> programmer should learn as many languages and styles as possible, but
> >> most of them can wa
His initial postings did lead to a regression being found.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
a troll? Probably because out of all his baseless
complaints about the FSR, he *did* have one valid point about performance
that has now been fixed.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 30 November 2013 03:15, Eamonn Rea wrote:
> Ok, here's the code:
> [elided]
>
As I said, please also show the *exact* error - copy and paste the stack
trace.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
either with LibGDX or (more likely) way you are
using it. Please post a minimal example that demonstrates the problem plus
the exact error message you get (I don't know LibGLX at all, but someone
else might, plus trimming it down to a minimal example may reveal the
problem to you).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
ot;stumped" is
actually coming from the problem of a plough getting stuck on a stump (i.e.
can't progress any further). Not much of an issue anymore since the
invention of the stump-jump plough:
https://en.wikipedia.org/wiki/Stump-jump_plough
(Looked it up, my guess is considered the most likely origin of the term).
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
aying something like "I think I can help
here, but I'm confused about - could you or someone
else clarify please?"
And if an unfamiliar dialect annoys you, killfile the person. No skin off
my nose.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
riginal_origin
Just noticed that my town was missing - added it:
https://en.wikipedia.org/wiki/Mittagong,_New_South_Wales
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
e stranger to be "exposing" that data?
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 8 November 2013 09:45, Tim Delaney wrote:
> On 8 November 2013 09:18, Νίκος Αλεξόπουλος wrote:
>
>> I feel a bit proud because as it seems i have manages to secure it more
>> tight. All i need to do was to validate user input data, so the hacker
>> won't be able
g is opening your customers
up to potentially disastrous situations and yourself to lawsuits. It's not
a question of *if*, but *when* one of your customers is compromised to the
extent that they decide to take it out of you.
Also, you're an embarrassment to our profession.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
On 31 October 2013 08:43, Tim Delaney wrote:
> On 31 October 2013 08:31, Chris Angelico wrote:
>
>> On Thu, Oct 31, 2013 at 7:19 AM, Tim Delaney
>> wrote:
>> > What it comes down to for me is that Mercurial usage fits in my head
>> and I
>> > rarely
On 31 October 2013 08:31, Chris Angelico wrote:
> On Thu, Oct 31, 2013 at 7:19 AM, Tim Delaney
> wrote:
> > What it comes down to for me is that Mercurial usage fits in my head and
> I
> > rarely have to go to the docs, whereas with Git I have to constantly go
> to
>
extensively
used the top two contenders (Git and Mercurial) I would strongly advise you
to use Mercurial.
What it comes down to for me is that Mercurial usage fits in my head and I
rarely have to go to the docs, whereas with Git I have to constantly go to
the docs for anything but the most tri
o this on truly random data,
you're probably wrong - either your data is has patterns the algorithm can
exploit, or you've simply been lucky with the randomness of your data so
far.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
en 0-201" (inclusive)
then whoever fixes it might naively just add one to the existing code,
giving an incorrect result.
Obviously I'm ignoring the possibility of appropriate unit tests to prevent
this - just looking at the code itself.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
after 4 hours sleep - my
apologies to the list).
Anyway, not going to get sucked into this bottomless hole.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
as I'm now starting to suspect, possibly a bot, but I'll give
him (it?) this one chance to show the capability to read and learn.
http://en.wikipedia.org/wiki/Hexspeak
Search for 0xBAADF00D; 0xBADDCAFE; and (in particular) OxDEADBEEF. These
are historical examples of this techniqu
laims to prefer an language named after a fish :-)
>
That would be https://en.wikipedia.org/wiki/Monty_Python not
https://en.wikipedia.org/wiki/Pythonidae.
The snake has been adopted as a mascot (see the Python icon) but is not the
inspiration.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
abase.
And of course your database is so well locked down that no attacker with a
login to it could then execute arbitrary code on your system.
And there's also zero chance that your personal account login details are
also available in plaintext somewhere that you're unaware of.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
I'm not going to risk it by going there to check myself ...
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
ct?
>
> What do you suggest, keeping in mind that I am a newbie and that my
> website project would be very simple and very small?
>
There is no *need* to use a web framework. But a web framework can make
things a lot easier for you.
Have a look at webapp2: http://webapp-impro
red is %s" % (total,))
which will produce the same output on both Python 2 and Python 3. Note the
double space before %s - that matches your print statement (there would be
soft-space inserted in your print statement, which is another reason not to
rely on print for anything other th
> I'm just glad it's no longer 40-chars-per-column and purely
> upper-case like the Apple ][+ on which I cut my programming teeth.
>
Couldn't you switch the ][+ into high-res mode? You could with the IIe.
Made programming in DOS 3.3 BASIC so much nicer.
Tim Delaney
--
https://mail.python.org/mailman/listinfo/python-list
nk Roy is referring to the fact that attribute access is implemented
via __getattr__ / __getattribute__ / __setattr__ / __delattr__. From one
point of view, he's absolutely correct - nearly all attributes are accessed
via getters/setters in Python.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
ast the Object
reference 'a' or use reflection to call methods on it or access it's
members (think of it as Python does reflection automatically for you).
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
; not None else '') instead. Not a major inconvenience, but enough to
> make me wonder if there could be a better way.
>
There is.
def format(value):
if value is None:
return ''
return str(value)
print(format(value))
This also allows you to format other types differently e.g. only output 2
decimal places for non-integer numeric types.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
PS provider's end.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
On 25 August 2013 07:59, Tim Delaney wrote:
> Breakdown of the above (for 19 digits):
>
> d.as_tuple() takes about 35% of the time.
>
> The multiply and add takes about 55% of the time.
>
> The exponentiation takes about 10% of the time.
>
Bah - sent before complete.
Si
he multiply and add takes about 55% of the time.
The exponentiation takes about 10% of the time.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
ng that doing the above in any
language which has immutable strings is completely insane you will have
no credibility and the only interest anyone will pay to your posts is
refuting your FUD so that people new to the language are not driven off
by you.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
passes the Turing test?
>
> Yes, absolutely. The original Turing test was defined in terms of five
> minutes of analysis, and Dihedral and jmf have clearly been
> indistinguishably human across that approximate period.
>
The big difference between them is that the jmfbot does not appear to
evolve its routines in response to external sources - it seems to be stuck
in a closed feedback loop.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
On 13 July 2013 09:16, MRAB wrote:
> On 12/07/2013 23:16, Tim Delaney wrote:
>
>> On 13 July 2013 03:58, Devyn Collier Johnson > <mailto:devyncjohnson@gmail.**com >> wrote:
>>
>>
>> Thanks for the thorough response. I learned a lot. You should writ
e.
If you are finding that regular expressions are taking too much time, have
a look at the https://pypi.python.org/pypi/re2/ and
https://pypi.python.org/pypi/regex/2013-06-26 modules to see if they
already give you enough of a speedup.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
long as at some point I can sync the repositories, I can work away
(on things that are not dependent on something new from upstream).
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
ing the
Mercurial and CC clients in sync. Turns out that CCRC was the best option,
as I was able to parse its local state files and work out what timestamp
ClearCase thought its files should be, set it appropriately from a
Mercurial extension and convince CCRC that really, only these files have
change
tunately, by reducing to a single
thread + single semaphore slot I was able to turn it from a Heisenbug to a
100% replicable bug.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
On 3 June 2013 09:10, Tim Delaney wrote:
> A programmer chooses his own clients, and you are the Atherton Wing to
>> my Inara Serra.
>>
>
> I've just been watching this train wreck (so glad I didn't get involved at
> the start) but I have to say - that's br
>
> A programmer chooses his own clients, and you are the Atherton Wing to
> my Inara Serra.
>
I've just been watching this train wreck (so glad I didn't get involved at
the start) but I have to say - that's brilliant Chris. Thank you for
starting my week off so
b90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class A(object):
... def f(self):
... print("A")
...
>>> a=A()
>>> print(id(a.f) == id(a.f), a.f is a.f)
True False
>>>
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
He has shown no
inclination to attempt to *fix* the regression and is rapidly coming to be
regarded as a troll by most participants in this list.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
st way is probably to have a
_equal_fields() method that subclasses override, returning a tuple of the
attributes that should be hashed. Then in __hash__() and __eq__ you iterate
over the returned tuple, get the value for each attribute and either hash
or compare.
Of course, you have to take into account in __eq__ that the other instance
may not have the same attributes (e.g. self is a subclass that uses extra
attributes in its __hash__ and __eq__).
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
On 15 January 2013 07:57, Chris Angelico wrote:
>
> Oh, and Dennis? Mal. Bad. From the Latin. :)
>
I was about to point out the same thing, using the same quote ;)
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
the anti-pattern of string concatenation, not to encourage
people to use it.
As a real-world case, a bug was recently found in Mercurial where an
operation on Windows was taking orders of magnitudes longer than on
Linux due to use of string concatenation rather than the join idiom (from
~12 seconds spent on string concatenation to effectively zero).
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
ntioned. One I
haven't seen here yet (I may have missed it) is dumping the data into a
database of some form and using it's capabilities.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
there is no reference to the troll/bot or any text
from the troll/bot - fine. But any reference to the original will make it
harder for those of us who use bayesian-based spam filtering.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
That's what they want -
it gives them an audience. No matter how much you want to *just this once*
respond to one, resist the urge. And if you can't prevent yourself from
replying to someone who has quoted one in order to tell them that the
person is a known troll/bot, tell them privately, not on the list.
Cheers,
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
On 30 September 2012 09:26, Chris Angelico wrote:
> On Sun, Sep 30, 2012 at 6:51 AM, Tim Delaney
> wrote:
> > Personally I voted for the Fierce Snake[1][2] as the delimiter, but it
> was
> > voted down as "not Pythonic" enough.
> > I'm sure they were
miter, but it was
voted down as "not Pythonic" enough.
I'm sure they were using that as a euphamism for "Python*ish*" though.
[1] https://en.wikipedia.org/wiki/Inland_Taipan
[2] It's is so pretty:
https://upload.wikimedia.org/wikipedia/commons/f/fe/Fierce_Snake-Oxyuranus_microlepidotus.jpg
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
gt; that there is more risk of breakage just because one function is called
> from a thread.
>
> Obviously monkey-patching the builtin module itself is much riskier,
> because it doesn't just effect code in my module, it affects *everything*.
It's not as though the op
27; -e '/^[^+-]/d' -e 's/+-/*/'`"
echo "[${tracking}${uptodate}${branch}:${head}] "
return 0
fi
return 1
}
function git_hg_ps1() {
git_ps1
if [ $? -eq 0 ] ; then
return 0
fi
hg_ps1
return $?
}
export
PS1='$(g
if self.refs == 0:
self.write_record()
rec = record_weakrefs.get('record_name')
if rec is None:
rec = load_record()
record_weakrefs.put('record_name', rec)
with rec:
do_stuff
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
ve" record? What is the
problem if you get back a reference to an inactive record? And if there is
indeed a problem, don't you already have a race condition on CPython?
1. Record is active;
2. Get reference to record through weak ref;
3. Record becomes inactive;
4. Start trying to
hednan
>except TypeError:
>pass
>return cache.setdefault(x, x)
>
> I hope, again, that I've demonstrated that we don't need to
> canonicalize everything just to implement interning.
Except that the above is a canonicalisation function.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 382 matches
Mail list logo