r
both, or either requiring or foregoing hashable keys (with different
implementations). If such differences are warranted by use cases, it's
better to have several different types than one complicated one. I
would personally suggest mimicking dict's semantic: require hashable
keys, make no copies.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ot;threshold". You may want to look at the allclose function in the
Numeric extension package, at least for its specs (it consider both
absolute and relative difference). Extension module gmpy might also
help, since its mpf floating numbers implement a fast reldiff (relative
difference) metho
.
If you have a function f and want to make an instancemethod out of it,
you can simply call f.__get__(theinstance, theclass) and that will build
and return the new instancemethod you require.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Cameron Laird <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Alex Martelli <[EMAIL PROTECTED]> wrote:
> .
> >Note also that you can freely download all of the code in my book as
> >http://examples.oreilly.com/pythonian/
: pass
...
>>> def f(self): print self
...
>>> o=old()
>>> o.z = f.__get__(o, old)
>>> o.z
>
>>>
There's a million reason to avoid using old-style classes in new code,
but it doesn't seem to me that this is one of them. What am I missing?
Alex
--
http://mail.python.org/mailman/listinfo/python-list
es, but that
looks rather less important. So, "cryptic" apart (an issue on which one
could debate endlessly -- I'd argue that descriptors should be well
familiar by the time one starts generating methods on the fly;-),
calling MethodType does cover a wider range of uses.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
nterface, e.g.
PyObject_CallFunction(B, NULL) if you want to pass no arguments - this
works for A, for B, and for any other callable including e.g. a factory
function (its very generality makes it very desirable...).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
in the real world, situation
that it's false, ..."), but to Aristotle's logic, if something MUST be
true, it's obviously irrelevant whatever might follow if that something
were instead to be false.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
's just that
currently using [ ] on the left of an equal sign is OK, while using them
in a function's signature is a syntax error. No doubt that part of the
syntax could be modified (expanded), I imagine that nothing bad would
follow as a consequence.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
pass lists as arguments to
functions (if the functions receives arguments with *args, there you are
again: args is a then tuple with mutable containers in it), use
statements such as:
return 1, 2, [x+1 for x in wah]
which also build such tuples, and so on, and so forth... tuples get
created p
Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] (Alex Martelli) writes:
> > A is oldstyle -- a wart existing for backwards compatibility.
>
> I think it's time for "from __future__ import newclasses" since
> I hate having to type "c
Cameron Laird <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Alex Martelli <[EMAIL PROTECTED]> wrote:
> .
> >Yeah, O'Reilly tools have this delightful penchant for inserting a space
> >between two adjacent undersco
x27;s __dict__, without even checking for the existence of a
descriptor by that name in the class.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Deep <[EMAIL PROTECTED]> wrote:
> yes that works.
> but, it gives one list, which contains everything.
> now about inferring types? :)
You may want to look at module inspect in the standard library.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ity in the standard library
(for this clarification as well as, sometimes, helping the readability
of some user code).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ld then
work (but in 2.4 you do need to more explicitly use some kind of
decorate-sort-undecorate idiom, as explained in previous posts).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
h I can do even if both my instances
So you'd have to make your class non-subclassable -- easy to do when
you're implementing a type in C, or with a custom metaclass. I guess
that's the motivation behind "final" classes in Java, btw -- arguably
one of the worst enabler
2-bit addressing, on suitable CPUs; the OS's VM
implementation (and of course the CPU) essentially dominate this
"problem space".
Alex
--
http://mail.python.org/mailman/listinfo/python-list
t, key=f) to express
this intent exactly -- that's precisely what 'key=' means.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
treated as a scalar, yet it responds to len(...), so
you'd have to specialcase it.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Harlin Seritt <[EMAIL PROTECTED]> wrote:
> Is there a function that allows one to get the name of the same script
> running returned as a string?
Something like:
import sys
def f():
return sys.modules['__main__'].__file__
might help.
Alex
--
http://mail.python.org/m
r your
parenthetical note, but rather as a sequence, since it does respond
correctly to len(...). You may need to specialcase with checks on
something like isinstance(x,basestring) if you want to treat strings as
scalars.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Dustan <[EMAIL PROTECTED]> wrote:
> How can I get a number into scientific notation? I have a preference
> for the format '1 E 50' (as an example), but if it's well known, it
> works.
You mean something like:
>>> print '%e' % (1e50)
1.00e+5
ers OUTSIDE that range, as in:
>>> print '%g' % 10**5
10
>>> print '%g' % 10**50
1e+50
Alex
--
http://mail.python.org/mailman/listinfo/python-list
> contains non-reproducable data and the two timeit calls
> must be run on identical objects.
You have to use 'from __main__ import data as x' rather than just say
'global data; x=data', because timeit is a separate module from your
__main__ one.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ntical, then the suggestion (already
given in another post) to invert dict2 is a good idea, i.e., as a
function:
def PWmerge(d1, d2):
invd = dict((v2, k2) for k2, v2 in d2.iteritems())
return dict((k1,invd[v1]) for k1,v1 in d1.iteritems())
but without all of the above assurances, different
is
simplification work, and similarly for the further ones you show:
> Which is (in turn) equivalent to:
>memoize = Memoize
>
> So you can just use
> @Memoize
> def function (
Alex
--
http://mail.python.org/mailman/listinfo/python-list
On 6 Dec 2005, at 04:55, Xah Lee wrote:
> i had the pleasure to read the PHP's manual today.
>
> http://www.php.net/manual/en/
To be fair, the PHP manual is pretty good most of the time. I mean,
just imagine trying to use PHP *without* the manual?! It's not like
the language is even vaguely
Test, w/Python 2.4.2 on Mac OS 10.4.
Can you please supply a minimal complete example, e.g. simplifying
function logthemethod to just emit s/thing to stdout etc, that does
exhibit the runaway recursion problem you observe?
Alex
--
http://mail.python.org/mailman/listinfo/python-list
u'll have
a string -- if what you want is a float, call e.g. float(astring[1:5]);
or for a decimal number, decimal.Decimal(astring[1:5]) (after importing
module decimal from Python's standard library); and so on.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
essfully use the uu to
> encode/decode strings of varying length (even larger strings, more than
> a few hundred characters)?
Definitely not, given the above limit. But I still don't quite
understand the exact mechanics of the error you're getting.
Alex
--
http://mail.python
eat writers too, but, I would guess, just roughly the
same percentage as in the general popularion (i.e., deucedly few).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
, except
that matching indentation may be somewhat easier. You can find many vim
programming tips at www.vim.org much more easily than in this group (you
CAN program vim with Python if you wish, rather than having to use vim's
own scripting language, but for that you need to buil
". Many
programmers fall into the temptation to overgeneralize and fail to
follow the AGNI principle ("Ain't Gonna Need It"...;-).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
r, blindly, as
you're trying to to here. Each character in the source string can be
encoded into multiple characters in the target string, and the slicing,
if slicing is needed, must be appropriate. I suggest a redesign...!
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ny -- me, I prefer to steer away from companies with lots of
bureaucracy, instead!-)
Alex
--
http://mail.python.org/mailman/listinfo/python-list
o) is recommended when you aren't sure what
type you're dealing with in 'foo', but want a dict as a result.
If you're certain you're dealing with a dict, then, if this code is
critical for your app's performance, pick the fastest way. Use timeit
to find the fast
...Java being probably the most popular example...
Alex
--
http://mail.python.org/mailman/listinfo/python-list
he half of the boilerplate that goes getThis,
getThat in typical Java...
Alex
--
http://mail.python.org/mailman/listinfo/python-list
py <[EMAIL PROTECTED]> wrote:
> Alex Martelli wrote:
> I suggest a redesign...!
>
>
> What would you suggest? I have to encode/decode in chunks b/c of the
> 45 byte limitation.
Not quite:
>>> s=45*'v'
>>> a=binascii.b2a_uu(s)
>>> l
Mike Meyer <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] (Alex Martelli) writes:
> > Mike Meyer <[EMAIL PROTECTED]> wrote:
> >> My standard object interface is modeled after Meyer's presentation in
> >> OOSC: an objects state is manipulated wi
py <[EMAIL PROTECTED]> wrote:
> Thanks...I think base64 will work just fine...and doesnt seem to have
> 45 byte limitations, etc.
Sure, base64 is a better encoding by all criteria, unless you
specifically need to use uu encoding for compatibility with other old
software.
A
, which have their own problems.
Fortunately, for most of my work, I do get to use Python, Objective-C,
or Haskell, which, albeit in very different ways, are all "purer" (able
to stick to their principles)...
Alex
--
http://mail.python.org/mailman/listinfo/python-list
rst+1, depth+1, lim, False, *args):
yield x
if first <= depth:
for x in do_deeply(first+1, depth, lim, True, *args + (first,)):
yield x
elif doit:
yield args
to be used with
for x in do_deeply(first=1, depth=3, lim=4):
do_something(*x)
Did I guess right...?
Alex
--
http://mail.python.org/mailman/listinfo/python-list
t has to give in and deviate from it's
> principles. Clearly, you don't agree with the underlying
> philosoiphy. So don't use it.
I don't, but I also occasionally take the time to explain, as I've done
here, where it (or, in this case, a specific style you claim it requires
-- not using attributes of attributes in a class invariant -- I'd
appreciate URLs to where Meyers dictates this restriction, btw)
interferes with purity, practicality, or both.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] (Alex Martelli) writes:
> > Well, Google's market capitalization must be around 50 billion dollars
> > or more, in the range of the top-100 companies, I believe, and they've
> > never kept their
is shows that staticmethod has slightly wider applicability, yes, but
I don't see this as a problem. IOW, I see no real use cases where it's
important that hasattr(C, 'plural') is false while hasattr(C(),
'plural') is true [I could of course be missing something!].
Alex
--
http://mail.python.org/mailman/listinfo/python-list
while True: yield sys._getframe(2).f_locals['args']
>
> args = args()
>
> foo = fn(a + b * c for (a,b,c) in args)
> assert foo(3,4,5) == 3+4*5
> assert foo(4,5,6) == 4+5*6
Paul, you really SHOULD have posted this BEFORE I had to send in the
files for the 2nd ed'
thon doesn't perform
strength reduction. Taking a trivial example (everything is slow since
I'm using a laptop in lowpower mode, but the ratio is meaningful):
kallisti:/tmp alex$ /usr/bin/python timeit.py -s'import Numeric;
xs=Numeric.ones(999); sum=Numeric.sum' 'sum(xs*x
commercial licenses for Qt
use from Python only (i.e. if you didn't care to write C++ code for it
anyway) was to purchase BlackAdder -- a usable IDE by itself, btw,
though no doubt not as powerful in debugging as WingIDE. I haven't
recently checked whether that is still true, however.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
I toolkit today, rather than having wx and Tk vie for the crown (with
GTK as a somewhat-distant third, it appears to me, and Qt nowhere in
sight because "it ain't free for Windows"). But really, there hasn't
been anything murky about it for _years_... take it or leave it, it
very nice recipe (not sure he posted it to the site as
well as submitting it for the printed edition, but, lobby _HIM_ about
that;-).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ass; you *have* to have a
> metaclass with a data descriptor in order to prevent a __dict__ lookup
> on the class itself.
Well, that's another ball of wax. Does Java support that kind of
overloading...?! Eeek. I believe C++ doesn't and for once is simpler
thereby.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard <[EMAIL PROTECTED]> wrote:
> Does that seem about right?
Yep!
> P.S. That's so *evilly* cool!
We should have an Evilly Cool Hack of the Year, and I nominate Paul du
Bois's one as the winner for 2004. Do I hear any second...?
Alex
--
http://mail.pytho
Brian van den Broek <[EMAIL PROTECTED]> wrote:
...
> > Have you heard of Villanova, often named as the birthplace of Italian
> > civilization? That's about 15 km away, where I generally go for major
> > grocery shopping at a hypermarket when I _do_
x27;, (dict,), dict(badger=True)))
> py> d['c'].spam
> 42
> py> d['c']()
> <__main__.C object at 0x063F2DD0>
Well then, just call new.function to similarly create functions as part
of an expression, hm? Passing the bytecode in as a string isn't
incredibly legible, OK, but, we've seen worse...;-)
Alex
--
http://mail.python.org/mailman/listinfo/python-list
e should get rid of
> lambda ;-)
Yes but... we DO have a few real use cases for functions, which we don't
really have for modules and classes, _and_ making the *contents* of a
function object is harder too...:-(
Alex
--
http://mail.python.org/mailman/listinfo/python-list
e __new__'s signature and yet
fully support pickling... on the other hand, when you're overriding
__new__ you ARE messing with some rather deep infrastructure,
particularly if you alter its signature so that it doesn't accept
"normal" calls any more, so it's not _absurd_ that compensatory depth of
understanding is required;-).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
this special case.
> >
> And you'd create an anonymous type how, exactly?
>>> type('',(),{})
maybe...?
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ype
adds zero complexity or issues to the language: it's basically zero
cost, just like the ability to call 'int' to make an int, and so on.
This can't be said of lambda, alas: it has a non-zero cost in terms of
(slightly) 'fattening' the language.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
therwise pls provide a URL: the info is wrong and I'll try to get it
fixed -- thanks!). DictMixin's purpose is exactly as you state: letting
you make a complete mapping class out of one which only supplies the
very basics, by mix-in inheritance.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
write whole games in Python", and
besides PyGame also points you to PyKira, "a fast game development
framework for Python" (which) "also supports MPEG video, sound (MP3, Ogg
Vorbis, Wav and Multichannel module files), direct images reading and
much more". Etc, etc, ...!!!
How much
printed Cookbook, showing how to do
that the right way -- with __setattr__ -- rather than with __slots__ .
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ng sub-field of
(quite-standard, by now) economics.
There are quite a few other sub-fields of economics where agency
problems, and specifically the ones connected with risk avoidance, have
far stronger explicatory power. So, I disagree with your choice of
example.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
URL that way).
You should use 'file' when you're subclassing, or in other situations
where you want to be sure you're naming a type, not a function (few good
cases come to mind, but maybe isinstance is a possible case, although
likely not _good_...;-).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
re.
Assuming we're talking Mac OS X 10.3 or later, Python itself comes with
the operating system (it's used somewhere in stuff provided with the
system, such as fax handling). As I saw others suggest, google for
py2app, it's probably the best way to handle this for the Mac to
tin are the
two authors I would suggest reading. Lakos' book is old, and among his
major concerns is using just the subset of C++ you could rely on, years
ago; you can probably ignore those issues safely today (to use Boost,
you need a good recent C++ compiler with impeccable template support,
anyway, for example).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
whether said 2nd
country is China, Russia, "Europe" [not a country, I know;-)], ...).
TVs and other displays are sold as "20 inches" (or whatever) everywhere,
printers' resolutions are always given in pixels per inch, etc.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
akt
(www.strakt.com). Of course, the web-based presentation layer will be
generally simpler/poorer than ones based on richer GUI toolkits -- as a
compensation, it may more easily be "skinnable" by using CSS and the
like, and it's way more easily _testable_ thanks to many good
find and
read the obvious documents and somehow STILL manage to completely ignore
their contents or read them as saying exactly the opposite of what they
_do_ say...
Alex
--
http://mail.python.org/mailman/listinfo/python-list
9 u'John Nielsen'
4: 8 u'Raymond Hettinger'
5: 8 u'J\x9frgen Hermann'
6: 6 u'S\x8ebastien Keim'
7: 6 u'Peter Cogolo'
8: 6 u'Anna Martelli Ravenscroft'
9: 5 u'Scott David Daniels'
10: 5 u'Paul Prescod'
11: 5 u'Michele Simionato'
12: 5 u'Mark Nenadov'
13: 5 u'Jeff Bauer'
14: 5 u'Brent Burley'
...but each still gets ONE free copy...!-)
Alex
--
http://mail.python.org/mailman/listinfo/python-list
merged into the standard core. Many people contributing to
such innovative projects are also Python core committers, of course.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Premshree Pillai <[EMAIL PROTECTED]> wrote:
> Do contributors of less than 5 recipes get a copy too? :-?
Of course!
> Btw, is there a comprehensive list of ALL contributors put up anywhere?
Not yet -- do you think I should put it up on my website?
Alex
--
http://mail.python
se is by now totally secondary, to me,
to the main issue that I find your approach to explaining regional
clustering problems across industries totally, irredeemably, and
horribly WRONG. So, I'm not going to make the post even longer by even
trying to address this part. Few, besides the two of
large, and M is MUCH smaller than N, SHOULD,
pragmatically, make some memory available for other uses (as opposed to
leaving it all in the block allocated for x) -- the kind of things that
don't get into formalized standards because handwaving is disliked
there, but can make a programmer's life miserable nevertheless (as this
very issue does with today's Python, which relies on these pragmatics in
a spot or two, and MacOSX' standard C library, which ignores them...).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Premshree Pillai <[EMAIL PROTECTED]> wrote:
> On Wed, 5 Jan 2005 08:55:39 +0100, Alex Martelli <[EMAIL PROTECTED]> wrote:
> > Premshree Pillai <[EMAIL PROTECTED]> wrote:
> > > Do contributors of less than 5 recipes get a copy too? :-?
> > Of course!
>
Roman Suzi <[EMAIL PROTECTED]> wrote:
> Alex, I think you are +10 for adding interfaces into Python. "Concept"
> is more compact word and I am sure it is not used as a name in existing
> projects, unlike other words.
Actually, I want protocols -- semantics (and pragmati
Dan Perl <[EMAIL PROTECTED]> wrote:
> "Alex Martelli" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Premshree Pillai <[EMAIL PROTECTED]> wrote:
> >> Btw, is there a comprehensive list of ALL contributors put up anywhere?
>
ADO, which do manage good plug&play of
their components but still can't solve the real hard one:-(
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern <[EMAIL PROTECTED]> wrote:
...
> >> I love eric3, but if you're an eclipse fan, look at enthought's
> >> "envisage" IDE -- it seems to me that it has superb promise.
...
> > Is it available for download somewhere?
>
> Alex
wards may be interestingly compared with Luther Blissett's
"Q", and so forth, and I'm sure you can design a perfectly adequate
conspiracy theory.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
the code *at all*"? I think it's
a pretty common arrangement when the code being sold under closed-source
terms is a set of libraries, or a development system part of whose value
is a set of accompanying libraries.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
e restrictive clause, such
as "no military use", "no use by organizations which perform testing of
cosmetics on animals", or something of that kind. These would be
examples of closed-source software which DO allow ALMOST any kind of use
-- any EXCEPT the specific one the author
kslashes for escape sequences in strings), you'd have exactly the
same issues.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
ditors are cat equivalent[*], you don't _have_
> > to use any of their features :-)
>
> This "cat equivalent" thing is a red-herring. I can rarely type more
I tried offering a red herring to my cat to check this out, and, sure
enough, she indignantly refused it
Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] (Alex Martelli) writes:
> > Yes, apart from libraries and similar cases (frameworks etc), it's no
> > doubt rare for closed-source "end-user packages" to be sold with
> > licenses that in
icenses, just pointing out
that such distinctions are not currently reflected in a popular
definition. Since it's a wiki, it may be worthwhile editing it to add
some materials to start influencing popular usage and perception, maybe.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
uot;no forking"'', nor can any other
open-source license.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
hich copies no GPL
source cannot be infected by GPL, ah well -- then I guess GPL is badly
designed as to putting its intents into practice. But until there is
some strong basis to think otherwise, I believe it's prudent to assume
RMS is probably right, and your statement therefore badly wrong.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
el about (being able reduce any open covering of X to a
finite subcovering) <-> (X is compact) ...?
Alex
--
http://mail.python.org/mailman/listinfo/python-list
sh or tcsh on, ...), though it's no doubt still missing many pieces
that you or I might want as parts of *our* "everything" (gvim rather
than just vim, GUI/IDEs for Python, Python add-ons such as numarray,
gmpy, ctypes, ...) -- all of those you still have to download and
install, ju
irst hard disk was 5 or 10 megs.) A
Here I suspect you do mean megs -- 5 and 10 megs were indeed the sizes
of the first affordable "winchester" hard-disks 20/25 years ago.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
esign intent of Python, Python
does give you enough rope to shoot yourself in the foot:
import sys
reload(sys)
and now, after reloading, sys.setdefaultencoding will be there anew.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
object is called; while default argument values are evaluated *at
function creation time* (when lambda or def executes, not when the
resulting function object gets called).
Alex
--
http://mail.python.org/mailman/listinfo/python-list
e Linux kernel to be distributed with, say, gimp... anybody's
free to make a distribution including several components, but it's best
for the various components, including the core ones, to stay separate.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
"if a==b: print a, b", rather than
roughly the same as:
a = b
print a, b
I wonder if 'with', which GvR is already on record as wanting to
introduce in 3.0, might not be overloaded instead.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
the decorator to be an oracle for the future, but are content to limit
it to information known when it runs; and as long as you don't care how
much you slow everything down) and most definitely not WORTH doing for
anything except mental gym.
Alex
--
http://mail.python.org/mailman/listinfo/python-list
Nick Coghlan <[EMAIL PROTECTED]> wrote:
> Alex Martelli wrote:
> > I wonder if 'with', which GvR is already on record as wanting to
> > introduce in 3.0, might not be overloaded instead.
>
> Perhaps we could steal 'using' from the rejected decor
ce members, just skip the op.arg cases which are less
than code.co_argcount -- those are the parameters.
> > Alex Martelli:
> > A decorator can entirely rewrite the bytecode (and more) of the method
> > it's munging, so it can do essentially anything that is doable on the
>
harold fellermann <[EMAIL PROTECTED]> wrote:
...
> But, I cannot
> even find out a way to set the doc string, when I CREATE a class using
> type(name,bases,dict) ... At least this should be possible, IMHO.
>>> x=type('x',(),dict(__doc__='hi there'
501 - 600 of 2602 matches
Mail list logo