-readable form. It is appropriate to call
> such a program a script. If the first two characters is "#!"
> and the execution bit is set, it is a script in the linux sense.
>
> So as far as I can tell it boils down to a clear technical
> distinction, and I'm sure they didn't mean offence.
Java doesn't compile to ELF binaries, last time I checked.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
xplain why the code which does more work
> > takes less time?
>
> > --
> > Steven
>
> The code that does more work takes more time. The second one does
> quite a bit less work. Think of it like this:
>
> You have 500,000 people to fit through a door. He
ly the true/false test only works for certain set of expected
values that I have in my mind. When the acceptable values are
generalized, when you want to expand this function's role, does the
true/false test still work? I find it rarely does.
The Python treatment of booleans is, by far, my biggest gripe with
Python. (Which, you know, is a pretty good thing to have as a biggest
gripe.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
tainly it wouldn't be
possible if Python treated bools according to my preference.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
od choice.
But if you're at that stage you probably were doing something wrong in
the first place.
For a list of any decent size a few insertions using a bisection
algorithm will take fewer comparisons than a single bubblesort pass.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 9, 4:37 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Feb 8, 10:09 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> >> If you expect your data to be pretty nearly sorted
> >> already, but you just want to make sure (e.g. because a
with divide by zero?
I understand your pain, but Python, like any good general-purpose
language, is a compromise. For the vast majority of programming,
division by zero is a mistake and not merely a degenerate case, so
Python decided to treat it like one.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
broken in the special
> case of division by zero.
Do you recall what the very next Zen after "Special cases aren't
special enough to break the rules" is?
that's-why-they-call-it-Zen-ly yr's,
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
%s not found" % value)
As an added bonus, you get a more useful error message if it's not
there (I know what you said, but bugs happen). If it's too bulky for
you, put it into its own function and call it.
> Can't You first convert the tuple of tuples in a dict, and the
om a particular user?
>
> > Regards,
> > Marek
>
> In essence what I'm doing is trying to manage tickets for a helpdesk.
> I want the ticket identifier to be short enough to fit in the subject
> line along with the normal subject chosen by the user. So
> cryptograp
p the OS
could still write that memory to swap space, which, if your swap space
is fixed and limited, might negatively affect performance for the rest
of the system.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 12, 1:05 pm, [EMAIL PROTECTED] wrote:
> What is dream hardware for the Python interpreter?
A 10 GHz single core.
(Dual core if doing lots of I/O.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
lass(cls):
try:
modname = cls.__module__
except AttributeError:
return False
try:
mod = sys.modules[modname]
except KeyError:
return False
try:
filename = mod.__file__
except AttributeError:
return False
return filename.endswith('.pyc')
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
t I did - I made the release
> candidate available to the public.
>
> So is the subject incorrect as well? If so, what should it say?
I think it's fine as it is. You can "release" a release candidate.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
eed to do some preliminary calculations in Python (where there's no
edit/compile/run cycle but there is slicing and array ops), but want
the same floating point behavior.
IEEE conformance is not an unreasonable thing to ask for, and "you
should be using something else" isn't a good answer to "why not?".
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
garlic, that suddenly turns into
> >>>>> Sylvester Stallone in a tutu just before my program returns its result.
> >>>> IHNTA, IJWTSA
> >>> IJWTW? Anyone set up to profile CPython?... or step through?
> >> I give up. Is there a
occasional special purpose uses, but for most
cases they're at best marginally better then floats and more often
incomparably worse.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
re, or off list, or on #python or #chipy.
Carl K
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 16, 5:51 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote:
> >> Although rationals have its limitations too, it is a much
> >> better choice compared to floats/Decimals for most case
On Feb 16, 5:51 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote:
> >> Although rationals have its limitations too, it is a much
> >> better choice compared to floats/Decimals for most case
On Feb 16, 7:54 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Feb 16, 5:51 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> >> Carl Banks wrote:
> >>> On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote:
> >>>
Ok, that post was somewhat bleck.
Here is a much better version: http://chipy.org/V4l2forPyCon
Carl K
--
http://mail.python.org/mailman/listinfo/python-list
nd subtraction would only grow the denominator up to
> a certain limit
I said repeated additions and divisions.
Anyways, addition and subtraction can increase the denominator a lot
if for some reason you are inputing numbers with many different
denominators.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
type-checked language, which means it is
totally safer for newbies than Python. Yep, your big company is
totally safe with newbie C++ programmers.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
in __dict__, is this the only
> way of doing it?
OrderedDict is usually the term used here for this (not to be confused
with SortedDict, which is a mapping type with identically sorted
keys). It's asked for pretty often but no one's stepped up to
implement one for the standard library.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
a downside: it's at least a wash.
In C++ you manage memory and the language manages resources. In
Python you manage resources and the language manages memory.
RAII is merely one way of minimizing complexity. Garbage collection
is another way.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 21, 7:17 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote:
> >> There are other downsides to garbage collection, as the fact that it
> >> makes it harder t
all I was really saying is that there are far more more important
things when it comes to "safety" than dynamic typing.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 22, 12:23 am, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> Carl Banks wrote:
> > On Feb 21, 7:17 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> >> Carl Banks wrote:
> >>> On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote:
> >>&
if m where m = re.match(r"name=(.*)",line):
name = m.group(1).strip()
elif m where m = re.match(r"id=(.*)",line):
id = m.group(1).strip()
elif m where m = re.match(r"phone=(.*)",line):
phone = m.group(1).strip()
This won't happen because the set-a
e(m):
phone = m.group(1).strip()
This decorator might be more to the point:
def call_if_match(regexp):
m = re.match(regexp)
if m:
return lambda func: func(m)
return lambda func: None
These have the drawback of being a little dense, and the functions
can't rebind v
On Feb 22, 9:58 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 22 Feb 2008 00:45:59 -0800, Carl Banks wrote:
> > On Feb 21, 6:52 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> >> mrstephengross wrote:
> >> >> What y
d things about C++ and various features that C++ implements. If you
try to defend C++ every time that happens, you won't last long here.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 24, 12:32 pm, Lie <[EMAIL PROTECTED]> wrote:
> On Feb 18, 1:25 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > On Feb 17, 1:45 pm, Lie <[EMAIL PROTECTED]> wrote:
>
> > > > Any iteration with repeated divisions and additions can thus run the
>
ing numerical integration sometime with rationals, and tell me
how that works out. Try calculating compound interest and storing
results for 1000 customers every month, and compare the size of your
database before and after.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 25, 2:04 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> Carl Banks <[EMAIL PROTECTED]> writes:
> > Try doing numerical integration sometime with rationals, and tell me
> > how that works out. Try calculating compound interest and storing
> > results fo
uessed it--more effort.
Deterministic destruction would be a great thing if it weren't for all
the drawbacks. Until then I will choose the path of lesser effort by
letting GC take care of memory, closing my own files, and having lots
of expressive power and freedom.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
return _fun_A1(x,y,z)
def _fun_A(x,y,z):
# you know x is of type A
def _fun_A1(x,y,z):
# you know x is of type A1
class B1(B):
def _fun_A(x,y,z):
# overrides B._fun_A
In other words, subclasses only override _fun_type variants. fun is
left alone. Extend idea as needed for your needs.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ations for the productivity increase.
The productivity increase of the language appears to me as a more
likely explanation for the number of libraries you get "out of the
box".
:)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 25, 9:41 am, Mensanator <[EMAIL PROTECTED]> wrote:
> On Feb 25, 12:58�am, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Feb 24, 10:56 pm, Mensanator <[EMAIL PROTECTED]> wrote:
>
> > > But that doesn't mean they become less manageable
etattr__(self,attrname)
if hasattr(attr,"__call__"):
wrapper = self.thobject._wrapper_function
return functools.partial(wrapper,self.parent,attr)
return attr
clsdict = { '__init__': init,
'__getattribute__': getattribute }
return type(name,(base,),clsdict)
That's some pretty advanced stuff you're doing there, chief. My
examples probably wouldn't work out of the box, but hopefully it'll
give you enough ideas to do it.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ly
> disappointing Lisp "successor", Arc, amongst the usual in-fighting and
> parade-dampening.
It looks like his main contribution was to get rid of superfluous
parentheses. Which, admittedly, is no small thing for Lisp.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
er returned 0.75 in any language I would drop that language.
Have fun dropping Python, then, chief. Integer division with / is
already deprecated, can be disabled ever since Python 2.4, and will be
wholly removed in Python 3.0.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
that the library wasn't trying to be
helpful and was just indicriminately letting side effects loose.
Shame on the writer in any case.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
e at
the time". Nobody would have come up with a silly rule like "x op y
must always have the same type as x and y" if computer hardware had
been up to the task when these languages were created.
>Very simple rule, used by very many traditional >programming languages.
On Feb 28, 9:36 am, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2008-02-28, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> >> Automatic conversions, okay... but converting a result when
> >> all inputs are of one time, NO...
>
> > People, this i
an. Please do me a personal favor:
Personal favor? Seriously, do you have stock in a C++ support company
or something? There's no need to take stuff like this personally.
> Don't
> hold the crappy course against C++.
C++ has so much badness to hold against it, there's no nee
ldn't be automatically ported to 3.0, then it was a big
strike against the proposal. That it could end up being a useful
transitional tool is nice, but it never seemed to be its primary
purpose.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
gt; ## 4349 2029 None
> ## 6703 8677 None
> ## 1879 1867 None
> ## 5153 5279 None
> ## 2011 4937 None
> ## 7253 5507 None
>
> This makes sympy worse than worthless, as it f***s up other modules.
Dude, relax.
It's just a bug--probably sympy is messing with the internals
d more common.
Newbies who aren't being alerted to this are getting a raw deal.
Thankfully old-style classes are getting the axe in Python 3.0 and
hopefully this confusion will go away.
Until you switch to 3.0, inherit your base classes from object; it
will ensure that more recent additions like properties and super()
calls work.
class Node(object):
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
e
most common arguments, and use classmethods for more obscure, less
common arguments (such as decimal or even float).
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 3, 4:47 pm, Mensanator <[EMAIL PROTECTED]> wrote:
> On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote:
>
> > > Notice anything funny about the "random" ch
On Mar 3, 7:24 pm, Mensanator <[EMAIL PROTECTED]> wrote:
> On Mar 3, 4:53 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Mar 3, 4:47 pm, Mensanator <[EMAIL PROTECTED]> wrote:
>
> > > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]>
ge(3):
if a == i:
do_task[a]()
else:
do_default_task()
(Please never mind the trivialness of this example; I know you can
eliminate the for loop altogether; this is JUST an example.)
I keep this analogy in mind when using for...else to keep the
semantics straight.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 4, 10:55 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
> On Tue, Mar 4, 2008 at 4:17 PM, Carl Banks <[EMAIL PROTECTED]> wrote:
> > > for ...:
> > > ...
> > > exhausted:
> > > ...
> > > broken:
> > &
s:
>>>import module
>>>c1 = module.Someclass
>>>module.Someclass = some_other_class()
>>>c2 = module.Someclass
>>>c1 is c2
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
cent news filter should be able not only kill a poster, but also
all followups to that poster recursively.
(No, I don't know of any that do that either.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
sure what you mean. Are you talking about the post subject
> > line (which I have never touched in any post)? If you're talking about
> > the OP's email address, that's Google's fault for cropping them.
>
> I'm talking about castironpi. I find his posts a waste of my time
"His" posts?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 6, 11:41 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote:
> On Thu, 6 Mar 2008 08:00:58 -0800 (PST)
>
> Carl Banks <[EMAIL PROTECTED]> wrote:
> > > I'm talking about castironpi. I find his posts a waste of my time
>
> > "His
you want to evaluate (locals()
could be a good choice for this).
Standard warning about usage of eval: don't use this with untrusted
input or Bad Things can happen.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
have to do is call it from
Python using subprocess module and you're set. (DO NOT use os.system
for this since it starts a shell process, which is unnecessarily slow,
and dangerous when passed user input.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
or more y's
> #for each y:
> q.put(y)
Why not just do it like that? With a few changes it'll work fine:
while q:
x = q.pop(0)
for y in process(x):
q.append(y)
And consider collections.deque for q instead of a list, though it
shouldn't make much of a
if some_other_break_condition:
break
else:
completed = False
if not completed:
It felt icky but we're all still here so it couldn't have been that
bad.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
000
> >>> y=1000
> >>> x is y
> False
>
> If either is a surprise, then understand that the "is" operator should
> probably *never* be used with immutable types.
Not quite: None is immutable but it's usually recommended to test for
it using is.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
orked well as a
cross-platform solution for me. The interfacing is the main
drawback. It's always a bit of effort to interface things, and to get
it working on multiple platforms, but I thought it was worth it.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
PyGame would be a
good way to make a cross-platform "text-mode" game. It should be
pretty straightforward to simulate a text mode terminal using a grid
of sprites. (There might even be some third-party text terminals out
there.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
g else.
Want to tell us what you need it for? Perhaps we can suggest a way of
doing it that's appropriate in Python.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
h a better one. Instead of the cmp
methods above, use the key method. Instead of __cmp__ method for
overriding object operators, use the rich comparison methods: __lt__,
__gt__, and so on.
Python 2.x currently implements both cmp and rich comparisons at the
same time, but that creates a lot
ome
magic variables that affected Perl's compilation and couldn't do it
without a magic block that executed at compile time.
Python solved a similar problem by introducing __future__ imports.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
the top, before the function
definitions, to clearly show to a human reader what is necessary to
run the script.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
return cmp_fn(self.obj, other.obj)
> > return CmpWrapper
>
> Apparently I'm overlooking something obvious ...
>
> how is this supposed to work if __cmp__ is no longer
>
> being called? (Which was my understanding.)
It won't. In Python 3.0 you'd
e relevant.
>
> It's easy to fix in SGMLlib. It's just necessary to change
>
> except AttributeError:
> to
> except AttributeError, UnicodeEncodeError:
>
> in four places. I suppose I'll have to submit a patch.
FWIW, the stated goal of sgmllib is to parse the subset of SGML that
HTML uses. There are no non-ascii elements in HTML, so I'm not
certain this would be considered a bug in sgmllib.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 14, 6:37 pm, Alex <[EMAIL PROTECTED]> wrote:
> On Mar 13, 6:21 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
>
> > On Mar 13, 7:02 am, Bruno Desthuilliers
> > [EMAIL PROTECTED]> wrote:
> > > Alex a écrit :
> > > (sni)
>
> > >
em etc..
>
> The goal is not to build a new renderer or something; just a small
> program that I need to do some manipulations in bulk on a set of OBJs
What do you mean by "manipulate". There are lots of ways to
manipulate 3D objects; can you be more specific?
Carl Banks
iment, you can hereby consider it also failed.
He said "aside from the sponsor talks", chief.
You need one of these:
http://tinyurl.com/26owvg
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
being concerned about this organization?
(My only minor suggestion would be not to import the SpecificClass as
BaseClass, but instead with a name that's different from both, for
example, PublicClass. All that does is to avoid a tiny bit of
potential confusion down the road.)
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
nt native types in those "most other oo languages". For instance,
it would be kind of true in Java (for numbers only).
He probably didn't, though, and the idea that most oo languages use
references is questionable.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
else\
_Py_Dealloc((PyObject *)(op))
So, if the reference count goes down to zero, Py_DECREF calls
_Py_Dealloc to delete the object. _Py_Dealloc is the common point you
want.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
x.
I'll also point out that even in C++/Java/etc. you have occasions
where an instance variable doesn't do anything until a something
triggers it. You can look to the constructor to see what it's
initialized to, but it isn't really initialized to anything useful
until some meth
t
conditionally-useful variables are ok but it's evil for them to
conditionally-exist?
The former I don't agree with at all.
If it's the latter, I believe there is something to be said for
variables that exist when they are needed and don't when they're not.
However, I ack
On Jan 11, 5:02 pm, Paul Rubin <http://phr...@nospam.invalid> wrote:
> Carl Banks writes:
> > and where it was manipulated for that matter.
>
> > This criticism is completely unfair. Instance variables have to be
> > manipulated somewhere, and unless your object i
On Jan 11, 5:49 pm, Chris Rebert wrote:
> On Sun, Jan 11, 2009 at 3:15 PM, Carl Banks wrote:
> > On Jan 11, 3:31 pm, Chris Rebert wrote:
> >> On Sun, Jan 11, 2009 at 1:22 PM, Madhusudan.C.S
> >> wrote:
> >> > def somemethod(self, arg1):
> >>
On Jan 11, 5:41 pm, Paul Rubin <http://phr...@nospam.invalid> wrote:
> Carl Banks writes:
> > > The criticism is very valid. Some languages do support immutable
> > > variables (e.g. "final" declarations in Java, "const" in C++, or
> > >
On Jan 11, 6:42 pm, Paul Rubin <http://phr...@nospam.invalid> wrote:
> Carl Banks writes:
> > If so, what is it that's so evil about conditionally-existent
> > variables? (I'll leave the question open-ended this time.)
>
> I have found they make the code
On Jan 9, 6:11 pm, John Machin wrote:
> On Jan 10, 6:58 am, Carl Banks wrote:
>
>
>
> > On Jan 9, 12:36 pm, "J. Cliff Dyer" wrote:
>
> > > On Fri, 2009-01-09 at 13:13 -0500, Steve Holden wrote:
> > > > Aivar Annamaa wrote:
> > > >
On Jan 12, 12:32 am, John Machin wrote:
> On Jan 12, 12:23 pm, Carl Banks wrote:
>
>
>
> > On Jan 9, 6:11 pm, John Machin wrote:
>
> > > On Jan 10, 6:58 am, Carl Banks wrote:
>
> > > > On Jan 9, 12:36 pm, "J. Cliff Dyer" wrote:
>
>
On Jan 12, 5:26 am, John Machin wrote:
> On Jan 12, 7:29 pm, Carl Banks wrote:
>
>
>
> > On Jan 12, 12:32 am, John Machin wrote:
>
> > > On Jan 12, 12:23 pm, Carl Banks wrote:
>
> > > > On Jan 9, 6:11 pm, John Machin wrote:
>
> > >
> | <_sre.SRE_Match object at 0x00FD86B0>
>
> This is "messed him up"?
If you believe in waiting for bugs to occur and then fixing them,
rather than programming to avoid bugs, there is no helping you.
P.S. The "obvious" solution is wrong, although I'm not sure if you
were making some kind of ironic point.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ble annotation. The 1% of the time where I really want to use
> dynamism I don't see any problem with putting in an appropriate
> decorator, superclass, or whatever.
Well, I guess you are the sacrifical lamb so that everyone else can
take advantage of the dynamicism.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 13, 6:45 pm, "Russ P." wrote:
> On Jan 13, 3:07 pm, Carl Banks wrote:
>
> > I've seen no evidence that any Python project is moving even remotely
> > toward data encapsulation. That would be a drastic change. Even if
> > it were only a minor cha
On Jan 13, 9:50 pm, Carl Banks wrote:
> The cultural impact that would have on the
> community is far worse, IMHO, than any short-sighted benefits like
> being able to catch an accidental usage of an internal variable.
> Trust would be replaced by mistrust, and programming in Pytho
apsulation in sight on any system I worked on.
In fact, our engine simulation was a special-purpose object-oriented
language with--get this--no private variables. Some other systems I
worked on didn't even use scoping, let alone encapsulation.
Looks like my anecdote cancels out yours! Go
On Jan 14, 1:40 am, Steven D'Aprano
wrote:
> On Tue, 13 Jan 2009 20:17:08 -0800, Carl Banks wrote:
> > On Jan 13, 9:50 pm, Carl Banks wrote:
> >> The cultural impact that would have on the community is far worse,
> >> IMHO, than any short-sighted bene
On Jan 14, 2:44 am, "Russ P." wrote:
> On Jan 13, 11:51 pm, Paul Rubin <http://phr...@nospam.invalid> wrote:
>
> > Carl Banks writes:
> > > At GE there was no encapsulation in sight on any system I worked on.
> > > In fact, our engine si
es are more likely to use
LGPL than GPL software.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
respond to a wishlist request, though.
As a workaround, you can just cast the set to a tuple like this:
isinstance(x,tuple(s))
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
ged to allow a type, or
any iterable the returns types (wherein every items of the sequence is
required to be a type). What's messy about that?
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 15, 1:08 pm, Duncan Booth wrote:
> Carl Banks wrote:
> > I don't see what the big deal is. Right now isinstance accepts a type
> > or a tuple of types. The code could be changed to allow a type, or
> > any iterable the returns types (wherein every items of th
A subclass can add either more slots or a dict.
Object of types defined in C can have arbitrary layout. For instance,
it could have a layout that looks like this:
reference count
ob_type
PyObject* a
PyObject* b
long c
float d
instance dict
A problem with Python slots and C fields is that, if you want to
inherit from a type with a non-trivial object layout, aside from the
dict and weakrefs, all of the subtypes have to maintain the same
layout (see Liskov substitutability for rationale).
Subtypes can add their own fields or slots if they want, though. So,
if a Python subtype wants to define its own slots on top of a type
with a non-trivial object layout, it has to know which base has the
largest layout so that it doesn't use the same memory for its own
slots. Hence tp_base.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
practical to share very large objects among seperate
processes.
For simple data like large arrays of floating point numbers, the data
can be shared with an mmaped file or some other memory-sharing scheme,
but actual Python objects can't be shared this way. If you have
complex
data (networks and heirarchies and such) it's a lot harder to share
this
information among processes.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
701 - 800 of 2081 matches
Mail list logo