When I want to issue a warning, I am uncertain
about the distinction between warnings.warn() and
logging.warning(). My naive thought is to presume
"warning" means the same thing in both cases, and
so if I call logging.warning(), it should take
care of making sure something equivalent to my
calling
> > >event_timestamp = (2009, 06, 04, 05, 02, 03)
> > >(year, month, day, hour, minute, second) = event_timestamp
> >
> > [...]
>
> The point of each position having a different semantic meaning is that
> tuple unpacking works as above. You need to know the meaning of each
> position in ord
> Try, then, this tuple:
>
>event_timestamp = (2009, 06, 04, 05, 02, 03)
>(year, month, day, hour, minute, second) = event_timestamp
>
> A list would be wrong for this value, because each position in the
> sequence has a specific meaning beyond its mere sequential position. Yet
> it also ma
> [In this tuple]
>dodge_city = (1781, 1870, 1823)
>(population, feet_above_sea_level, establishment_year) = dodge_city
> each index in the sequence implies something very
> different about each value. The semantic meaning
> of each index is *more* than just the position in
> the sequence;
> This, ladies and gentlemen of the jury, points
> up the essential difference between a modal and
> a non-modal way of doing things.
That is one reason I love emacs... I not only
get a selection of several "major modes", I
can also have multiple "minor modes" active at
the same time! And I can e
My experience has been that if the execution stays
inside the VM, then for a "server side" application, the
JVM is faster, and proportionally even faster when there
are more threads ready to do something.
When the VM has to do a lot of interaction with the
OS, then I think it is difficult to make
> > If there is a function which triggers a one-shot switch, I like
> > to have a way to find out if it has already been triggered, I
> > prefer to have the function tell me if it triggered the switch
> > or not, but I would not want that to be by raising an exception.
>
> In this case, though, we'
> Anyone else?
If there is a function which triggers a one-shot switch, I
like to have a way to find out if it has already been triggered,
I prefer to have the function tell me if it triggered the switch
or not, but I would not want that to be by raising an exception.
--
http://mail.python.org/ma
Presuming there is a reason to want block-local variables,
does this seem like a good way to do something like it?
@contextlib.contextmanager
def blocklocal(**kwargs):
bl = type('', (object,), {})()
for (k, v) in kwargs.items():
bl.__setattr__(k, v)
yield bl
for k in bl.__d
Presuming it is very common to have objects created
on the fly using some sort of external data
definitions, is there an obvious common standard
way to take a dict object and create an object
whose attribute names are the keys from the dict?
I realize I can do something like:
>>> d = {"hello": "w
Be careful not to presume "/a/b/" is the same directory as "/a/b/c/../"
I would consider the latter the parent of /a/b/c/, not the former.
--
http://mail.python.org/mailman/listinfo/python-list
> Linux doesn't do interprocess communication very well.
> The options are [...] and shared memory (unsafe).
I think the bar has to be set pretty high to say shared memory
is too unsafe an approach for active entities to communicate.
> If you're using CPython, don't worry about socket overhead.
> > > Try this: http://nikitathespider.com/python/shm/
> >
> > I am hoping not to plug something underneath the Python
> > VM; I would rather use a socket, or use signals.
>
> I'm not sure what you mean. It's just an extension module
> that you'd import like any of the stdlib modules.
I cannot im
> If you don't want to use a 3rd party module you could
> use the multiprocessing module
That is definitely good for when I have a tree of
processes which are all Python applications. I use
it for that. But I am looking for something where
the Python application can interact conveniently
with an
> Try this: http://nikitathespider.com/python/shm/
I took a look at that (especially the posix_ipc at
http://semanchuk.com/philip/posix_ipc/). I am hoping
not to plug something underneath the Python VM; I
would rather use a socket, or use signals. If I were
to use a C library, I imagine I would
I am interested in the lightest mechanism to use
in a Python application for mutex/wait/notify
between processes, one of which may be a program
which does not have a shared ancestral benefactor,
or may not be a Python program at all.
I would ideally like to have something which does
not need to ma
16 matches
Mail list logo