Re: Misleading wikipedia article on Python 3?

2007-08-08 Thread greg
nt function, but that's probably worse than swapping sys.stdout. (I agree that print should be a function, simply because there's no strong reason for it *not* to be. But I don't think it makes a difference to this particular problem.) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: is there anybody using __del__ correctly??

2007-08-10 Thread greg
eing closed could be referenced from somewhere else. If that's so, the __del__ method may be performing a useful service by closing it more promptly than it would otherwise be. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading wikipedia article on Python 3?

2007-08-10 Thread greg
nd logs stuff written to it. > What do you find wrong with this sort of "monkeypatching"? At least sys.stdout was designed somewhat with the possibility of replacing it in mind. It's not an entirely unexpected thing to do. Replacing something in the builtin namespace seems like a more

Re: Issues of state

2007-08-10 Thread greg
willing to put in a huge amount of time, effort and ingenuity, it's possible to overcome a problem that only existed in the first place because you chose an inappropriate technique for implementing a user interface... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: pep 3116 behaviour on non-blocking reads

2007-08-10 Thread greg
read from a stream, and it won't be read otherwise. In that case, the code *still* won't ever see a None. So I think the PEP has it right. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: tempfile behavior

2007-08-10 Thread greg
Marc 'BlackJack' Rintsch wrote: > File descriptors are integers. It's a low level C thing. Either use the > low level functions in `os` or open the file with the `filename`. In particular, os.fdopen(fd) will give you a file object. -- Greg -- http://mail.python.org/ma

Re: Threaded Design Question

2007-08-10 Thread greg
e same file twice before a worker has gotten around to working on it, and there is no need for a custom queue class. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: who is simpler? try/except/else or try/except

2007-08-12 Thread greg
xcept clause will only catch exceptions in , whereas in the second it may catch exceptions in as well. It probably doesn't make a difference in this example, but there are situations where it can. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Car Air Conditioners

2007-08-13 Thread greg
Robert Coe wrote: > It's hard to imagine anything more OT in this newsgroup It's on topic as long as the air conditioner can be programmed in Python. With the amount of electronics being used in cars these days, that's not entirely beyond the realms of possibility...

Re: about negative polar plots

2007-08-16 Thread greg
yadin wrote: > hi am doing a polar plot of the radiation pattern of an antenna. > the polar plots represents the value of the power in dB's and the dB > go from -40dB to 0dB Add 40 so that the range goes from 0 to 40, then plot that to an appropriate scale. -- Greg -- http://m

Syslog

2007-08-20 Thread greg
Hi All, Could anyone tell me how I could syslog to a specific log (e.g. /var/ log/daemon.log, /var/log/syslog.log...)? Thanks very much in advance! -Greg -- http://mail.python.org/mailman/listinfo/python-list

ANN: PROBE 1.0

2007-09-01 Thread greg
can actually be played in a deliberate way now instead of just trial and error like the first one. Currently available here: http://www.cosc.canterbury.ac.nz/greg.ewing/python/PyWeek4/Probe-1.0.zip -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Source Code Beautifier

2007-03-02 Thread greg
ace operators to the language was held up for a long time until the present compromise was devised. You might not like it, but it's here to stay. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about app design - OOP with python classes

2007-03-04 Thread greg
Paul Rubin wrote: > Maybe we can concoct a cross between Python and Haskell, and call it > "Paskell" after the philosopher Blaise ;-). No, we name it after Pascall's confectionery: http://www.homesick-kiwi.com/productpage.php?id=51 Lots of syntactic sugar.

Re: Questions about app design - OOP with python classes

2007-03-04 Thread greg
"a new kind of integer" that is not compatible with other integers. Pascal and Modula just had a fixed set of numeric types with various predefined compatibility rules, not much different from C. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: number generator

2007-03-10 Thread greg
list of N non-random numbers that sum to M, and then adjust them up or down by random amounts. By performing up/down adjustments in pairs, you can maintain the sum invariant at each step. So then it's just a matter of how long you want to go on fiddling with them. -- Greg -- http://mail

Re: floating point rounding

2007-03-10 Thread greg
splay* it rounded to the number of digits you want using formatting, e.g. >>> "%.2f" % x '0.15' Alternatively, use the Decimal module, which stores numbers as decimal and does arithmetic in ways that will match your calculator. It's slower, though. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: number generator

