on 30.07.2005 10:20 Paolino said the following:
> why (x**2 with(x))<(x**3 with(x)) is not taken in consideration?
>
> If 'with' must be there (and substitue 'lambda:') then at least the
> syntax is clear.IMO Ruby syntax is also clear.
>
I am sorry if this has already been proposed (I am sure i
Hello,
you have to put the ocx in a container window (e.g. a dialog or the IE).
Without this the media player just acts like a normal COM object.
Example for the dialog you can find in
[Pythonroot]\Lib\site-packages\pythonwin\pywin\Demos\ocx
Bye
Stefan
iting now.
So do you plan on including a kind of scheduler-aware blocking
communication (like the `channels` of the `tasklets` in stackless)?
(as you have a postman already - not a bad idea i think if you compare
with multi-agent-systems theory (see jade) - it could be responsible for
alerti
on 04.08.2005 11:15 Matt Hammond said the following:
> Hi Stefan,
>
>>It seems as though all components basically have to do busy waiting now.
>
> You are right - components are, for the most part, busy-waiting. Which
> is not a good thing!
>
>>So do you plan on
Hi all,
in a python re pattern, how do I match all unicode uppercase characters
(in a unicode string/in a utf-8 string)?
I know that there is string.uppercase/.lowercase which are
'locale-aware', but I don't think there is a "all locales" locale.
I know that there is a re.U switch that makes \
> [snipped alot from others about indexing, slicing problems,
> and the inadequacy of -1 as Not Found indicator]
on 31.08.2005 16:16 Ron Adam said the following:
> The problem with negative index's are that positive index's are zero
> based, but negative index's are 1 based. Which leads to a no
ange.
If the libmap.conf change doesn't help, you could try to rebuild the base
system and kernel and after that the Python port. Also, reading the
UPDATING files for the base system and the ports tree may give you a hint.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
lled with None. If I
want to check for None, I always do it with "is". It's a constant after all...
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
red the value 'myvalue' at a location that the hashed
key refers to (don't care how that is done)
3) mydict hashes the key 'mykey' and retrieves an integer. It looks at the
location that that int refers to and finds the value 'somevalue' that was
previously stored there. It returns that value.
A bit clearer now?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
.>>> id(frozenset()),id(frozenset())
(1077581296, 1077581296)
.>>> id(frozenset())
1077581440
.>>> id(frozenset(()))
1077582256
frozenset() called without arguments (or on empty sequences) should always
return a singleton object. It is immutable, so I can see no reason why i
.>>> id(frozenset()),id(frozenset())
(1077581296, 1077581296)
.>>> id(frozenset())
1077581440
.>>> id(frozenset(()))
1077582256
frozenset() called without arguments (or on empty sequences) should always
return a singleton object. It is immutable, so I can't see a reason wh
therefore not necessarily worth doing. Up to the maintainers.
I don't have any experience in writing extension modules for the standard
library and 'running the test suite'. Implementing the check is trivial,
though. Could anyone please 'run the test suite' ?
I tested i
Raymond Hettinger wrote:
>Stefan Behnel wrote:
I stumbled over the fact that 'frozenset()' doesn't return a constant but
creates a new object everytime. Since it is immutable, I wrote to c.l.py
that this behaviour is different from what tuple() & Co do.
It is not quite co
is not very high. Admittedly, the
set types are too recent in Python to claim 'major common use cases' that
demand optimization. But I generally believe that many programmers will
silently expect frozenset() to be (and become) more efficient than set() - in
whatever regard: processing, memory, etc. - and use it when they think
appropriate. We'll see.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ll__(self):
self.the_right_method()
and then set the_right_method accordingly, but I find that somewhat
sub-optimal. Is there a way to change __call__ after class creation?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
answer. I didn't know they were class-level methods. Too
bad. Guess I'll stick with indirection then.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
to do this.
Use type(self)? That doesn't necessarily mean the constructor of that type
takes the same arguments...
Any comments?
Stefan
--- Lib/string.py~ 2004-11-01 04:52:43.0 +0100
+++ Lib/string.py 2005-02-14 10:41:41.0 +0100
@@ -145,6 +145,12 @@
r
ng able to partially evaluate the Template is something that is absolutely
missing in the implementation. I consider that a bug that should be fixed for
2.5 at latest.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
exports COM objects and is started by the
operating system or a Python script which you start by hand,
registers the class factories and then does not shut down.
Stefan
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> [EMAIL PROTE
of Parnassus at http://www.vex.net/parnassus/ which I promise to keep
# updated.
If you can't find it there I can mail it to you.
Stefan
On 06.03.2005, at 21:02, Sean McIlroy wrote:
I'm looking for a widget, to be used with Tkinter, that displays a
tree whose leaves are strings. I thought
to replace the "key" option, I
do not see an obvious way to have heapq work in a reverse way without making
assumptions on the data.
Any ideas?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Kent Johnson schrieb:
heapq.nlargest()
heapq.nsmallest()
?
Python 2.4 only
Thanks!
Those are *very* well hidden in the documentation. Maybe I already read that
page too often...
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
me
sort bucket). What I'd like to do is heapify and then create an iterator for
the result. But since heapify doesn't support "reverse" ...
Any other ideas?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
d:
def __le__(self, other): return other.s <= self.s
I actually looked at the C-implementation of heapq in 2.4 and saw that it even
provides distinct implementations for min-heaps and max-heaps. It would be
so convinient if both of them became part of the module...
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I would like the distutils are creating a binary distribution only - means
create the distribution file with *.pyc files WITHOUT the *.py files. Any
ideas? Or are the distutils the wrong tool for that?
"setup.py bdist" creates binary dist, but includes the sourcecode
chee
00))'
1000 loops, best of 3: 308 usec per loop
There. Factor 10. That's what I call optimization...
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
and build an
assembly function that takes the same arguments to make the assembly function
directly callable.
Maybe the decorator line has to look like this:
@pyasm(globals())
or something like that, I can't tell. I don't think it would be much work to
implement this.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Just use
obj = win32com.client.Dispatch(obj)
Stefan
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Oy Politics
> Sent: Wednesday, March 16, 2005 11:51 PM
> To: python-list@python.org
> Subject: COM connection point
erything should work fine.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
e keys
named in cols out of row? In other words, to get this:
{"city" : "Hoboken", "state" : "Alaska"}
Untested:
dict( (key,value) for (key,value) in row.iteritems() if key in cols )
Works in Py2.4
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Stefan
mails!
the way you read
it doesn't reflect
why top-posting is bad:
It's me wrote:
Not to mention that there are packages out there that doesn't work (yet)
with 2.4. Pynum is one such package.
--
It's me
"Larry Bates" <[EMAIL PROTECTED]> wrote in message
this topic. In short,
submitting a cross-post reads as: you haven't actually thought about your
problem but want to bug as many people as possible with it.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ine-grained, i.e. glyphs can represent
individual characters or elements of vector graphics such as paths.
That's unlike any conventional 'toolkit' such as Qt, where a 'widget'
is quite coarse-grained, and the display of such 'widgets' is typically
not that of a structured graphic, but procedural.
Regards,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
the beginning of a line. Thank you Dr. Dobb!
It's unfortunate for c.l.py that Python uses ">>>" as the default prompt
as it messes up the display on mail/news readers that provide "syntax
highlighting" for quotes.
I wish everyone would write examples that way! On the other hand - three
levels of quoting are really rare, maybe it would be easier to change that
in the mail readers...
... or in Py3k ?
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
d. Should work for
many source repositories.
You can use urllib2 for both querying and download.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
"", line 1, in ?
File "", line 2, in ?
File "", line 3, in Bar
NameError: name 'Foo' is not defined
However, when I use the current global and local scope, i.e.
simply 'exec f', everything works fine. What am I missing ?
Thanks,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
ject, which is a bit
confusing. (Under what circumstances does 'locals()' return
not the same object as 'globals()' ?)
The problem appears to be that
exec f in a, b
where a and b are distinct dictionaries, does not look up
symbols in 'a' when in local scope.
I filed a bug
Peter Hansen wrote:
Stefan Seefeld wrote:
Indeed, using 'globals()' and 'locals()' works. However,
both report the same underlaying object, which is a bit
confusing. (Under what circumstances does 'locals()' return
not the same object as 'globals()' ?)
W
Bernhard Herzog wrote:
Stefan Seefeld <[EMAIL PROTECTED]> writes:
Is there anything wrong with 'exec source in a, b' where
a and b are distinc originally empty dictionaries ? Again,
my test code was
class Foo: pass
class Bar:
foo = Foo
and it appears as if 'Foo'
list to get the patch ready
for integration. I know, it currently misses documentation and tests, but I'm
ready to add them once the patch is actually considered for integration.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
f
Python and to not rely on the specific performance of a specific
implementation. Just use the tool that is made for your task. The information
for choosing the right tool can already be found in the documentation.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
is much less a matter of ease of parsing but instead how closely
programming idioms match between the two languages that are involved.
And that obviously also depends on the specific code that needs to
be rewritten and the style it is written in (i.e. for example OO vs. templates,
etc.).
Regard
lf, I still prefer to use inheritance even if Python
doesn't force me to do it. It's simply a matter of mapping the conceptual
model to the actual design/implementation, if ever possible.
Regards,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
look fine. Make sure to either have a binary package for omniORBpy
that was compiled for the version of python you are actually using, or
alternatively compile it yourself.
HTH,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
the library path, not the python path. Thus you will have to add
the library
path to the PYTHONPATH variable.
For details see
http://omniorb.sourceforge.net/omnipy2/omniORBpy/omniORBpy001.html#toc2
or the omniORB specific mailing list.
HTH,
Stefan
--
http://mail.python.org/mailman
nd at http://omniorb.sourceforge.net/, and finally ask any unanswered question
on the omniORB ML.
Sorry, it has been a long while since I last used omniORB.
Regards,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
xamples of such languages include XUL (mozilla), Javascript,
and similar.
HTH,
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
..
IMHO that's actually the _only_ sane way on windows to deploy DLLs. The
other option you have is to put them in %SYSTEM32% or whatever environment
variable it was on that platform. But once you start to drop DLLs _outside_
your App's install directory, you _can't_ simply move the ins
spits out a readily baken RPM, ready to be nailed into the system.
Sadly, this doesn't exist for Debian and it doesn't work for all Python
packages (Twisted, that is).
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
else from the function or make XML-RPC return nothing
(don't know if that works).
xmlrpclib.Fault:
The obvious error. :)
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
dim array (1x3) with elements which are also
1-dim
arrays. Since the automatic calculation always tries to find the highest
dimensionality
the Rhino program will get a 2-Dim array which it does not support.
In VB you can define the dimension of such a array in Python we must guess.
I'm just working on a PySafeArray implementation for PythonCom which should
give you also the opportunity to define the dimension via Python. Until then
you have no luck.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
mply pass down a
list of element names that you append() at the beginning of the function
and pop() at the end, i.e. a stack. That list will then always give you the
current path from the root node.
Alternatively, if you want to use lxml.etree instead of ElementTree, you
can use it's iterwal
Larry Martell, 26.11.2013 13:23:
> On Tue, Nov 26, 2013 at 2:38 AM, Stefan Behnel wrote:
>> larry.martell...@gmail.com, 25.11.2013 23:22:
>>> I have an XML file that has an element called "Node". These can be nested
>>> to any depth and the depth of the
Terry Reedy, 12.12.2013 03:26:
> from itertools import count
> table = sorted(t for t in zip(iterable, count))
This is a useless use of a generator expression. sorted(zip(...)) is enough
(and likely to be substantially faster also).
Stefan
--
https://mail.python.org/mailman/listinfo/
their share.
Maybe a couple of major projects should start dropping their Py2 support,
just to make their own life easier and to help others in taking their
decision, too.
(And that's me saying that, who maintains two major projects that still
have legacy support for Py2.4 ...)
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
may take a moment to learn, especially if you are used to
doing everything in excessive manual detail in C code, but once you are
through that, you should get things done much more quickly than when trying
to do them by hand.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
ion.
> >>> s = "Straße"
> >>> assert len(s) == 6
> Traceback (most recent call last):
> File "", line 1, in
> AssertionError
> >>> assert s[5] == "e"
> Traceback (most recent call last):
> File "", line 1, in
> AssertionError
The point I think he was trying to make is that Linux is better than
Windows, because the latter fails to fail on these assertions for some reason.
Stefan :o)
--
https://mail.python.org/mailman/listinfo/python-list
n code.
I strongly recommend not to resort to writing real C code here (using the
C-API of CPython). It will be slower and will contain more bugs.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
satsatsastatbadstssdhhhnbb", set, (sorted, {"reverse": True}))
['t', 's', 'n', 'h', 'd', 'b', 'a']
Cheers,
Stefan
[0] https://github.com/sotte/pelpe
[1]
http://elixir-lang.org/getting-started/enumerables-and-
mul)
)
`pipe` also allows you to us named arguments which would be difficult
if you use operator overloading:
pipe("sentaoisrntuwyo", (sorted, {"reverse": True}))
Beste Grüße,
Stefan
On Wed, Mar 16, 2016 at 4:39 PM, Steven D'Aprano wrote:
> On Thu, 17 Mar 2016 02:22
ools, but something which is XML aware.
>
> I can see several projects on Pypi that can generate some form of xml
> diff, but I can't seem to see anything that can also do the patching
> side of things.
Is there a use case for this?
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
please keep this on-list.
Nicholas Cole schrieb am 26.10.2014 um 22:43:
> On Sun, Oct 26, 2014 at 6:30 PM, Stefan Behnel wrote:
>> Nicholas Cole schrieb am 26.10.2014 um 18:00:
>>> I'm looking for a python library that can parse XML Documents and
>>> create
for unlikely cases may provide a net-loss for
the "normal" code. So there are several reasons why an "obvious"
optimisation may be a bad idea.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
t; table = etree.SubElement(body, 'table')
>
> etc etc
>
> with open('mynewfile.html', 'wb') as f:
> doc.write(f, pretty_print=True, method='html')
>
> (you can leave out the method= option to get xhtml).
There's also the E-factory for creating (sub-)trees and a nicely objectish way:
http://lxml.de/lxmlhtml.html#creating-html-with-the-e-factory
and the just released lxml 3.4.1 has an "htmlfile" context manager that
allows you to generate HTML incrementally:
http://lxml.de/api.html#incremental-xml-generation
Obviously, you can combine both, so you can create a subtree in memory and
write it into an incrementally built HTML stream. Pretty versatile.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
e in mind. Whether that
purpose is still what the modules are used for or whether they are even
still in use at all, is unclear from the above.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
Ian Kelly schrieb am 20.11.2014 um 20:44:
> On Thu, Nov 20, 2014 at 12:02 PM, Stefan Behnel wrote:
>> There's also the E-factory for creating (sub-)trees and a nicely objectish
>> way:
>>
>> http://lxml.de/lxmlhtml.html#creating-html-with-the-e-factory
>
> T
a bunch of functions you can call" or "here's
an object, go and call some methods on it" kind of APIs, there isn't all
that much of a difference either.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
ose tools at this level is great, so if PyPy becomes yet
another way to speed up the critical 5% of a CPython application, that's a
good thing.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
try to do it but i always get None as answerI am using
> Window 7 professional and python 2.7
The formatting of your code example was heavily screwed up, please send a
plain text email next time.
My general advice is to use ElementTree instead of SAX. It's way easier to
use (even for simple tasks). Use iterparse() to get event driven
incremental parsing.
https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.iterparse
http://effbot.org/zone/element-iterparse.htm
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
p in root.Track.attrib['VenueName']]
> ---
> AttributeErrorTraceback (most recent call last)
> in ()
> > 1 names = [p.text for p in root.Track.attrib['VenueName']]
>
> AttributeError: 'str' object has no attribute 'text'
As you can see from the output above, "attrib" is a mapping from strings
(attribute names) to strings (attribute values). So just use
name = root.Track.attrib['VenueName']
or, even simpler:
name = root.Track.get('VenueName')
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
line, you can use a set comprehension or yield a value back from a
generator. So, it's not "half way between Python and C", it actually covers
both, almost entirely. (Oh, and also C++, if you feel like it.)
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
Hello,
the "chartObj" is not a Chart object it is a shape see
>> from win32com.client import Dispatch
>>> Excel = Dispatch("Excel.Application")
>>> WB = Excel.Workbooks.Add()
>>> Shape = WB.Sheets[0].Shapes.AddChart()
>>> Shap
tion? I am open to using
> something else (e.g. lxml) if necessary.
lxml has a tool to discard potentially unsafe content from HTML files:
http://lxml.de/lxmlhtml.html#cleaning-up-html
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
looked:
https://www.imperialviolet.org/2014/02/22/applebug.html
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
Juraj Ivančić, 04.03.2014 16:23:
> Just for reference, it is doable in pure Python, with ctypes help
For some questionable meaning of "pure".
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
l#arbitrary-precision-libraries
Stefan Krah
--
https://mail.python.org/mailman/listinfo/python-list
int(an.description())
return 0
Clearly substantially simpler than the posted C code (and certainly safer,
faster and more correct) - although that doesn't really help me much with
understanding what the intention of this code is, looks rather weird...
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
uldn't be very telling if you don't have the original source
code.
Stefan
PS: disclaimer: I never needed to obfuscate Python code with Cython, and
this use case is definitely not a design goal of the compiler. No
warranties, see the license.
--
https://mail.python.org/mailman/listinfo/python-list
raise PicklingError(
/usr/lib64/python3.3/pickle.py:raise PicklingError(
/usr/lib64/python3.3/pickle.py:raise PicklingError(
/usr/lib64/python3.3/idlelib/rpc.py:except pickle.PicklingError:
Which exception would you raise for an object that can't be
pickled and why?
[1] http://ftputil.sschwarzer.net/trac/ticket/75
[2] https://docs.python.org/3.4/library/pickle.html
Best regards,
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
tly for this. Something like
this should work:
from xml.etree.ElementTree import XMLParser
parser = XMLParser()
parser.feed(b'')
parser.feed(real_input_data)
parser.feed(b'')
root = parser.close()
for subtree in root:
...
Stefan
--
http
ree.html#pull-api-for-non-blocking-parsing
It's also supported by recent versions of lxml, which additionally has easy
to use support for the sending side with its xmlfile() tool.
http://lxml.de/parsing.html#incremental-event-parsing
http://lxml.de/api.html#incremental-xml-generation
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
le.
Well, there's json.loads(), which is more commonly used for this task.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
Burak Arslan, 09.05.2014 18:52:
> On 05/09/14 16:55, Stefan Behnel wrote:
>> ElementTree has gained a nice API in
>> Py3.4 that supports this in a much saner way than SAX, using iterators.
>> Basically, you just dump in some data that you received and get back an
>> iter
installer
that comes with pretty much all of your scientific processing tools in one
package:
http://docs.continuum.io/anaconda/
There's a Py3.3 version.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
this.
> But AFAIK the python GIL (and in smaller or older computers that have only
> one core) does not permit true paralell execution of two threads.
Not for code that runs in the *interpreter", but it certainly allows I/O
and low-level NumPy array processing to happen in parallel, as they do not
need the interpreter.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
1007')
Otherwise 'partial' has an error that is too large when you pass it to
the ln() function. Since decimal mostly follows IEEE 754 with arbitrary
precision extensions, it cannot behave differently.
Stefan Krah
--
https://mail.python.org/mailman/listinfo/python-list
u want to implement a SourceLoader:
https://docs.python.org/3.4/library/importlib.html#importlib.abc.SourceLoader
I recommend implementing this in Python code instead of C code, though.
Much easier. Cython can help with the integration between both.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
Roland Plüss, 17.05.2014 15:00:
> On 05/17/2014 01:58 PM, Stefan Behnel wrote:
>> Roland Plüss, 17.05.2014 02:27:
>>> I'm using Python in an embedded situation. In particular I have to load
>>> python scripts through a memory interface so regular python module
&g
Hi,
please avoid top-posting.
Roland Plüss, 17.05.2014 15:49:
> On 05/17/2014 03:26 PM, Stefan Behnel wrote:
>> Roland Plüss, 17.05.2014 15:00:
>>> On 05/17/2014 01:58 PM, Stefan Behnel wrote:
>>>> Roland Plüss, 17.05.2014 02:27:
>>>>> I'm usin
Roland Plüss, 17.05.2014 17:28:
> On 05/17/2014 04:01 PM, Stefan Behnel wrote:
>> Roland Plüss, 17.05.2014 15:49:
>>> On 05/17/2014 03:26 PM, Stefan Behnel wrote:
>>>> Roland Plüss, 17.05.2014 15:00:
>>>>> On 05/17/2014 01:58 PM, Stefan Behnel
Roland Plüss, 17.05.2014 18:28:
> On 05/17/2014 05:49 PM, Stefan Behnel wrote:
>> Roland Plüss, 17.05.2014 17:28:
>>> On 05/17/2014 04:01 PM, Stefan Behnel wrote:
>>>> Roland Plüss, 17.05.2014 15:49:
>>>>> On 05/17/2014 03:26 PM, Stefan Behnel
uiltins__", PyEval_GetBuiltins() );
> PyRun_StringFlags( fileContent, Py_file_input, moduleDict, moduleDict,
> NULL );
>
> Hopefully this works also in Py3 should I switch some time later. But I
> guess it should seeing how simple the import now became.
The general principle should still w
e.com/articles/fog69.html
There might still be something that doesn't exist yet, and if you start
working on that, going with Py3 is certainly the right way. For everything
that's there already, however, reusing working, tested code is way better.
And making it work in Py3.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
see why
you would consider fabric a dependency that keeps you from switching to
Py3. In many cases, you can just keep running it in Py2 as you did before.
Taking a closer look at the "big list" that caniusepython3 spits out will
usually make it shrink to a manageable size. Meaning, the blind size of
that list is not an excuse for anything.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
bookaa bookaa, 25.05.2014 10:17:
> I think the significance of Python to Go, is it give us opportunity to
> make Python project run fast.
You shouldn't make that your only goal, because you'll have a really hard
time achieving it (to put it mildly).
Stefan
--
https://mail.py
) slow when compared to something (specific) else.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
# external declarations:
cdef extern from "someheader.h":
void write_this_c(int offset, int size)
# your module function:
def write_object(int offset, int size):
"""write some stuff"""
print("before call")
write_this_c(offset, size)
print("after call")
That's it.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
.x to 1.7.x to prevent users from falling into
that evil trap. That will also make it clear again which Python is expected
to prevail in the long run.
Stefan :o)
--
https://mail.python.org/mailman/listinfo/python-list
rtainly a
reason for many people to prefer Py3 over Py2.
Stefan
--
https://mail.python.org/mailman/listinfo/python-list
...
else:
raise ValueError("unknown command")
Two comments:
1) you can obviously do the same in C, by writing a bit more code. It would
likely be a lot slower, though, and you'd have to take care of error
handling etc.
2) you might want to rethink your design as this is a rather unpythonic
API. Although it depends on who (or what) you are expecting to use it.
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
401 - 500 of 2239 matches
Mail list logo