Remarks heard & form updated.
Nathaniel, I'm not sure about that: even if the code is 2- and 3-compatible
you'll pick one runtime. 2 others questions now mention writing polyglot
code.
By the way I published the survey on HN, /r/programming & /r/python:
https://news.ycombinator.com/item?id=8730156
Hi all,
Last year a survey was conducted on python 2 and 3 usage.
Here is the 2014 edition, slightly updated (from 9 to 11 questions).
It should not take you more than 1 minute to fill. I would be pleased if
you took that time.
Here's the url: http://goo.gl/forms/tDTcm8UzB3
I'll publish the result
- Original Message -
> From: "Chris Angelico"
> > c1 = Circle((0,0), 10, None)
> > print c1.mass
> > 20
> > c1.radius = 20
> > print c1.mass
> > 40
>
> I think that juust might count as scope creep :)
> ChrisA
Here you go :p
c1 = Circle((0,0), 10, None)
print c1.mass
20
c1.gr
I hesitated a while before deciding not to include it! Apart from python core
development what would be the reasons to work mostly on this version ?
I'll fix the omission right ahead.
—
Tagada tsouin tsouin
On Wed, Dec 10, 2014 at 10:57 PM, Chris Angelico wrote:
> On Thu, Dec 11, 2014 at 3:5
ANNOUNCING
mxODBC Plone/Zope Database Adapter
Version 2.2.0
for the Plone CMS and Zope server platform
Available for Plone 4.0-4.3 and Plone 5.0,
On Thu, 11 Dec 2014 05:19:44 +, Grant Edwards wrote:
> On 2014-12-11, Docfxit wrote:
>
>> I am happy to paste it into a post. The reason I didn't is because
>> it's very large. The Python script is 1239 lines long. The example
>> summary is 105 lines long. The input log is 6810 lines lon
On Wed, 10 Dec 2014 20:23:56 -0800, Docfxit wrote:
> On Wednesday, December 10, 2014 7:55:17 PM UTC-8, Ben Finney wrote:
>> Docfxit writes:
>>
>> > I am happy to paste it into a post. The reason I didn't is because
>> > it's very large. The Python script is 1239 lines long.
>>
>> That's too l
Docfxit wrote:
> I don't know enough about Python to figure out how to isolate where the
> problem is happening.
Can you get hold of the person who wrote the script?
--
https://mail.python.org/mailman/listinfo/python-list
- Original Message -
> From: "ast"
> >
> >> Note : what is the mass of a circle ?
> >
>
> In fact it's a ball moving in a plan.
> I will change that name.
I would advise to remove the the mass parameter of your Sphere initialization.
It could be inconsistent with the radius.
To compute
Hello
I provide two almost identical small test case programs.
The first one works as expected, 'True' is printed on the
console.
With the second one Python complains that 'test' is not
known. I dont understand why.
Python 3.4, windows
#
## First
#
fr
-=Scorp=-
Okay, i fixed this limit (truncated) as follows: find python2.7-gdb.py (in
/usr/lib... path) and found/change value for MAX_OUTPUT_LEN const (default
value is 1024), then restart gdb and you'll se new truncate limits.
--
https://mail.python.org/mailman/listinfo/python-list
ast wrote:
> Hello
>
> I provide two almost identical small test case programs.
> The first one works as expected, 'True' is printed on the
> console.
> With the second one Python complains that 'test' is not
> known. I dont understand why.
> #
> ## Second
>
"Steven D'Aprano" a écrit dans le message de
news:54898820$0$12989$c3e8da3$54964...@news.astraweb.com...
As I said, most programming languages work like this. But a small minority
use a different system, called "dynamic scoping". In dynamic scoping, it
doesn't matter *where* a function is d
Firstly, python is one of my two current focus areas, and while I still work
with python 2.7, sort of for backward compatibility, my other focus area is web
development, making use of PHP, javascript, jQuery, MySQL, etc.
And, I develop on windows7 64 bit machines, in conjunction with screen read
"Steven D'Aprano" a écrit dans le message de
news:54898820$0$12989$c3e8da3$54964...@news.astraweb.com...
You can make "test" global by declaring it global:
def try_():
global test
test = True
setup = MyDialog(root)
If that solves your problem to your satisfaction, you can stop r
On Wed, Dec 10, 2014 at 5:59 PM, Bruno Cauet wrote:
> Hi all,
> Last year a survey was conducted on python 2 and 3 usage.
> Here is the 2014 edition, slightly updated (from 9 to 11 questions).
> It should not take you more than 1 minute to fill. I would be pleased if
> you took that time.
>
> Her
On Wed, Dec 10, 2014 at 7:15 PM, Steven D'Aprano
wrote:
> On Wed, 10 Dec 2014 18:18:44 -0800, Rustom Mody wrote:
>
>
> > And going the other way -- no defs only lambdas its this:
> >
> >
> f = lambda : (lambda x= {}: x)
> f()() is f()()
> > False
> d = f()
> d() is d()
> > Tru
Hi,
I have been looking at various places to answer this dilemma:
If a class member function simply tests something and
returns a b::oolean call it
def is_():
pass
like 'is_even'.
Should I define it as a classic method
def is_even(self):
pass
or as a property
@property
def is_even(self
On Thu, Dec 11, 2014 at 3:02 AM, Jean-Michel Pichavant <
jeanmic...@sequans.com> wrote:
> I would advise to remove the the mass parameter of your Sphere
initialization. It could be inconsistent with the radius.
> To compute the mass you would need the radius and the volumetric mass
density.
You a
On Thu, Dec 11, 2014 at 11:03 AM, Ian Kelly wrote:
>
> On Thu, Dec 11, 2014 at 3:02 AM, Jean-Michel Pichavant <
jeanmic...@sequans.com> wrote:
> > I would advise to remove the the mass parameter of your Sphere
initialization. It could be inconsistent with the radius.
> > To compute the mass you wo
On Fri, Dec 12, 2014 at 4:34 AM, Mateusz Loskot wrote:
> If a class member function simply tests something and
> returns a b::oolean call it
>
> def is_():
> pass
>
> like 'is_even'.
>
> Should I define it as a classic method
>
> def is_even(self):
> pass
>
> or as a property
>
> @property
>
On 12/11/2014 09:34 AM, Mateusz Loskot wrote:
>
> def is_():
> pass
>
> like 'is_even'.
>
> Should I define it as a classic method
>
> def is_even(self):
> pass
>
> or as a property
>
> @property
> def is_even(self):
> pass
>
> So, a classic method or a property, which one is the Py
At the start of Chapter 3 of 'Getting Started in Beautiful Soup' it has said to
create a html file, 'ecological
pyramid.html' - which I have already done re:
plants
10
algae
10
deer
1000
deer
1000
On Thursday, December 11, 2014 11:21:52 AM UTC-8, Simon Evans wrote:
> At the start of Chapter 3 of 'Getting Started in Beautiful Soup' it has said
> to create a html file, 'ecological
>
> pyramid.html' - which I have already done re:
> ---
I disagree. I know there's a huge focus on The Big Libraries (and wholesale
migration is all but impossible without them), but the long tail of
libraries is still incredibly important. It's like saying that migrating
the top 10 Perl libraries to Perl 6 would allow people to completely ignore
all of
Please give your environment when starting a new thread. Python version
and OS version. In this case, I'm guessing Windows, because I have to
guess something to give a meaningful answer.
On 12/11/2014 02:21 PM, Simon Evans wrote:
At the start of Chapter 3 of 'Getting Started in Beautiful Sou
On Fri, Dec 12, 2014 at 6:34 AM, Dave Angel wrote:
> Please give your environment when starting a new thread. Python version and
> OS version. In this case, I'm guessing Windows, because I have to guess
> something to give a meaningful answer.
>
> On 12/11/2014 02:21 PM, Simon Evans wrote:
>> Py
On 12/11/2014 02:40 PM, Chris Angelico wrote:
On Fri, Dec 12, 2014 at 6:34 AM, Dave Angel wrote:
Please give your environment when starting a new thread. Python version and
OS version. In this case, I'm guessing Windows, because I have to guess
something to give a meaningful answer.
On 12/11
On Thu, Dec 11, 2014 at 11:35 AM, Mark Roberts wrote:
> I disagree. I know there's a huge focus on The Big Libraries (and wholesale
> migration is all but impossible without them), but the long tail of
> libraries is still incredibly important. It's like saying that migrating the
> top 10 Perl lib
On Thu Dec 11 2014 at 3:14:42 PM Dan Stromberg wrote:
> On Thu, Dec 11, 2014 at 11:35 AM, Mark Roberts wrote:
> > I disagree. I know there's a huge focus on The Big Libraries (and
> wholesale
> > migration is all but impossible without them), but the long tail of
> > libraries is still incredibl
On Wed, Dec 10, 2014, at 21:18, Rustom Mody wrote:
> But I have a different question -- can this be demonstrated without the
> 'is'?
Er, yeah. You can, for example, add an item to one of the dictionaries
and observe that it's not present in the other.
--
https://mail.python.org/mailman/listinfo/p
On Thursday, December 11, 2014 1:32:02 AM UTC-8, Peter Otten wrote:
> Docfxit wrote:
>
> > I don't know enough about Python to figure out how to isolate where the
> > problem is happening.
>
> Can you get hold of the person who wrote the script?
No. I tried. They are not answering their email.
"Giampaolo Rodola'" writes:
> I still think the only *real* obstacle remains the lack of important
> packages such as twisted, gevent and pika which haven't been ported
> yet.
What disqualifies other obstacles from being “*real* obstacles”? How do
you determine that?
> With those ones ported sw
Chris Angelico writes:
> A property should be used if what you're creating is "virtually an
> attribute".
Methods are attributes. Are you distinguishing here between “callable
attribute” versus “non-callable attribute”?
--
\ “Repetition leads to boredom, boredom to horrifying mistakes,
On Thu, Dec 11, 2014 at 1:33 PM, Ben Finney wrote:
> Chris Angelico writes:
>
>> A property should be used if what you're creating is "virtually an
>> attribute".
>
> Methods are attributes. Are you distinguishing here between “callable
> attribute” versus “non-callable attribute”?
Obviously, ye
On Fri, Dec 12, 2014 at 8:33 AM, Ben Finney wrote:
> Chris Angelico writes:
>
>> A property should be used if what you're creating is "virtually an
>> attribute".
>
> Methods are attributes. Are you distinguishing here between “callable
> attribute” versus “non-callable attribute”?
I'm talking c
On Wed, Dec 10, 2014 at 9:01 PM, Steven D'Aprano
wrote:
>
> On Wed, 10 Dec 2014 09:46:55 -0700, Ian Kelly wrote:
>
> > I don't particularly have a problem with functions having attributes,
> > e.g. I think itertools.chain.from_iterable is just peachy. There is a
> > downside though, which is that
2014-12-11 15:47 GMT+01:00 Giampaolo Rodola' :
> I still think the only *real* obstacle remains the lack of important
> packages such as twisted, gevent and pika which haven't been ported yet.
twisted core works on python 3, right now. Contribute to Twisted if
you want to port more code... Or star
Just a gentle reminder that any problems seen with or changes desired to
the python.org website need to be documented on its issue tracker at
https://github.com/python/pythondotorg/issues/. Key players working on
it likely are not aware of discussions here.
--
Ned Deily,
n...@acm.org
--
h
On Dec 11, 2014, at 11:35 AM, Mark Roberts wrote:
>I disagree. I know there's a huge focus on The Big Libraries (and wholesale
>migration is all but impossible without them), but the long tail of
>libraries is still incredibly important.
It is, but I think it's increasingly the case that packages
Chris Kaynor wrote:
> On Wed, Dec 10, 2014 at 7:15 PM, Steven D'Aprano
> wrote:
>> Using "is" you are demonstrating that calling the function twice returns
>> two distinct objects. That is the purpose of "is", to compare object
>> identity. Without "is", you can compare object IDs directly:
>>
>
Tony the Tiger writes:
> radius='10', mass='1'
>
> if radius == '10' ...
>
> if mass == '1' ...
This ignores the problem as stated: The OP wants to distinguish between
a value that was explicitly set by the caller, versus a value that was
set by default because the caller did not specify the par
ast wrote:
> Since try() is a callback function called when a button is pushed,
> with the effect to open a dialog, I tried to define MyDialog class
> inside try(). The program is the following and it works. I no
> longer need to define test as global.
> Is it a good practice to define a class in
Ian Kelly wrote:
> A function, on the
> other hand, is not well suited to be a namespace, because it's not
> expected to provide one.
And that is exactly the point I am making about the inherent
conservativeness of Python developers.
Functions ARE namespaces, like instances of user-defined clas
On Thu, Dec 11, 2014 at 4:28 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
>
> Ian Kelly wrote:
>
> > A function, on the
> > other hand, is not well suited to be a namespace, because it's not
> > expected to provide one.
>
>
> And that is exactly the point I am making about the
On Fri, Dec 12, 2014 at 10:28 AM, Steven D'Aprano
wrote:
> I think that there is a legitimate debate to be had as to whether this
> conservativeness and resistance to change is a good thing or a bad thing,
> but I don't think that there should be any debate about the reality of the
> Python commun
On 11Dec2014 00:19, Ian Kelly wrote:
On Tue, Dec 9, 2014 at 10:16 PM, Cameron Simpson wrote:
- the AA menu buttons are all dysfunctional, being purely javascript; it
would be better if the menu was styled "display=none" by default, and made
visible by javascript
With Javascript enabled, the
> I am network engineer and not expert in programming. I would like to make
> one python script to convert juniper netscreen firewall configuration into
> juniper SRX firewall configuration.
>
Looks pretty tricky, do you have a specification for each format containing
all the possible keywords/val
In article ,
Ian Kelly wrote:
> I never said that functions can't be used as namespaces. I said that
> functions are *bad* namespaces, and I gave reasons why I think this is true.
An excellent example of functions acting as namespaces is nosetest's
@attr() decorator. We use this, for example,
which is more easy and elegant for pulling data out of HTML?
--
https://mail.python.org/mailman/listinfo/python-list
On 12/11/2014 07:02 PM, iMath wrote:
>
> which is more easy and elegant for pulling data out of HTML?
Beautiful Soup is specialized for HTML parsing, and it can deal with
badly formed HTML, but if I recall correctly BeautifulSoup can use the
lxml engine under the hood, so maybe it's the way to g
I was thinking a bit about the following pattern:
value = get_some_value()
while value in undesired_values:
value = get_some_value()
I've always hated code that looks like this. Partly due to the repetition, but
partly also due to the fact that without being able to immediately recognise
th
Nelson Crosby writes:
> I was thinking a bit about the following pattern:
>
> value = get_some_value()
> while value in undesired_values:
> value = get_some_value()
I think that's an anti-pattern (because of the repetition, as you say).
An improvement::
value = some_default_value_such_
On Fri, Dec 12, 2014 at 1:21 PM, Nelson Crosby wrote:
> I was thinking a bit about the following pattern:
>
> value = get_some_value()
> while value in undesired_values:
> value = get_some_value()
>
> I've always hated code that looks like this. Partly due to the repetition,
> but partly also
On 12/10/2014 5:04 PM, Bruno Cauet wrote:
I hesitated a while before deciding not to include it! Apart from python
core development what would be the reasons to work mostly on this version ?
where 'This version' == 3.5. A possible reason: one is developing an
app expected to be released fall
I would prefer:
while value = initial_value in undesired_values:
value = get_some_value()
Seems I've seen something like this before, C, Perl?
Clayton
>-Original Message-
>From: Python-list [mailto:python-list-
>bounces+crk=godblessthe...@python.org] On Behalf Of Ben Finney
>Sen
On 12/11/2014 9:21 PM, Nelson Crosby wrote:
I was thinking a bit about the following pattern:
value = get_some_value()
while value in undesired_values:
value = get_some_value()
This is do_while or do_until. In Python, write it as do_until in this form.
while True:
value = get_some_v
(Please don't top-post; instead, interleave responses inline with the
quoted material and trim the excess. See
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style>.)
"Clayton Kirkwood" writes:
> I would prefer:
> while value = initial_value in undesired_values:
> value = get_so
在 2014年12月11日星期四UTC+8下午1时25分41秒,Michael Torrie写道:
> On 12/10/2014 09:52 PM, iMath wrote:
> > I think the user interface shouldn't be freezed when using
> > concurrent.futures.ThreadPoolExecutor here,as it executes
> > asynchronously , but it doesn't meet my expectations,anyone can
> > explain why ?
On 12/11/2014 08:20 PM, iMath wrote:
> 在 2014年12月11日星期四UTC+8下午1时25分41秒,Michael Torrie写道:
>> On 12/10/2014 09:52 PM, iMath wrote:
> "when it comes to I/O and GUIs, asynchronous calls are always better than
> threads."
>
> I cannot grasp your meaning here, IMO, asynchronous calls are done by using
Hi there,
The list comprehension is results = [d2(t[k]) for k in xrange(1000)], where d2
is a function returning a list, say [x1,x2,x3,x4] for one example. So "results"
is a list consisting of 1000 lists, each of length four. Here, what I want to
get is the sum of 1000 lists, and then the resul
Chris Angelico :
> You could deduplicate it by shifting the condition:
>
> while True:
> value = get_some_value()
> if value not in undesired_values: break
>
> But I'm not sure how common this idiom actually is.
Extremely common, and not only in Python.
Marko
--
https://mail.python.org
On 12/12/2014 06:22, KK Sasa wrote:
Hi there,
The list comprehension is results = [d2(t[k]) for k in xrange(1000)], where d2 is a
function returning a list, say [x1,x2,x3,x4] for one example. So "results" is a
list consisting of 1000 lists, each of length four. Here, what I want to get is the
Michael Torrie :
> An asynchronous API lets you start long-running I/O calls and define a
> function that is automatically called upon completion. In other words
> it's event-driven. Qt may provide everything you need already in an
> asynchronous form.
GUI developers have been doing event-driven
On Thu, Dec 11, 2014 at 6:55 PM, Roy Smith wrote:
>
> In article ,
> Ian Kelly wrote:
>
> > I never said that functions can't be used as namespaces. I said that
> > functions are *bad* namespaces, and I gave reasons why I think this is
true.
>
> An excellent example of functions acting as namesp
On Fri, Dec 12, 2014 at 6:10 PM, Marko Rauhamaa wrote:
> Chris Angelico :
>
>> You could deduplicate it by shifting the condition:
>>
>> while True:
>> value = get_some_value()
>> if value not in undesired_values: break
>>
>> But I'm not sure how common this idiom actually is.
>
> Extremel
On Fri, Dec 12, 2014 at 6:18 PM, Marko Rauhamaa wrote:
> GUI developers have been doing event-driven programming for decades.
> That's an excellent preparation for network programming as well.
> Unfortunately, the minds of a generation of programmers were
> contaminated by the thread craze of the
Hi,
I am running ipython3 on Unix and constantly see this crash -
It happens when i try to issue commands on the ipython interactive shell.
I have tried to set the PYTHONDIR to /var/tmp/ in case there was an issue
accessing the default location of the history file. However, this makes no
differe
Hi Jason
Thanks for the reply. Yes I can make the all possible keywords/values for both
formate. But after that what gonna be the logic to convert one format to other
format. Like to convert one line below are the keywords:
set interface ethernet2/5 ip 10.17.10.1/24 (format 1)
set interfaces ge
69 matches
Mail list logo