2007-03-10 Thread greg
to be *random* at all... or, equivalently, they can have a very skewed distribution. :-) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: number generator

2007-03-13 Thread greg
Gabriel Genellina wrote: > The 5th number is not "random". More precisely, the fifth number is not *independent* of the others. You can't have five independent random numbers that sum to 50; only four independent numbers plus a dependent one. -- Greg -- http://mail.python.or

Re: Circular Class Logic

2007-03-16 Thread greg
rent use cases. It's usually not appropriate for __init__ calls, because an __init__ method generally doesn't have the same signature as that of its base class(es). You're better off calling the base __init__ directly, then you know exactly which method you're calling and what s

Re: Documentation for "str()" could use some adjustment - Unicode issue

2007-03-19 Thread greg
John Nagle wrote: > and when we get to > Unicode-only strings, "str" will never raise a conversion exception. On *strings*, maybe, but objects can implement __str__ in arbitrary ways, so you can't say anything in general about what str() will do. -- Greg -- http://ma

Re: any ways to judge whether an object is initilized or not in a class

2007-03-19 Thread greg
ince one object is being shared between all instances. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: XML based programming language

2007-03-19 Thread greg
way, such as semantic analysis and/or code generation. That stuff has to be done anyway, and validation sort of comes out of that for free. So inserting an extra validation step might not be of any advantage. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Still the __new__ hell ...

2007-03-19 Thread greg
ll as just a single type. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Still the __new__ hell ...

2007-03-19 Thread greg
Steve Holden wrote: > >>> basestring > You're right, I'm not sure what made me think it was a tuple. Maybe because people used to write isinstance(x, (str, unicode)) before basestring existed. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Weird gcc behaviour with function pointer types

2007-03-29 Thread greg
ks like a bug in gcc to me -- what do people think? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

ANN: Plex 1.1.5

2007-01-27 Thread greg
I have released a small update to Plex to fix the problem of assignment to None causing syntax warnings or errors in Python 2.3 and later. What is Plex? Plex is a Python module for lexical analysis that provides similar functionality to Lex and Flex. -- Greg -- http://mail.python.org/mailman

ANN: Pyrex 0.9.5

2007-01-27 Thread greg
Pyrex 0.9.5 is now available: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ Warning Elimination Extensive changes have been made in this version in an effort to eliminate most of the C compiler warnings that used to occur when compiling with distutils. There are also numerous other

ANN: Plex 1.1.5 (Repost)

2007-01-27 Thread greg
for lexical analysis that provides similar functionality to Lex and Flex. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: subclassing pyrex extension types in python

2007-01-27 Thread greg
wds): ... Without that, your Python subclass would have to define its own __new__ method which accepts the extra args and strips them out, e.g. class MySpam(Spam): def __new__(cls, name1=None, name2=None): return Spam.__new__(cls) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

ANN: Pyrex 0.9.5.1

2007-01-30 Thread greg
Pyrex 0.9.5.1 is now available: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ This is a minor release to fix a few bugs introduced in 0.9.5. See the CHANGES for details. What is Pyrex? -- Pyrex is a language for writing Python extension modules. It lets you freely mix

OT: Variant name spellings (Re: how to "free" an object/var ?)

2007-02-01 Thread greg
ickens *wink* Or Mr. Luxury-Yacht, which as we all know is pronounced Throatwarbler-Mangrove. With a silent hyphen. -- Greg Psmith (pronounced You-ing) -- http://mail.python.org/mailman/listinfo/python-list

ANN: Pyrex 0.9.5.1a

2007-02-01 Thread greg
Pyrex 0.9.5.1a is now available: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ This is a glitch-fix nanorelease to correct a problem with the setup.py file. The list of packages to install is now calculate dynamically, so that it will work with or without the testing files. What is

Re: Overloading the tilde operator?

2007-02-02 Thread greg
James Stroud wrote: > You haven't addressed why the limitation isn't arbitrary. It's not arbitrary because there is a built-in meaning for infix minus, but not for infix tilde. Python doesn't go out of its way to provide operators which aren't used by at least

Re: Spring Python 0.2.0 is released

2007-02-02 Thread greg
Jonathan Curran wrote: > Greg, > You have managed to peak my interest. I think the word you're after here is "pique" (although I suppose "peak" kind of makes sense as well:-). -- Greg (a different one) -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimating Excel files

