bdb112 wrote:
I saw this interest syntax on this site
x[:0]=0
I guess that is cute, but could be confusing(and doesn't work)
It does if you use an array of the appropriate
type on the right hand side:
a[:0] = array('i', [0])
--
Greg
--
http://mail.python.org/mailman/
Robert Kern wrote:
a[:0] = array('i', [0])
Not when 'a' is a numpy array rather than an array.array.
That's true, but I got the impression that the OP was
talking about array.array, not numpy.array.
It's very confusing having two widely-used types
both called
c, but if I did, I would tend
to think he meant to say that none of a, b,
c are equal to any other. That's not what it
means in Python, though.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
trace mechanism.
There really ought to be a 'yield' event to distinguish
yields from returns.
You could put in a feature request on python-dev
concerning this.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Bearophile wrote:
Was this link, shown by William, not enough?
http://hg.flibuste.net/libre/games/cheval/file/46797c3a5136/chevalx.pyx#l1
Yes, sorry, I posted too soon.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
, TO_PROCEED_TO = moo)
d.quack()
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
can
obfuscate things just as much if you really want!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
t killed things like the Lisp machine. Their
developers couldn't keep up with the huge resources that
people like Intel and Motorola had to throw at CPU
development, so eventually a general-purpose CPU could
run Lisp faster than a Lisp machine.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
there was an ambiguity between multiple args and
a single arg that happened to be a tuple.
This was before keyword arguments existed -- they would
have been hard to incorporate into the old scheme.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
table custom compressor.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
s, etc.
If you don't want that, then write the format string as
'This is a hex number: 0x{:08x}'
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ot to know which
manual to look in.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
d and fw to the
writing thread.
You could also try avoiding file objects altogether
and use the raw system calls in the os module. Since
you're not using any buffering, there's little reason
to use the stdio layer. If you do that, you should be
able to use the same file descriptor for
stdio object is being locked
while one of the threads is using it, which would also
account for the observed half-duplex behaviour.
Another good reason to steer clear of file objects!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ue of attack would be
to use your python to compile a known piece of code
that exercises all the opcodes, and compare the result
with that from a standard python.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
import A_Part1
from A_Part2 import A_Part2
class A(A_Part1, A_Part2):
...
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
James Harris wrote:
I don't know yet whether it will be
easier to modify the tree or to create a new one for each phase.
You can create a new tree using this style as
well. Just have each method create and return a
new node instead of modifying the existing one.
--
Greg
--
J. Cliff Dyer wrote:
What happens if you use a literal like 0x10f 304?
To me the obvious thing to do is concatenate them
textually and then treat the whole thing as a single
numeric literal. Anything else wouldn't be sane, IMO.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
x27; statement
always calls it with the current globals() and locals().
If you pass an empty dict for 'globals', I think the
effect will be to cause the module name to always be
interpreted as a top-level module (i.e. no relative
import). But I'm not sure.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
e how there could be any great difficulty with implementing
that -- it only affects the scanner.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ss, in the
module where the class is defined.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
xpressed the precise
concept I had in mind. Yet I was clearly capable of thinking
about it, otherwise I wouldn't have noticed that I was missing
a word!
So in my humble opinion, the strong form of the Sapir-Whorf
hypothesis is bunk. :-)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
one who doesn't understand the
field (i.e. anything which doesn't use a DFA).
Plex uses a DFA.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
file
already exists. The read/write modes don't really
come into it, as far as I know.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ething,
namely a Foo that hasn't been enabled yet.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ac for tixlib files, no luck. Looks like you can build Tix from source and
install, but web posts indicate this is very hard and I don't see any
useful traffic on that in the last 2 or 3 years, never a good sign.
Any pointers appreciated ! Hope I don't get flamed, I see this group has
some epic flame wars.
Cheers,
--
Greg Edwards,
Port Jackson Bioinformatics
gedwar...@gmail.com
--
http://mail.python.org/mailman/listinfo/python-list
PRODUCT owned by a for-profit company.
PostgreSQL is an open-source PROJECT and is unowned.
A lot of the major technical differences are outlined here:
http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL
--
Greg Donald
--
http://mail.python.org/mailman/listinfo/python-list
layers.. so flipping back and forth to
see which database is better for your particular app and workload is
trivial.
--
Greg Donald
--
http://mail.python.org/mailman/listinfo/python-list
x27;t think it's all that bad if you regard
the tuple as effectively part of the syntax.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
date formats I've thrown at it.
from dateutil.parser import parse
dt = parse( whatever )
I've throw all kind of date and timestamps at it.. have yet to see anything it
won't parse.
--
Greg Donald
--
http://mail.python.org/mailman/listinfo/python-list
r unknown locale strings.
>>>> parse('1.2.2013') # ambiguous, I know
> datetime.datetime(2013, 1, 2, 0, 0) # should be datetime.datetime(2013, 2, 1,
> 0, 0)
In [2]: parse('1.2.2013', dayfirst=True)
Out[2]: datetime.datetime(2013, 2, 1, 0, 0)
--
Greg Donald
--
http://mail.python.org/mailman/listinfo/python-list
was tasked with
parsing and dial it in using the appropriate dayfirst, yearfirst, etc.
options.
--
Greg Donald
--
http://mail.python.org/mailman/listinfo/python-list
my dream job?
Doubt it, but good luck all the same :)
> Please suggest me
Visit their job boards.
--
Greg Donald
--
http://mail.python.org/mailman/listinfo/python-list
ome really awesome people.
Thanks in advance for your help.
--
*Greg Harezlak*
1 Bush Street, 7th Floor
San Francisco, CA 94104
(T): 925.683.8578
(E): g...@tinyco.com
<http://twitter.com/#!/gharezlak>
<http://www.facebook.com/gharezlak><http://www.linkedin.com/in/
perimental
> http://githire.com/ are two excellent developer-friendly solutions for
> that.
>
> - Philipp
>
> On 03/01/2012 12:08 AM, Greg Harezlak wrote:
> > Hello Python Community,
> >
> > I work for a mobile gaming startup in San Francisco, and we're heavily
&
Is there documentation showing how to read from a Microsoft Outlook server
using Python 3.2. I've done it with 2.x, but can't find anything to help
me with 3.2.
Thanks,
--greg
--
http://mail.python.org/mailman/listinfo/python-list
lose enough for
scanning. I'd like to read in the "official" form and add my data. Is
this possible?
Thanks,
--greg
--
http://mail.python.org/mailman/listinfo/python-list
PyGUI 2.5 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Lots of new stuff in this version. Highlights include:
- Improved facilities for customising the standard menus.
- Functions for creating PyGUI Images from PIL images and numpy arrays.
- ListButton - a pop
PyGUI 2.5.3 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Clipboard access now implemented on MacOSX, plus a few
bug fixes.
What is PyGUI?
--
PyGUI is a cross-platform GUI toolkit designed to be lightweight
and have a highly Pythonic API.
--
Gregory Ewin
On Mar 10, 1:37 pm, Corey Richardson wrote:
> On 03/10/2011 03:35 PM, Corey Richardson wrote:
>
> > Middle button is Button-3 IIRC, and I think it'd be MouseUp and
> > MouseDown. I'm really not sure though.
>
> It's Button-2 rather.
>
> --
> Corey Richardson
Middle button is button-3 on Mac OS X,
PyGUI 2.4 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Highlights of this release:
* Python 3 Compatible on MacOSX and Windows.
* ScrollableView has been overhauled on Windows and should now
work with all builds of pywin32 as far as I know.
What is PyGUI?
---
jects needlessly?
def get_from_cache(x):
if not x in cache:
cache[x] = compute_from(x)
return cache[x]
That looks up the cache *twice* for every access. Mine
only does one lookup when the item is already in the
cache.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
for the Sketchup 3D modelling application
that lets you script it in Python.
--
Greg Ewing
greg.ew...@canterbury.ac.nz
--
http://mail.python.org/mailman/listinfo/python-list
Is it possible to create a dictionary from a string value? Something along
these lines (but that works):
>>> mystring = "{'name':'greg','hatsize':'7 5/8'}"
>>> mystring
"{'name':'greg','hatsize&
ou want it to have a distinct docstring, e.g.
MAX_BUFSIZE = int(8192, __doc__ = 'Size of the hardware buffer used for I/O on
this device.')
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ellipse() Okay, fine...
but WHERE is draw_ellipse defined?? What magic is happening there?
I've searched the entire PIL directory tree, and the ONLY two places
draw_ellipse is mentioned are right there in the ellipse() function...
WHAT am I missing??
Thanks!
-Stumpy (aka Greg)
--
https://mail.python.org/mailman/listinfo/python-list
, cuts off an extra 6 and adds them in.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
could fail to find it.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
.
It sounds like you would be better off making all your equation data
structures immutable. Instead of mutating the equation when making
a transformation, return a new equation. Then you can use sets and
dicts to cache them etc. without any problems.
--
Greg
--
https://mail.python.org/mailman
ve a loop which is supposed
to repeatedly read a value for n and then compute fizzbuzz,
and you have the input statement in the wrong place.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
about
its current behaviour that you think should be different?
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
French for 5 years in school, with teachers
to learn the pronunication from, but I never got a lot of
practice at it or much chance to hear it spoken. As a result I
have about a 1% success rate at understanding spoken French,
even when I know all the words being used.
--
Greg
--
https://mail.
see that in pdb because it doesn't
involve any Python code. Since strings don't know how to compare
themselves with uuids, it will return NotImplemented and the
interpreter will then call uuid's method.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
that
are self-synchronising) but it won't work for arbitrary encodings.
Given that limitation, I don't think it's reliable enough to include
in the standard library.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
essary and confusing.
I suspect that wasn't a deliberate design decision, but just a
side effect of using a single class dict for both class and
instance things.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ell = l
one = 1
min(enumerate(ell), key=lambda x: x[one])
Hope that clears it up!11!one!ell
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
phens, commas, etc.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 9/06/22 5:55 am, Dennis Lee Bieber wrote:
There are no mutable strings in Python.
If you really want a mutable sequence of characters, you can
use array.array, but you won't be able to use it directly in
place of a string in most contexts.
--
Greg
--
https://mail.pytho
Another possibility is to use reportlab to generate a pdf.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ction, because it ties it together
visually and lets me have locals that are properly local.
If the file is only ever used as a script, I just put an unconditional
call to the main function at the bottom.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 21/06/22 2:52 pm, Avi Gross wrote:
This leads to the extremely important question of what would an implementation
of Python, written completely in C++, be called?
(Pronounced with a comical stutter) "C-p-p-python!")
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
date.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
nd the new
implementation might be called RPython, or RustyPython, or whatever.
The names are independent of which one is currently blessed as the
reference implementation.
Although if it were called RPython, no doubt a new debate would
flare up over whether the "R" stands for "R
g the terms of a
licence.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
entence is so badly cobbled together that it could be the
output of a KI of some sort (GPT-3) trying to summarize stuff from the
web.
It looks to me like the output of a Markov chain that's been fed
with all the latest programming buzzwords.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
?
Python+=1
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
and then moving
on to Applesoft BASIC.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
F. You still need to know whether it's a new reference
or not and treat it accordingly.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ave differently, and the Finder
doesn't tell you which you're looking at. :-(
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
_data = None
def push(self, item):
result = Stack()
result._data = Pair(item, self._data)
return result
def pop(self):
rest = Stack()
rest._data = self._data.second()
return self._data.first(), rest
Note that neither Stack nor Pair inherits from
t the length of
a structure built out of pairs.
But in any case, the way to do this in a conceptually clean way
is for the length method of Stack to call whatever it is that
computes the length of a linked list of Pairs. This is what
the term "delegation" refers to.
--
Greg
--
https://
careful -- a Sequence class would
probably be expected to have methods for e.g. inserting and
removing things in the middle, which you might not want to
allow for a Stack.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
er name. Also it has some primitive types such as ints
and floats that don't behave in an OO way at all.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
overly restrictive, because it wouldn't allow S to
override a method of T and make it do something different --
which we do all the time in practice.
Class contracts must hold for subclasses.
That sounds like a much better way of saying it!
--
Greg
--
https://mail.python.org/mailman/lis
On 4/11/22 7:51 am, Julieta Shem wrote:
(The empty documentation seems to satisfy the principle.)
All the more reason to document your classes!
More seriously, there's always at least a (possibly fuzzily) implied
contract, because of the names you choose for things if nothing else.
--
rely OO" or not, whatever
that means, because I don't see purity of OO as a virtue.
All I care about is what actual features then language has.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 14/11/22 1:31 pm, Jon Ribbens wrote:
On 2022-11-13, DFS wrote:
But why is it allowed in the first place?
Because it's an expression, and you're allowed to execute expressions.
To put it a bit more clearly, you're allowed to evaluate
an expression and ignore the r
it should
be a warning, and that's what linters are for. I wouldn't
like the core interpreter to be producing a bunch of warnings
for things like this.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
nt inaccuracies.
If you can post some code we might be able to help you further.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
gt;>> dtdm * (1/1000 - 10/1000)
3.4004053539917275e-28
which agrees with your Decimal calculation to 3 digits,
and should be as precise as the input numbers (about
4 digits in this case).
This is a good example of why it's important to choose
an appropriate numerical algorithm!
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
and non-mutating methods, and
to help catch mistakes resulting from mixing them up.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
*)malloc(3 * sizeof(int));
arr1[0] = 10;
arr1[1] = 11;
arr1[2] = 12;
Does that help your understanding?
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
a, it will be very fast. If
it has to fall back on a linear search, it probably won't be
significantly faster than your existing Python implementation.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
rt names for modules that are *very* frequently
referenced. Use full unabbreviated names for everything else.
* Don't 'import foo as foo', just 'import foo'.
* Don't try to line the code up in columns, it doesn't really
help readability IMO.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
e overkill. Just pull the argument out of
argv directly.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ng, it will go
wrong 255 times out of 256.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ve special syntax in the language.
Functions don't need to return things to justify their existence,
and in fact the usual convention is that functions whose purpose
is to have an effect just return None.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
d
code suddenly cease to execute.
No, but it was decided that Python 3 would have to be backwards
incompatible, mainly to sort out the Unicode mess. Given that,
the opportunity was taken to clean up some other mistakes as well.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
proportion to
the problem.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
to make
it easier to write code that would work in both versions.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
include
the original copyright notice as requested, maybe with a "based on
work by..." attribution.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
#x27;t wear out like
hardware, you don't have to budget for replacing it. But you can't
expect third party software to be maintained forever -- particularly
when, as with Python, the maintenance is mainly being done by
*volunteers*.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ment following -r
containing a value.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 13/01/21 4:18 am, Grant Edwards wrote:
AFAIK, Python can't be used to write device drivers for any popular OS
At least not until some crazy person embeds Python in the
Linux kernel...
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 13/01/21 7:57 pm, Christian Gollwitzer wrote:
What do you mean, "until" ?
https://medium.com/@yon.goldschmidt/running-python-in-the-linux-kernel-7cbcbd44503c
He's using Micropython. That's cheating! :-)
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 14/01/21 11:09 am, Grant Edwards wrote:
Perhaps I need to recalibrate my adjectives, but with
256KB+ of flash and 32KB+ of RAM, I wouldn't call them "small"
It's small by today's standards, when you consider that
multiple GB of RAM is commonplace now in most &
;t see any harm in
allowing the app to *request* (not force) a certain position for
a window.
The app can of course abuse that privilege, but that's the fault
of the app, not the feature.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
ng as sqrt, but the sqrt function probably uses a more
efficient algorithm.
Also, exponentiation assumes you're okay with getting a
complex result:
>>> (-27)**0.5
(3.181725716174721e-16+5.196152422706632j)
So it's not quite the same thing as math.sqrt().
--
Greg
--
https:/
ge.
So get and set methods are unnecessary and actively discouraged
in Python.
(C#, if I understand correctly, gets this sort of half-right.
You can turn an attribute into a property, and the calling *source*
doesn't change, but it all has to be recompiled -- which kind of
defeats the purpose.)
o interact badly with Python
stdio.
Can something be done about this? Maybe Python stdio objects
should flush all the C stdio streams before writing anything?
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
401 - 500 of 1198 matches
Mail list logo