t. I
once
spent a good deal of effort exploring where it made sense, and I was surprised
to find that it only rarely works out. Length transparency is an unexpectedly
thorny subject with many dead-ends which precludes a fully general solution such
as that proposed by Nick.
For a recap of my research
that PEP 311 (which added these
functions) went in.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ptions are rare, and not worth
worrying about at that point in their learning.
Only when one is aware of the reasons for a principle, can one be aware of good
reasons not to follow it :)
Cheers,
Nick.
--
Nick Coghlan | [EM
le keys acquire
the requisite immutability is going to be application dependent.
Provision of a safe_dict or identity_dict would merely allow a programmer to
state their intent at the time the container is created, rather than having to
state it whenever keys
l be making copies all the time.
Alternatively, the class could declare itself to work reliably only with
immutable objects. Performance will improve, since copies need only be made when
an object *actually* changes (and the old immutable copy is deleted and the new
version inserted in its p
limit is platform dependent, but something
around 1000 sounds fairly normal.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
David Eppstein wrote:
Yes, and what should the following do?
lst1 = [1]
lst2 = [2]
dct = {lst1: "1", lst2: "2"}
lst2[0]=1
lst1[0]=2
print dct[[1]]
print dct[[2]]
Provide yet another example for why mutable keys are almost guaranteed to result
in suprising semantics :)
C
data structure). This aligns quite well with the stated goal of the
collections module (providing data structures that are less general purpose than
the standard builtins, but deliver better performance for their particular use
cases)
Regards,
Nick.
--
Nick Coghlan | [EMAIL PROT
ot;Read via mutated y:", dct[y.frozen()]
x.unfreeze()
y.unfreeze()
print "x:", x
print "y:", y
print "Found unfrozen x:", x.frozen() in dct
print "Found unfrozen y:", y.frozen() in dct
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
--
to make sure you end up with the
features you need, without the irrelevant baggage an overengineered solution may
bring with it.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
lf, **kwds)
... for attr in Buildable.__slots__:
... setattr(self, attr, kwds[attr])
...
Py> b = Buildable(x = 1 , y = 2)
Py> b.x
1
Py> b.y
2
(Note that you don't *have* to use slots, you can use a non-special class
attribute if you don't want the other side effects)
to a
different data structure that works natively as a dict key, naturally).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
Nick Coghlan wrote:
If this only has to work for classes created for the purpose (rather than
for an arbitrary class):
Certainly a step into the direction I meant - but still missing type
declarations. And that's what at least I'd like to see - as otherwise you
containing
scope is viewed as a feature.
But knowing a priori that copying the for loop semantics exactly would turn out
to be a misfeature? I'll go with Steve's assessment of psychic powers ;)
Cheers,
Nick.
--
Nick Coghlan
27;
Py> show_base(0, 16)
'0'
Py> for base in range(2, 36):
... for testval in range(1000):
... assert testval == int(show_base(testval, base), base)
...
Py>
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
y = 1
Setting y to 1 on <__main__.C object at 0x00A9A990>
Py> del c.y
Deleting y from <__main__.C object at 0x00A9A990>
The decorator syntax is the only 2.4'ism I'm aware of in that code, so porting
to 2.3 or even 2.2 shouldn't be an issue.
Cheers,
Nick
, but completing the transition to an iterator based approach isn't
going to be possible until Python 3.0, when things that currently return lists
can be converted to return iterators (i.e. it has been suggested that the
fundamental construct in Python 3.x should be an iterator just a
Bengt Richter wrote:
On Sat, 22 Jan 2005 00:45:19 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
Here's an interesting twiddle, though (there's probably already something along
these lines in the cookbook):
Looks like you also played with this problem, after Alex posted a request
ction constants declared separate from arguments
> since they mean such different things.
I played around with this, and I think it's basically implementable:
Raymond's constant binding decorator is probably a good model for how to do
it:
http://aspn.activestate.com/ASPN/Cookbook/Pytho
t
'not always' which can end up hurting. . .
Regards,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
File "", line 1, in ?
AttributeError: 'list' object has no attribute 'ljust'
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
e, it.repeat(default)), N)
...
>>> a,b,c,d = ipad(4,line)
>>> a,b,c,d
('A', 'B', 'C', None)
Good idea!
(+1 if this was posted on python-dev!)
Please, please Google the python-dev archives before doing so ;)
Cheers,
Nick.
I seem to recall &
ary.
Updates in the other direction are far less common (exec without an 'in' clause,
star imports, and monkeying with the frame via the C API are the only cases I am
aware of).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTEC
written for me, but I believe there were Python 2.4 changes
relating to using exec with non-standard dictionaries.
Regards,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlazines
move()
Internally, idioms like "for robot in robots" should be entirely unaffected -
the registration of the robot instance with the global list of robots can be
handled by the robot initialisation method.
Regards,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
Nick Coghlan wrote:
Will Stuyvesant wrote:
The program below creates a stream with the numbers 1..995
and then filters the stream, keeping only the even numbers,
and then prints the second number in the stream (implemented
as the first number of the tail, just like in the 3.5
Section in the Wizard
t; def f(): pass
...
Py> f.func_name
'f'
Py> f = lambda: None
Py> f.func_name
''
I think I've heard that explanation before, but it never really clicked.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
Peter Otten wrote:
Nick Coghlan wrote:
Py> print islice((x for x in xrange(1, 996) if x % 2 == 0), 1, 2).next()
4
Wouldn't it be nice if this could be spelt:
print (x for x in xrange(1, 996) if x % 2 == 0)[2]
Well, I just put a patch on SF to enable exactly that:
http://www.python.org/sf
Steven Bethard wrote:
Open Issues
===
What should the type be named? Some suggestions include 'Bunch',
'Record' and 'Struct'.
Add 'namespace' to the list of name suggestions :)
Cheers,
Nick.
The name came up in some thread a few weeks back. .
oblem of holding a reference to the
original sequence, though.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
imports to work).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
mns" and activating "VM Size" is enough to
find out how much memory that program actually has *mapped* (rather than
currently loaded into RAM).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
-
> show_base(10, 16, 2, complement=True)
'0A'
Py> show_base(-10, 16, 2, complement=True)
'F6'
Py> show_base(127, 16, 2, complement=True)
'7F'
Py> show_base(-127, 16, 2, complement=True)
'81'
Py> show_base(255, 16, 2, complement=True)
'FF'
Py&
mpiled bytecode might make a reasonable feature request,
though.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
blanket ban on OO techniques.
Jeremy's "Bower's Law" page really does provide a good perspective on the
benefits of judicious use of OO techniques
(http://www.jerf.org/writings/bowersLaw.html).
Cheers,
Nick.
--
Nick Coghlan
at the same time :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
n (except any saving resulting from the memory saving).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
he reasons it was
added in the first place.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ot;", (id,))
for python_code in c.fetchall():
execute (python_code)
Maybe feed python with stdin??.
What's wrong with the exec statement?
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
v = Viking()
orders = [ v.order() ] * 511
print ', '.join(orders)
## cut here
With no apologies to Eric Idle,
Nick
--
# sigmask || 0.2 || 20030107 || public domain || feed this to a python
print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?
advice is to use new-style classes unless you have a reason not to
(if you're inheriting from a builtin type, then there is no need to inherit from
object as well - the builtin types already have the correct basic type).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Aust
esult set is created by one
big allocation or lots of little ones (If the latter, other responses have
pointed out how it may cause your problem).
There's also a chance of a problem with the database API wrapper, so it may be
worth checking with an API specific list.
Cheers,
Nick.
--
Ni
tion tables.
What a language with OO support adds is special syntax for something that you
could have done anyway - the OO support just makes it easier and clearer (well,
C++ aside).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] |
tend(range(5)) and data.sort() are alternative spellings
for the second and third lines doesn't change the fact that a class is just a
data structure grouped with a bunch of functions that operate on that data
structure.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED]
HIJ
Ditto list.sort() and sorted().
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
"Matt" <[EMAIL PROTECTED]> writes:
> Not to be nit-picky, but you got some issues here ;-). Never forget
> the importance of "self"!
Teach me to post untested code. *hangs head*
Nick
--
# sigmask || 0.2 || 20030107 || public domain || feed this to a
bugging
import httplib
httplib.HTTPConnection.debuglevel = 1
from SOAPpy import WSDL
server = WSDL.Proxy('d:/googleapi/GoogleSearch.wsdl')
print server.methods.keys()
callInfo = server.methods['doGoogleSearch']
for arg in callInfo.inparams:
print arg.name.ljust(15), arg.type
Any help at all would be appreciated.
Sincerely,
Nick
--
http://mail.python.org/mailman/listinfo/python-list
Nick Craig-Wood wrote:
Nick Coghlan <[EMAIL PROTECTED]> wrote:
Exactly. My advice is to use new-style classes unless you have a
reason not to (if you're inheriting from a builtin type, then there
is no need to inherit from object as well - the builtin types
already have the correct
t.
Is that the sound of a volunteer I hear?
All you have to do is put your hand up, and the problem will be solved. If not
you, who?
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
(range(10), 3))
[(0, 1, 2), (3, 4, 5), (6, 7, 8), (9, None, None)]
Py> list(padded_partition(range(10), 3, False))
[(0, 1, 2), (3, 4, 5), (6, 7, 8), (9, False, False)]
Py> zip(*padded_partition(range(10), 3))
[(0, 3, 6, 9), (1, 4, 7, None), (2, 5, 8, None)]
Not sure how useful that last
tion
not allowed in restricted build"); return NULL;".
Then it doesn't matter *how* you get hold of file(), it still won't work. (I can
hear the capabilities folks screaming already. . .)
Combine that with a pre-populated read-only sys.modules and a restricted custom
inter
Fredrik Lundh wrote:
Nick Coghlan wrote:
I'm sorry, but this isn't really good enough. If Open Source wants to
say that they are better than these proprietary companies, they need
to deal with these sorts of things more professionally and establish
decent channels of communications f
ught directly to the
attention of python-dev. At that point, the decision may be made to make a
general announcement as to the feature which needs to be avoided or handled
carefully. This would likely take the form of announcements on the
www.python.org website, and on comp.lang.python.announce.
Rega
created last winter, when Sydney was NOT on daylight savings:
Py> time.localtime(os.path.getmtime("c:/log.txt"))
(2004, 7, 20, 19, 46, 35, 1, 202, 0)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
lla's
security flag.
Regards,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
acmqueue.com/modules.php?name=Content&pa=showpage&pid=271&page=3
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org
thing.)
Something like this?
http://tams-www.informatik.uni-hamburg.de/applets/jython/demo.html
Well, without the assumption of not knowing how to program :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Aust
pinion on _current_ Fortan has problems far bigger than a single article.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
g more
sense to just use an OS-based sandbox that lets you execute arbitrary binaries
relatively safely.
The last suggestion I recall along these lines was chroot() plus a monitoring
daemon that killed the relevant subprocess if it started consuming too much
memory or looked like it had got stuc
EF 0 (y)
9 STORE_NAME 3 (x)
12 LOAD_LOCALS
13 RETURN_VALUE
Here we can see the "LOAD_DEREF" instead of the "LOAD_NAME" that was present in
the version where the same name is reused. The dereference presumably pi
, since they don't allow that initial lookup to
be made from the outer scope.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.pytho
lowing code give when you run it at the
interactive prompt?:
Py> import socket
Py> socket.getservbyname('daytime')
13
Second, is there an entry for 'daytime' in /etc/services?
Cheers,
Nick.
--
Nick Coghla
guy in the T-shirt is in more danger. A _lot_
more danger.
Nick
--
# sigmask || 0.2 || 20030107 || public domain || feed this to a python
print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
--
http://mail.python.org/mailman/listinfo/python-list
list
Setset, frozenset
Mappingdict
File file
"""
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.n
, that should give the behaviour we
want - any protocol will match.
However:
Linux 2.6.4-52-default (Suse 9.1)
Glibc 2.3.3
gcc 3.3.3
So it may be that your older platform doesn't have this behaviour - I'd be very
interested in what 'man getservbyname' has to say.
Chee
ctly when the
padding wasn't needed.
Padding with one less than the partition length fixes that quite neatly.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skys
x27;0xbe')
Py> hex(hi + lo)
'0x145'
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
if val == 0:
... return 0
... return limit - val
...
Py> hex(complement(0x55))
'0xab'
Py> hex(complement(0x55, 256*256))
'0xffab'
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
--
Nick Coghlan wrote:
When not working at the hardware level, just go with the definition:
Py> def complement(val, limit=256):
... if val >= limit or val < 0:
... raise ValueError("Value out of range for complemented format")
... if val == 0:
... return 0
... return
Pawe³ Chrobak wrote:
Hi
How to take access to serial port (rs232) ??
Is't possible?? Just tell me guy's where I can take o look
The same place you should always look - Google.
Keywords: python serial
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
ut killing backward compatibility with string
exceptions is hard :)
Doesn't mean people aren't trying though (Google the python-dev archives, as
well as the python-list ones).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] |
run "ldd python24" to see which shared C
library it is linking to.
For me, it's /lib/tls/libc.so.6. Running that library directly prints out the
message about GNU C library 2.3.3.
Cheers,
Nick.
--
Nick Coghlan | [EM
pect to Perl, I find it to be such an inconsistent dog's breakfast that I
have the docs page open whenever I have to write or read it. With Python, I
first used it for one subject at University, and was able to pick it back up a
few years later without even looking at the documentation.
Chee
(((val // (10 ** i)) % 10) for i in count())
)
)
)
Usually you're going to be better served by making the generator function
smarter if you're going to be writing one anyway, though.
Cheers,
Nick.
--
Ni
ite recursion.
It *is* possible to eliminate the explicit class argument, but it takes a bit
(*cough*) of work:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/286195
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
-
f the tests and the post-analysis of the generated data).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
A Steve wrote:
A Steve wrote:
A Steve wrote:
There we go, much clearer ;)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org
evil hack and almost certainly not what anyone should be doing.
Also, variables created this way will be slower than normal variables due to the
way the associated code works.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
hael's is going to be much easier to debug, much easier to
understand later, and far more reliable all the way along. The performance is
almost certainly going to be acceptable.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
tion
This feature can't be added to lists because it is possible to iterate sensibly
over a mutating list:
Py> l = range(10)
Py> for i in reversed(l): del l[i]
...
Py> l
[]
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
n
Python 2.5 the line should be spelt "from itertools import flatten"
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
itself into a generator?
Py>def iter_collapse(myList):
... for x in it.groupby(myList):
... yield x[0]
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
h
nge files and folders search behaviour
Advanced
OK
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
would absolutely be the *best* solution to my problem.
Bo
Guido van Rossum has stated that he wants Python to eventually have a 'with'
statement of the form:
with d:
.z = .x + .y
(The leading '.' being required to avoid ambiguity in name lookups)
Cheers,
Nick.
--
Ni
Windows.
pywin32 is about better support for Windows specific idioms (e.g. easier COM
support, more convenient registry access).
Pythonwin is a windows native Python IDE built using MFC. Idle uses TKinter and
doesn't really feel like a standard Windows app.
Cheers,
Nick.
--
Nick Co
ipulator, simply
define additional calculator methods, and define the attribute with make_prop.
Use a class. Giving meaningful form to a collection of attributes is what
they're for, and Python provides many features designed to make that process e
ttr__(self, "_data", data)
def __getattr__(self, attrname):
return self._data[attrname]
def __setattr__(self, attrname, value):
self._data[attrname] = value
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] |
pcopy
Py> deepcopy(x)
Traceback (most recent call last):
File "", line 1, in ?
File "C:\Python24\lib\copy.py", line 172, in deepcopy
y = copier(memo)
TypeError: cannot deepcopy this pattern object
Py> x.__de
z = _utils.make_prop('z', _utils.calc_z)
Py> d = DataManipulator(dict(x=1, y=2))
Py> d.x
1
Py> d.y
2
Py> d.z
3
Py> d.x = 10
Py> d.z
3
Py> del d.z
Py> d.z
12
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
Alex Martelli wrote:
Nick Coghlan <[EMAIL PROTECTED]> wrote:
...
Michael Spencer also posted an interesting idea recently about setting up
a view of an existing dictionary, rather than as a separate object:
class attr_view(object):
def __init__(self, data):
object.__setattr__(self,
so how does it look?:
S=0
for eps in xrange(10):
S @= S + ups
Meh. At symbols are still ugly. A full stop might work better, since the
semantics aren't very different from a reader's point of view:
S=0
for eps in xrange(10):
S .= S + ups
Anyway, the e
er
has explicitly requested an unconditional name binding by using '=' and then
made a typo on the left hand side.
Cheers,
Nick.
Did I mention the possible incidental benefit of reducing the whinging about the
lack of variable declarations?
--
Nick Coghlan | [EMAIL PR
tem != lastitem:
yield item
lastitem .= item
(Note that doing this *will* slow the code down, though, since it has to check
for the existence of the name before rebinding it)
Cheers,
Nick.
--
Nick Coghlan | [EMA
making you jump through irrelevant
hoops.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
hat said, one of the reasons I like CPython is that it lets you drop into C/C++
really easily when you need to (generally for hardware interface or performance
reasons). The builtin profiler can also give some decent hints on the
bottlenecks where you need to focus your performance improvements.
C
ms of
elementary operations of getting and setting (of attributes, items, &c).
I was thinking of something simpler:
x.y
x.y = z
That is, before the assignment attempt, x.y has to resolve to *something*, but
the interpreter isn't particularly fussy about what that something is.
Che
Steven Bethard wrote:
Nick Coghlan wrote:
I think the idea definitely deserves mention as a possible
implementation strategy in the generic objects PEP, with the data
argument made optional:
That's basically what the current implementation does (although I use
'update' instea
file = sys.argv[0]
else:
file = __file__
testdir = os.path.dirname(file) or os.curdir
return testdir
So intead of adding anything to sys.path, tweak the call to 'main' on the final
line to set "testdir" appropriately.
Cheers,
Nick.
--
Nick Coghlan
On Mon, 20 Jun 2005 23:30:27 +0200, Oliver Albrecht
<[EMAIL PROTECTED]> wrote:
>Has some one an sodoku-task-generator?
>Here another solutions-ways:
>http://www.python-forum.de/viewtopic.php?t=3378
It's presumably easy to turn a solver into a generator.
Start with a random grid, and remove squar
Hi,
Complete newb to Python and programming, looking for an open source
IDE to download. Any suggestions?
Thanks,
Nick
--
http://mail.python.org/mailman/listinfo/python-list
201 - 300 of 1626 matches
Mail list logo