2007-02-03 Thread greg
gonzlobo wrote: > 2. Decimate an Excel file & write... say every other line (user > selectable)... to a new file. Every other line would be bicimating or something, wouldn't it? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGUI show_text()

2007-02-03 Thread greg
ble to find out what you need to know from those. > would it be possible to include some optional positioning > parameters, something like left,center,right,top,middle,bottom to > show_text()). Yes, I'm considering something like that. > All in all thanks a lot for PyGUI, Glad yo

Re: Decimating Excel files

2007-02-05 Thread greg
"duplicating" is actually from the wrong root? And also we have "bifurcation", which means splitting in two rather than multiplication by two -- or does that come down to the same thing? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling J from Python

2007-02-05 Thread greg
s, but with Python you wouldn't have to spend a couple of weeks sitting and thinking before starting to type that line... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Coordinate Grid Points

2007-02-06 Thread greg
[EMAIL PROTECTED] wrote: > class Point(object): > def _init_(self, x, y): The name of the __init__ method needs *two* underscores at each end, i.e. def __init__(self, x, y): -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial 1.0 - Partial classes for Python

2007-02-07 Thread greg
main class as inheriting from all of them. That avoids the monkeypatching-like behaviour of what you're doing -- the main class definition makes it clear what parts it's made up of -- and it uses only standard Python techniques, so it doesn't harbour any surprises. -- Greg -- http://

Re: Overloading the tilde operator?

2007-02-07 Thread greg
st about any sequence of non-letters as an infix operator, but it has no notion of precedence, even for the built-in operators. I think SNOBOL may have had something for defining new operators, but I can't remember the details. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Referencing vars, methods and classes by name

2007-02-08 Thread greg
. > > A generic function helps on using it on objects of any kind - like > len() > Perhaps it was more important with old style classes. It also avoids intruding on the method namespace of the object. That's important -- I like the way that the namespace of a brand-new cla

Re: Calling J from Python

2007-02-10 Thread greg
+ i][x] = buffer[y + i][x + i] = "*" for i in range(4): buffer[y + 3][x + i] = "*" print_sierpinski(2) ### By making the recursion explicit, I think this brings out the self-similarity better than any of the other solution

Re: Python 3.0 unfit for serious work?

2007-02-20 Thread greg
#x27;t help feeling that this JIT business is over-hyped. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: f---ing typechecking

2007-02-22 Thread greg
table objects. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Local class variables? (mod_python problem)

2007-02-22 Thread greg
ou need it. Whether that's better or not will depend on how frequently you need the value. -- Greg > > totalgia keeps incrementing when this code is used under mod_python. > > We most certainly are in 'murky waters of accidental concurrent access'. > A life vest would

Re: Regex Speed

2007-02-23 Thread greg
at way. There's a description of the NFA-to-DFA algorithm here: http://www.gamedev.net/reference/articles/article2170.asp -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: how to call os.path.join() on a list ...

2007-02-26 Thread greg
ecause it will do the right thing for the platform, which might not be so simple in all cases. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

import parent

2007-02-27 Thread Greg
How does one get access to the class that imported a module. For example: foo imports bar -- how does bar access foo? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Vector, matrix, normalize, rotate. What package?

2007-03-01 Thread greg
r, but if you can find a formula, you should be able to use similar techniques to "vectorize" it using Numeric. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: design question: no new attributes

2007-03-01 Thread greg
(self) self.c = 42 # <--- Not allowed! You could get around this by temporarily de-initializing it, i.e. def __init__(self): NothingNew.__init__(self) del self.__dict__['initialized'] self.c = 42 self.initialized = True but that'

Re: Writing an interpreter for language similar to python!!

2007-03-01 Thread greg
it makes a lot of sense to consider whether Python itself could be used. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: finding out the precision of floats

2007-03-01 Thread greg
mething in the code. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: sockets: why doesn't my connect() block?

2007-11-18 Thread greg
#x27;s perhaps a little misnamed in that regard). -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple eval

2007-11-18 Thread greg
(): from tokenize import STRING, NUMBER def atom(next, token): ... return atom atom = make_atom() -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: eof

2007-11-23 Thread greg
ability to set arbitrary attributes on an object, which is almost never wanted for built-in types, so it's not provided by default. You can easily get it if you want it by defining a Python subclass of the type concerned. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: eof

