Thank you, Larry!
Cheers,
Nick.
--
https://mail.python.org/mailman/listinfo/python-list
On 13 Dec 2014 05:19, "Petr Viktorin" wrote:
>
> Also keep in mind that not all Python libraries are on PyPI.
> For non-Python projects with Python bindings (think video players,
> OpenCV, systemd, Samba), distribution via PyPI doesn't make much
> sense. And since the Python bindings are usually s
On 18 Nov 2013 22:36, "Robin Becker" wrote:
>
> On 18/11/2013 11:47, Robin Becker wrote:
> ...
>>
>> #c:\python33\lib\site-packages\sitecustomize.py
>> import sys, codecs
>> sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
>> sys.stderr = codecs.getwriter("utf-8")(sys.stderr.det
to improve Sequence ABC conformance and to make
range objects more list-like)
Cheers,
Nick.
--
Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia
--
http://mail.python.org/mailman/listinfo/python-list
Benjamin Peterson wrote:
> On behalf of the Python development team, I'm thrilled to announce the first
> production release of Python 3.1.
Excellent news!
Cheers,
Nick.
--
Nick Coghlan | ncogh...@gmail.com | Brisbane
ecoding and environment variable encoding/decoding? (the
PEP currently only states that the encoding switch will be done for the
file system encoding - it is silent regarding the other two system
interfaces).
Cheers,
Nick.
--
Nick Coghlan | ncogh...@gmail.com | Brisbane
oat_class)
You could make a PEP if you really wanted to, but it's going to be rejected.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
--
http://mail.python.org/mailman/listinfo/python-list
Tres Seaver wrote:
> Nick Coghlan wrote:
>> Antoine Pitrou wrote:
>>> Brett Cannon python.org> writes:
>>>> It is specifically there to be overridden (and as an aside, it was a
>>>> pain to support in the C port of warnings), so it really isn't
ogrammer wants
Also:
from threading or dummy_threading import Thread
# No 'as' clause needed since the module name isn't bound
Insomnia-induced-random-ideas-are-fun-'ly yours,
Nick.
--
Nick Coghlan
t(x))"
1000 loops, best of 3: 992 usec per loop
For builtin functions, map is usually the fastest option (and, IMO, the most
readable). List comprehensions should be preferred to map + lambda, though.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisba
;Hi there!"
...
Py> var = "test"
Py> locals()[var]()
Hi there!
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Cheers,
Nick.
P.S. Which looks more like executable pseudocode?
def traverse(node):
yield *node.left
yield node .value
yield *node.right
def traverse(node):
yield x for x in node.left
yield node .value
yield x for x in node.rig
s clear as adding an asterisk
to the front :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
eyword gains a native genexp syntax).
If anyone thinks that this would result in a couple of parentheses making too
much difference, consider this:
Py> [x for x in []]
[]
Py> [(x for x in [])]
[]
Cheers,
Nick.
--
Nick Coghlan
Blake T. Garretson wrote:
Thanks for the suggestions and modified module. I will probably just
use this "fixed" module to solve my immediate problem.
Expect its performance to be worse than the standard version - it does the right
thing, but it sure ain't pretty. . .
Cheers
dle this, but I can't".
Maybe "__op__ = NotImplemented" should clear the associated slot. It would also
make it easier to inherit from list and handle slices in __getitem__ by writing
"__getslice__ = NotImplemented" instead of overriding __getslice__ to delegate
t
they already are (as Duncan pointed out).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
, please consider posting them on SF :)
It's currently conspicuous by its absence:
http://www.python.org/dev/doc/devel/ref/customization.html
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
nload/Descriptor.htm about 4 times
along with your help to get this straight.
If it only takes 2 or 3 re-reads to get descriptors, does that mean Python's
black magic is really only a kind of off-white colour?
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
nificantly.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Batista, Facundo wrote:
[Nick Coghlan]
#- >> a) Checking that replacing the relevant "raise TypeError"
#- calls in
#- >> Lib/Decimal.py with "return NotImplemented" gives you friendlier
#- >> behaviour.
#- >
#- >
#- > It turns out this isn'
Nick Coghlan wrote:
Nick Coghlan wrote:
a) Checking that replacing the relevant "raise TypeError" calls in
Lib/Decimal.py with "return NotImplemented" gives you friendlier
behaviour.
It turns out this isn't really practical - there's too much code in the
modu
Nick Coghlan wrote:
a) Checking that replacing the relevant "raise TypeError" calls in
Lib/Decimal.py with "return NotImplemented" gives you friendlier behaviour.
It turns out this isn't really practical - there's too much code in the module
relying on those TypeErr
g the question up on py-dev as well.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
pping.html
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
item__ and keys()
With an appropriate ListMixin, providing the first three methods would suffice
to support the full list API.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
ension:
Py> "".join([c for c in 'The Beatles - help - 03 - Ticket to ride' if c.isalpha(
)])
'TheBeatleshelpTickettoride'
Py>
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
people to
start out by at least skimming the freaking tutorial. . .
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listi
?
Actually, I was curious whether the 'zeros' method in [2] did the right
thing.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
on.net/~hinsen/ScientificPython/ScientificPythonManual/Scientific_13.html
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ly lost. Actually making it happen needs someone to step up and
offer a patch to the relevant C code and documentation, though.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Dan Bishop wrote:
Your statement is misleading, because it suggests that your processor
stores digits. It doesn't; it stores *bits*.
And where does the word 'bit' come from, hmm? It couldn't possibly be an
abbreviation of Binary digIT, could it?
Cheers,
Nick.
--
Nick
instead of the bytecode. If that happens, they
might become less hackish.
So I guess I should wait and see what the next few months holds in terms of
AST-hacks :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
structures.
All it would take to make it happen is a PEP, an implementation and a champion
with some persuasive ability :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http
Nick Coghlan wrote:
Basically, yeah. Although I later realised I got the name of the feature
I want wrong - default arguments are evaluated when the def statement is
executed, not when the code is compiled. So it's a matter of being able
to execute some code in the functions local namespa
orth having, finding a decent syntax is the next trick :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
code
which doesn't depend on the functions arguments inside a 'use' block. For
modules, data structures initialised inside a using block could simply be
unmarshalled rather than built anew.
Cheers,
Nick.
P.S. I didn't search the archive, because I couldn
27; are the names of the * and ** arguments or None.
'defaults' is an n-tuple of the default values of the last n arguments.
Don't-forget-the-std-lib'ly,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
diter(range(11)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Those benchmarks I mentioned earlier will let you know which approach is best.
No-optimisations-without-measurements-'ly,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
[EMAIL PROTECTED] wrote:
p.s. the reason I'm not sticking to reversed or even reverse : suppose
the size of the list is huge.
Reversed is an iterator - it does NOT copy the list. In other words, reversed
already does pretty much what you want.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROT
if key is not None:
seq = [elem for (key, i, elem) in seq]
if reverse:
seq.reverse()
return seq
list = mysort([[3,'fork',0.3,1],[2,'fork',0.1,2],[3,'exec',0.2,2]],
key=lambda x: x[0])
(Taken from Raymond's code in:
http://mail
[EMAIL PROTECTED] wrote:
yea-though-I-walk-thru-the-valley-of-__new__-I-will-fear-no-super-ly
That's beautiful }:>
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
needs to discuss: What happens to __str__ and
__unicode__? Is there a new __bytes__ slot?
I wonder if Skip is still up for championing this one. . .
Cheers,
Nick.
One PEP's enough for me (even though 338 doesn't seem to generate much interest)
--
Nick Coghlan | [EM
the BDFL gave for preferring 'open' - it may be extended to
opening other types of objects than files.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skyst
er than providing diff's and submitting appropriate patches to improve MinGW
support in the main Python CVS. *shrug* Their call.
Cheers,
Nick.
P.S. if Ilias volunteers, or offers to pay someone to do this, instead of just
complaining, will hell freez
e a bytes builtin which is a mutable byte sequence
Alternately, add array.bytes as a subclass of array.array, that provides a nicer
API for dealing specifically with byte strings.
The main point being, the replacement for 'str' needs to be immutable or the
upgrade
Paul Rubin wrote:
Nick Coghlan <[EMAIL PROTECTED]> writes:
Compare out-of-the-box Python:
a = 1 + 2 + 3 + 4
And out-of-the-box Lisp:
(setq a (+ 1 2 3 4))
Which language has the lower barrier for entry? That should be a
fairly important consideration for a language that is going to sit
a (+ 1 2 3 4))
Which language has the lower barrier for entry? That should be a fairly
important consideration for a language that is going to sit at the heart of an OS.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
-
b"" to get
a byte string instead of a character string.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
cation global it's wrong. Given the nature of
the question, I suspect the latter.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
/__init__.html
I'm compelled to point out that PEAK should still be considered a 'work in
progress', but PJE's ideas should help you out :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
at's a long way away, though.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ind the scenes has the potential to make the method behave
*very* suprisingly depending on the objects involved.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
f the available
options.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ing the archives on python.org really easy. Of course, knowing what
you're looking for because you were a participant in the discussion helps, too ;)
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
h
Stefan Behnel wrote:
Nick Coghlan wrote
a) Patches are more likely to be looked at if placed on the SF patch
tracker.
see your own b), I wanted to discuss them first.
Fair enough.
Still, when I first tried out the Template class, I immediately stumbled
over the fact that the substitute methods
a) Patches are more likely to be looked at if placed on the SF patch
tracker.
b) I don't quite see the point, given how easy these are to spell using the
basic safe_substitute. You're replacing one liners with one-liners.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] |
where avoiding the ambiguity tends to matter more -
in a conversation, if the difference actually matter, you can just ask. With a
written document, requesting clarification often isn't so simple.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] |
nge the hash method to use the size of the file or something else that has to
be equal for the comparison to be equal (like the hash of the first line, or of
the entire file), and you should see much better behaviour.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTEC
to a different platform without having to port the far more platform
specific GUI. This would have been much harder if we weren't already using a CSP
model for communication between different parts of the system)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
it as often as I do).
What do people think? I have never done this, would I just write up a PEP?
I've posted a question to py-dev about it. If Raymond (the itertools maintainer)
is supportive, then a PEP may not be needed. If not. . . yeah, a PEP would
probably be required.
Cheers,
Nick.
--
Ni
code - it's 'exbi' not 'ebi':
http://en.wikipedia.org/wiki/Binary_prefix#IEC_standard_prefixes
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredoman
Michael Hoffman wrote:
This is a fairly friendly group and they will answer even
newbie questions amicably.
Albeit with the occasional pointed comment about not at least skimming the
tutorial when it covers the question asked ;)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED
d in the
last couple of paragraphs simple and easy to use, rather than on a misguided
effort to "Kill the GIL".
Cheers,
Nick.
P.S. If the GIL *really* bothers you, check out Stackless Python. As I
understand it, it does its best to avoid the C stack (and hence thread
Nick Coghlan wrote:
class Namespace(object):
# etc
def _update_dict(self, other):
for k in other:
setattr(self, k, other[k])
This doesn't work, as it doesn't allow the sequence of 2-tuples. So I copied the
relevant check for a keys() attr
kes for better
marketing copy. . .
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
nt(10**i)
...
10.000 bytes
10.000 bytes
10.000 kilobytes
9.766 kibibytes
10.000 megabytes
9.537 mebibytes
10.000 gigabytes
9.313 gibibytes
10.000 terabytes
9.095 tebibytes
10.000 petabytes
8.882 pebibytes
10.000 exabytes
8.674 ebibytes
10.000 zettabytes
8.470 zebibytes
10.000 yottabytes
8.272 yobibyte
27;y.z': 1}
Py> vars(ns.y)
{'x': <__main__.C object at 0x009EB8D0>}
Py> vars(ns.y.x)
{'z': 2}
Combined with the update change, it means this code does the right thing:
Py> settings = {
... "x" : 1,
... "y" : namespaces.Namespace(),
ually want an implementation that looks like:
def cekaj(prompt="Press a key to continue"):
while msvcrt.kbhit():
msvcrt.getch()
if prompt is not None:
print prompt
msvcrt.getch()
And the sample program would look like:
cekaj("Hit a key!")
print "
more familiar with the guts of copy.py than
I am might be able to give a better answer if they happen to see the question.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomand
David Isaac wrote:
"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
A bug report on Sourceforge would help in getting the problem fixed for
the 2.5
docs
Done.
Bug 1121416, for anyone else interested. Looks Raymond agrees with me about the
left-to-rig
designed to be inheritance
friendly.
Though I'd like it to have a shorter name. I'm lazy.
'from namespaces import Namespace as ns' :)
I thought about suggesting simply 'space' as a name, but I think that's way too
vague. We're using it as a namespace, so we migh
Nick Coghlan wrote:
Py> class NS(namespaces.Namespace):
... x = prop
...
Oops - c&p error here. This was actually:
Py> class NS(namespaces.Namespace):
... x = prop
... __x__ = prop
...
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
descriptor machinery a bit further
in order to design a lookup scheme that is most appropriate for namespaces, but
the above example has convinced me that object.__getattribute__ is NOT it :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ting the docs to include that information would probably be a
bigger issue, as it involves behaviour which is currently not defined by the
library.
Cheers,
Nick.
[1] http://www.python.org/dev/doc/devel/lib/built-in-funcs.html
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
other highlights are:
NamespaceView supports Namespace instances in the constructor
NamespaceChain inherits from NamespaceView (as per my last message about that)
LockedView is a new class that supports 'locking' a namespace, so you can only
modify existing names, and cannot add or remove
UTF-8 data? WTF do you need
a byte order marker for when you have 8-bit data?"
It also clarifies Martin's comment about the UTF-8 codec ignoring the existence
of this piece of silliness :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] |
Peter Maas wrote:
I think that a new config utility is worth the effort if it has the
potential to put an end to roll-your-own config formats and parsers.
http://www.python.org/moin/ConfigParserShootout
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
_var_name" is "long_and_really_complicated_var_n
ame"
True
Py> "long_and_really_complicated_non_var_name" is "long_and_really_complicated_n
on_var_name"
True
Py> "long_and_really_complicated_non_var_name" * 20 is "long_and_really_complica
ted_non_v
;.
The first is better when you do know the name of the module you want at coding
time, but the latter is handy when you want to be dynamic about it.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
David Isaac wrote:
"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Using zip(*[iter(l)]*N) or zip(*(iter(l),)*N) simply extends the above to
the
general case.
Clearly true.
But can you please go into much more detail for a newbie?
I see that [iter(l)]
Lists (i.e. namespaces with a defined
field order)
Cheers,
Nick
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Hmm, I'm not so sure about this. I think that the right model is the way that a
class instance is currently chained with its class.
That is, assume we have the following:
c = cls()
ns = Namespace(vars(c), vars(cls)) # Using modified NS above
nc = NamespaceChain(Namespace(vars(c)), Nam
ce. If you actually copied them, they'd be
bound to the *old* instance, rather than the new one.
So I expect you'll need to provide a __deepcopy__ in order to correctly generate
the instancemethods bound to the new instance.
I also realised that the reason the use of a mutable default is OK here is
ent
looking function call.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
that already, it just won't do what you want:
r, g, b = col = dict(r = 4, g = 3, b = 12).values()
The dict-based implementation means named tuples they ain't :)
However, the namespaces module *would* provide a natural location for a
NamedTuple class.
Cheers,
Nick.
--
Nick Coghlan | [
obscured.
x.=42 vsx:=42
seems a clear win for the second IMO.
I'm forced to agree. So I'll use the latter syntax if I end up writing anything
further about rebinding :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
--
That module is. . .
a) impressive
b) very, very, wrong
c) both a) and b)
I think I'm voting for c). . .
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.sk
ive way -
it's more descriptive than anything. It's any language change that's designed to
make common idioms easier to use.
Cheers,
Nick.
No comment on the goto thing ;)
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
is actually zip(*tuple(zip(*tuple(iterable. That's
potentially an awful lot of data copying for an identity operation :)
Anyway, I think it does make a decent case for an itertools.iunzip or some such
beast.
Cheers,
Nick.
--
Ni
5ÛHH575-UAZWKVVP-7H2H48V3 wrote:
class Foo(list):
"Foo"
def __init__(self, l=[]):
Change this too:
def __init__(self, l=None):
if l is None: l = []
And see if your problem goes away.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
'alternative patterns' case:
if m using foo_pattern.search(subject) as m:
pass
elif m using bar_pattern.search(subject) as m:
pass
else:
pass
(Y'know, I'm pretty sure the impetus was regexp matching the *last*
an one nested if statement due to the 'problem' of not
being to do an embedded assignment.
*shrug* The issue has never really bothered me in practice. Heck, I often don't
use nested assignment even in C, since the buggers can be so damn hard to read.
That's mainly due to
Alex Martelli wrote:
Nick Coghlan <[EMAIL PROTECTED]> wrote:
For bindings, you could just go with standard Python semantics - normal
name binding always happens in the innermost scope, so binding a name in a
namespace should happen in the directly referenced namespace. Then you can
shadow
er than globals, generic objects would work for
using those, too.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Antoon Pardon wrote:
Op 2005-02-08, Nick Coghlan schreef <[EMAIL PROTECTED]>:
The CPython *_FAST opcodes relate to functions' local variables. Behind the
scenes they are implemented as integer indexing operations into a pre-sized C
array. Operations don't come much faster than
s the use of class definition syntax for
simple data structures
- lookup chaining, allowing fallback to an 'outer scope'.
Even though we'll probably end up dropping the last couple as overengineering
things for the first pass, they're still interesting ideas t
Michael Spencer wrote:
Nick Coghlan wrote:
The other issue is that a namespace *is* a mutable object, so the
default behaviour should be to make a copy
I don't follow this argument. Why does mutability demand copy? Given
that somedict here is either a throwaway (in the classic
operation *theoretically* be quicker for the other cases which
involve a real dictionary (or something that looks like one)? Well, perhaps.
Although I can't see how the rebinding operation would gain a benefit that a
standard binding operation wouldn't gain if placed at the exact same point.
C
Just wrote:
In article <[EMAIL PROTECTED]>,
Nick Coghlan <[EMAIL PROTECTED]> wrote:
Antoon Pardon wrote:ons already existing.
The compilor might generate a RESTORE instruction.
Whether it is done as a LOAD/STORE or a RESTORE, it has to perform the same
work
- check the name exists
1 - 100 of 435 matches
Mail list logo