2007-11-23 Thread greg
ccurs right here after the last line > No, if the line you just read ends in "\n", you don't know whether eof has been reached until the for-loop tries to read another line. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: foldr function in Python

2007-11-23 Thread greg
ambda, nested functions or partial(). -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: eof

2007-11-23 Thread greg
it was get(f) to read the next record into the buffer. Read(f, x) was a higher-level procedure equivalent to something like x = f^; get(f) Plus for text files read() and write() did various other fancy things. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Not forking?

2007-11-23 Thread greg
r. Do you get any traceback? > try: > cidnum = sys.argv[1] > except: > print "Format: netcid.py cidnum cidname" > sys.exit(1) You realise that having directed stdout into /dev/null, you're not going to see these messages? What happen

Re: the annoying, verbose self

2007-11-23 Thread greg
nly is it easier to read, it's also more efficient, because it avoids looking up instance variables more than once. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: the annoying, verbose self

2007-11-24 Thread greg
else() Doesn't even need any new syntax. :-) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: the annoying, verbose self

2007-11-24 Thread greg
t;, var3 = stuff)) if you really wanted to. (Don't be surprised if everyone else refuses to maintain your code, though!) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: the annoying, verbose self

2007-11-24 Thread greg
t way later. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: How to display unicode with the CGI module?

2007-11-26 Thread greg
a much more consistent and less error-prone way. If you mistakenly try to use encoded data as though it were decoded data or vice versa, you'll get a type error. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: How to display unicode with the CGI module?

2007-11-26 Thread greg
27;s the safest assumption. Python is refusing the temptation to guess the encoding of anything outside the range 0-127 if you don't tell it. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Teach Python "Variables"

2007-11-26 Thread greg
rs. That should give them the right mental model to build on. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Teach Python "Variables"

2007-11-26 Thread greg
xes and arrows. It's much easier to explain all these things unambiguously with diagrams than with words that may not mean the same thing to the listener that they mean to you. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: "Python" is not a good name, should rename to "Athon"

2007-11-30 Thread greg
; culture. Not necessarily. A python is a sleek and powerful creature, which are good associations for a programming language. The word also hints at a bit of danger and excitement. On the whole, I think it's a good name. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: "Python" is not a good name, should rename to "Athon"

2007-12-01 Thread greg
the value of the expression C++ is actually C. So when using C++ you only get to take away the old language, and you have to leave the new one behind in its place... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: "Python" is not a good name, should rename to "Athon"

2007-12-02 Thread greg
ate name for a programming language, I'd suggest Babbage. (not for Python, though!) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python surpasses Perl in TIOBE index

2007-12-04 Thread greg
level parts (or at least doesn't expose them unless you explicitly ask it to). -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: changing fonts?

2007-12-07 Thread greg
as utf8-encoded unicode. I just tried an experiment and managed to get Greek letters displayed this way. I had to turn off the "Wide Glyphs for Japanese/Chinese etc." option under File/Get Info to get the spacing to come out right. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: changing fonts?

2007-12-09 Thread greg
u can get to it from Terminal using "Special Characters..." on the Edit menu. There's a search box down the bottom where you can enter part of the unicode name of a character, e.g. "GREEK" will get you into the greek alphabet area. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to protect my new commercial software.

2007-12-10 Thread greg
farsheed wrote: > It is some kind of in house tool and I want to copy protect it. this > is very complicated tool and not useful for > many people. So there will be very few people with any incentive to steal it, and even less if it's not distributed to the public. --

Re: Best way to protect my new commercial software.

2007-12-10 Thread greg
Carl Banks wrote: > From the OP's post, it seemed likely to me that the OP was asked by a > misguided management to make sure it was "reverse-engineer-proof". In that case, just package it with py2exe and tell him it's done. The misguided management won't kno

Re: Best way to protect my new commercial software.

2007-12-10 Thread greg
Tim Chase wrote: > -Write Lovecraftian code ("import goto" comes to mind) designed > to make reverse-engineers go insane trying to figure out what you > were thinking The problem with that is it makes it hard for *you* to figure out what you were thinking... -- Greg -- htt

Re: Is Python really a scripting language?

2007-12-13 Thread greg
ive you the range of expression you need. Sounds like AK is talking about Python here and doesn't know it... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: opposite of zip()?

2007-12-15 Thread greg
ll the elements of 'arrays' are actual lists. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: About Rational Number (PEP 239/PEP 240)

2007-12-15 Thread greg
used behind the scenes when people didn't realise it. So while rationals might be useful to have available for some things, you should have to explicitly ask for them. Returning rationals from '/' applied to integers would be a bad idea, for example. -- Greg -- http://mail.pyt

ANN: Pyrex 0.9.4.1

2006-04-21 Thread greg
Pyrex 0.9.4.1 is now available: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ This is a very minor update to correct a tab/space problem in the distutils extension. What is Pyrex? -- Pyrex is a language for writing Python extension modules. It lets you freely mix

ANN: PyGUI 1.7.1

2006-05-05 Thread greg
PyGUI 1.7.1 is now available: http://www.cosc.canterbury.ac.nz/~greg/python_gui/ New features: - Slider control. - run() convenience function, equivalent to application().run(). - Geometry.rects_intersect() function. Enhancements: - Files given on the command

Re: Creating instances of untrusted new-style classes

2006-05-26 Thread greg
o work your way backwards along the __mro__ until one of them succeeds, but there's probably a more direct way. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex installation on windows XP: step-by-step guide

2006-05-27 Thread greg
ned. There are ways of fixing that, but for various reasons it's usually a bad idea for subsidiary modules to try to import things from the main module of a program. It would be better to move globalvar into a third module. Even better again would probably be not to use a global at all, bu

Re: Edit Python code programmatically

2008-02-10 Thread greg
dits or vice versa. If you really want to generate code, find a way of separating out the generated code into another .py file that never needs to be edited by hand. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Star Wars and parsecs

2008-02-10 Thread greg
nding out how long it takes them to notice they're being fed a load of bull. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: pop langs website ranking

2008-02-11 Thread greg
of view, a *low* hit rate on the Python web site could be seen as a good sign. :-) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-10 Thread greg
hing. So to get back to the original topic, it doesn't really matter whether you talk about light travelling or propagating. Take your pick. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Turn off ZeroDivisionError?

2008-02-10 Thread greg
division traps turned on, and when one occurs, consult the state to determine whether to raise an exception or re-try that operation with trapping turned off. That would only incur the overhead of changing the hardware setting when a zero division occurs, which presumably is a relatively rare occurre

Re: Turn off ZeroDivisionError?

2008-02-10 Thread greg
real division // --> mathematical integer division /// --> IEEE floating point division (where supported) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Difficulty with "inconsistent use of tabs and spaces in indentation" in file called

2008-02-12 Thread greg
rs in the code it's trying to compile! -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: mmap and shared memory

2008-02-12 Thread greg
, if one process is forked from the other, the parent can mmap an anonymous block and the child will inherit that mapping. (I suppose if both processes had sufficient privileges they could map physical memory out of /dev/mem, but that would be *really* dangerous!) -- Greg -- http://mail.python.o

Re: OT: Speed of light [was Re: Why not a Python compiler?]

2008-02-12 Thread greg
#x27;s correct. E.g. they will likely expect a 2kg hammer to fall to the floor twice as fast as a 1kg hammer, which isn't anywhere near to being true. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Speed of light

2008-02-13 Thread greg
you'd think that rocket engineers, of all people, would be acutely aware of the need to avoid confusing force and mass! -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Solve a Debate

2008-02-17 Thread greg
pletely different. E.g. in C, if you can describe the table entirely with static data, it'll be very fast to load and incur no overhead for code to create it at all. Also, with demand-paging out of the executable file, and infrequent lookups, only parts of the table will actually get loaded

Re: Python Memory Manager

2008-02-17 Thread greg
block of memory, that can be moved when its size changes. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Memory Manager

2008-02-17 Thread greg
pes such as tuples also don't need to be on it, even though they contain references, because it's impossible to create a cycle consisting entirely of such objects. There has to be at least one mutable object in the cycle, and the GC will be able to find the cycle via that object. --

Creating dynamic objects with dynamic constructor args

2008-03-25 Thread Greg
ed to the argument list rather than passed as a single object? ie. class T: def __init__(self, foo, bar): self.foo = foo self.bar = bar argspec = inspect.argspec(T.__init__) args = (1, 2) ??? how do you call T(args)? Thanks. Greg -- http://mail.pytho

Re: Can my own objects support tuple unpacking?

2008-03-28 Thread greg
pped') # The secret -- run out. Another way is to make your object iterable -- read up about the "iterator protocol". -- Greg -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >