Op 20-08-13 07:48, Steven D'Aprano schreef:
> On Mon, 19 Aug 2013 22:34:00 +0200, Antoon Pardon wrote:
>
>> Op 19-08-13 19:05, Steven D'Aprano schreef:
>>
>>
>>> I wish Python had stronger support for enforcing constantness, to whit,
>>> some way to say "you can't rebind or delete this name once i
Le mardi 20 août 2013 07:48:37 UTC+2, Steven D'Aprano a écrit :
> On Mon, 19 Aug 2013 22:34:00 +0200, Antoon Pardon wrote:
>
>
>
> > Op 19-08-13 19:05, Steven D'Aprano schreef:
>
> >
>
> >
>
> >> I wish Python had stronger support for enforcing constantness, to whit,
>
> >> some way to say
Sudheer Joseph writes:
> ...
> I wonder how the code developers work in this case
> every time a function is modified one has to restart the console is a
> nightmare...
I use the "reload" approach a lot when developing isolated classes
or functions and "plone.reload" for
On Tue, 20 Aug 2013 00:49:16 +0100, Fábio Santos wrote:
> I had an idea for a handy syntax which I thought of while designing a
> language for fun. This would be a syntax for creating, from a function,
> a function which is just like it but with some parameters pre-filled.
> The usage is much like
On Mon, 19 Aug 2013 22:34:00 +0200, Antoon Pardon wrote:
> Op 19-08-13 19:05, Steven D'Aprano schreef:
>
>
>> I wish Python had stronger support for enforcing constantness, to whit,
>> some way to say "you can't rebind or delete this name once it is
>> bound". You can do it with attributes, by u
On Mon, 19 Aug 2013 22:24:46 +0200, Uwe Rangs wrote:
> My workflow at the moment is to set a link: mv python python_old
> ln -s /usr/local/bin/python3.2 python
>
> But is this a good idea?
You should never change the system Python, since that runs the risk of
breaking system tools that expect
On 7/08/2013 6:50 PM, liuerfire Wang wrote:
> Here is a list x = [b, a, c] (a, b, c are elements of x. Each of them
> are different type). Now I wanna generate a new list as [b, b, a, a, c, c].
from itertools import chain
new_list = list(chain.from_iterable(zip(x,x)))
--
http://mail.python.org
In article ,
Ben Finney wrote:
> Developers use the interactive console for exploring, not developing.
I am reminded of a (very strange) guy I went to school with. He linked
/dev/tty to /dev/tty.c. That allowed him to run "cc /dev/tty.c" and
type in the text of a C program to compile.
--
h
Antoon Pardon writes:
> Op 19-08-13 09:45, Dave Angel schreef:
> > Antoon Pardon wrote:
> >> I think you are overstating your case. Classes and functions are
> >> variables too and in general nobody seems to have a problem with
> >> them being global.
> >
> > It's global *variables* that are to
Sudheer Joseph writes:
> I wonder how the code developers work in this case every time a
> function is modified one has to restart the console is a nightmare...
Developers use the interactive console for exploring, not developing.
Use it to test, to confirm a suspicion about what a function cal
I had an idea for a handy syntax which I thought of while designing a
language for fun. This would be a syntax for creating, from a function, a
function which is just like it but with some parameters pre-filled. The
usage is much like functools.partials, and my proposed syntax is like this:
def sp
On Mon, Aug 19, 2013 at 4:14 PM, Uwe Rangs wrote:
> Hello,
>
> how can I change the default version of python with os x 10.7.
>
> Thanks,
> Uwe
>
> --
> http://mail.python.org/mailman/listinfo/python-list
You might want to look at this:
http://stackoverflow.com/questions/5846167/how-to-change-d
My workflow at the moment is to set a link:
mv python python_old
ln -s /usr/local/bin/python3.2 python
But is this a good idea?
-- Uwe
On 2013-08-19 20:14:04 +, Uwe Rangs said:
Hello,
how can I change the default version of python with os x 10.7.
Thanks,
Uwe
--
http://mail.python.org
Op 19-08-13 19:05, Steven D'Aprano schreef:
I wish Python had stronger support for enforcing constantness, to whit,
some way to say "you can't rebind or delete this name once it is bound".
You can do it with attributes, by use of property, or in C extensions,
but you cannot do it with top-level
Hello,
how can I change the default version of python with os x 10.7.
Thanks,
Uwe
--
http://mail.python.org/mailman/listinfo/python-list
Tamer Higazi wrote:
> Hi people!
>
> I have asked myself a question, if there is a opposite of "__init__.py"
> like "__del__.py" ?!
Others have answered your question, but I wanted to correct a
misunderstanding:
>
> I want, that when the application ends, certain functions are executed.
> I know
Op 19-08-13 18:57, Steven D'Aprano schreef:
On Mon, 19 Aug 2013 10:16:36 +0200, Antoon Pardon wrote:
Op 19-08-13 09:45, Dave Angel schreef:
Antoon Pardon wrote:
Op 17-08-13 17:01, Steven D'Aprano schreef:
And here you re-import the name "y" from struct_global. That rebinds
the current modu
Op 19-08-13 17:04, Chris Angelico schreef:
On Mon, Aug 19, 2013 at 3:55 PM, Antoon Pardon
wrote:
Pity enough they chose a
way that didn't allow programmers to protect names they thought
important enough to do so too.
As of Python 3, we can redefine something that used to be a keyword,
which i
On Mon, Aug 19, 2013 at 6:16 PM, Steven D'Aprano
wrote:
> On Mon, 19 Aug 2013 16:57:37 +, Steven D'Aprano wrote:
>
>> def func(x):
>> ...
>>
>> # later
>> save_func = func
>> func = lambda x, y: do_stuff(x, 3*y)-4 result =
>> something_that_calls_func()
>> func = save_func
>>
>>
>> Nasty,
On Mon, 19 Aug 2013 16:57:37 +, Steven D'Aprano wrote:
> def func(x):
> ...
>
> # later
> save_func = func
> func = lambda x, y: do_stuff(x, 3*y)-4 result =
> something_that_calls_func()
> func = save_func
>
>
> Nasty, horrible code, yes? But it's nasty and horrible because "func" is
>
- Original Message -
> From: Dave Angel
> To: python-list@python.org
> Cc:
> Sent: Monday, 19 August 2013 4:45 PM
> Subject: Re: refresing the edited python function
>
> Sudheer Joseph wrote:
>
>> Thank you Dieter,
>> I never thought it will be so difficult task,
On Mon, 19 Aug 2013 18:48:19 +0200, Tamer Higazi wrote:
> Hi people!
>
> I have asked myself a question, if there is a opposite of "__init__.py"
> like "__del__.py" ?!
No. If you want to run code when your application is shutting down, run
it just before your code finishes:
def main():
do_t
On Mon, 19 Aug 2013 09:32:53 +0100, Chris Angelico wrote:
> Python does have constants. It just doesn't have interpreter support for
> them. Same as private members, in fact.
"Constant by convention".
I wish Python had stronger support for enforcing constantness, to whit,
some way to say "you c
Yes, see the atexit module:
http://docs.python.org/3/library/atexit.html
On Mon, Aug 19, 2013 at 10:48 AM, Tamer Higazi wrote:
> Hi people!
>
> I have asked myself a question, if there is a opposite of "__init__.py"
> like "__del__.py" ?!
>
> I want, that when the application ends, certain funct
On Mon, 19 Aug 2013 10:16:36 +0200, Antoon Pardon wrote:
> Op 19-08-13 09:45, Dave Angel schreef:
>> Antoon Pardon wrote:
>>
>>> Op 17-08-13 17:01, Steven D'Aprano schreef:
And here you re-import the name "y" from struct_global. That rebinds
the current module's "y" with whatever v
Hi people!
I have asked myself a question, if there is a opposite of "__init__.py"
like "__del__.py" ?!
I want, that when the application ends, certain functions are executed.
I know I could make a constructor and a destructor, but I simply want to
know if there is a opposite
Thanks
Tame
On Mon, Aug 19, 2013 at 3:55 PM, Antoon Pardon
wrote:
> Pity enough they chose a
> way that didn't allow programmers to protect names they thought
> important enough to do so too.
As of Python 3, we can redefine something that used to be a keyword,
which is even stronger than a constant.
def pri
Op 19-08-13 14:33, Dave Angel schreef:
> Antoon Pardon wrote:
>
>> Op 19-08-13 11:18, Chris Angelico schreef:
>
>>> The issue
>>> was regarding imports, and it's perfectly safe to import a constant,
>>> even if the interpreter doesn't protect you from then being a total
>>> idiot and changing
On 08/18/2013 05:52 PM, Roy Smith wrote:
> In article ,
> Anthony Papillion wrote:
>
>> I've just started working with the Crypto library and I've already run
>> into a wall even though I'm following a tutorial. Basically, I'm trying
>> to encrypt a string using AES in CBC mode. Here is the code
Antoon Pardon wrote:
> Op 19-08-13 11:18, Chris Angelico schreef:
>> The issue
>> was regarding imports, and it's perfectly safe to import a constant,
>> even if the interpreter doesn't protect you from then being a total
>> idiot and changing it.
>
> Python doesn't have constants, so you sta
On 08/18/2013 05:29 PM, Skip Montanaro wrote:
>> When I run the code above, I am told that the IV must be 16 bytes long.
>> I'm assuming that the IV (I know that means "Initialization Vector") is
>> either the key OR something else I can set. But I don't know how or what
>> to do.
>
> Does this St
Op 19-08-13 11:18, Chris Angelico schreef:
> On Mon, Aug 19, 2013 at 10:03 AM, Antoon Pardon
> wrote:
>> This is irrelevant. That some context defines a constant, and that you
>> can use a variable with the same name as a constant in python, doesn't
>> contradict the statement that python (as a la
Tobias Müller wrote:
> I'm facing an issue with NodeTransformer, a tool used for Python AST
> manipulations.
>
> Last week I posted on stackoverflow.com, but there are no responses yet.
> Maybe someone reading the mailing list can have a look and leave me a
> response here or over there?
>
> htt
Sudheer Joseph wrote:
> Thank you Dieter,
> I never thought it will be so difficult task, All I was
> thinking was that, I just do not know how it is done. I wonder how the code
> developers work in this case every time a function is modified one has to
> restart the consol
On Mon, Aug 19, 2013 at 10:19 AM, Tobias Müller wrote:
> Hi
>
> I'm facing an issue with NodeTransformer, a tool used for Python AST
> manipulations.
>
> Last week I posted on stackoverflow.com, but there are no responses yet.
> Maybe someone reading the mailing list can have a look and leave me a
Hi
I'm facing an issue with NodeTransformer, a tool used for Python AST
manipulations.
Last week I posted on stackoverflow.com, but there are no responses yet.
Maybe someone reading the mailing list can have a look and leave me a
response here or over there?
http://stackoverflow.com/questions/18
Chris Angelico wrote:
> On Mon, Aug 19, 2013 at 10:03 AM, Antoon Pardon
> wrote:
>> This is irrelevant. That some context defines a constant, and that you
>> can use a variable with the same name as a constant in python, doesn't
>> contradict the statement that python (as a language) doesn't has
On Mon, Aug 19, 2013 at 10:03 AM, Antoon Pardon
wrote:
> This is irrelevant. That some context defines a constant, and that you
> can use a variable with the same name as a constant in python, doesn't
> contradict the statement that python (as a language) doesn't has
> constants. There is nothing
Op 19-08-13 10:32, Chris Angelico schreef:
> On Mon, Aug 19, 2013 at 9:16 AM, Antoon Pardon
> wrote:
>> Op 19-08-13 09:45, Dave Angel schreef:
>>> Antoon Pardon wrote:
I think you are overstating your case. Classes and functions are
variables too and in general nobody seems to have a pro
Thank you Dieter,
I never thought it will be so difficult task, All I was
thinking was that, I just do not know how it is done. I wonder how the code
developers work in this case every time a function is modified one has to
restart the console is a nightmare... Hope one day
On Mon, Aug 19, 2013 at 9:16 AM, Antoon Pardon
wrote:
> Op 19-08-13 09:45, Dave Angel schreef:
>> Antoon Pardon wrote:
>>> I think you are overstating your case. Classes and functions are
>>> variables too and in general nobody seems to have a problem with them
>>> being global.
>>>
>>
>> It's glo
Op 19-08-13 09:45, Dave Angel schreef:
> Antoon Pardon wrote:
>
>> Op 17-08-13 17:01, Steven D'Aprano schreef:
>>>
>>> And here you re-import the name "y" from struct_global. That rebinds the
>>> current module's "y" with whatever value struct_global.y has *now*,
>>> rather than a second (or a m
Antoon Pardon wrote:
> Op 17-08-13 17:01, Steven D'Aprano schreef:
>>
>> And here you re-import the name "y" from struct_global. That rebinds the
>> current module's "y" with whatever value struct_global.y has *now*,
>> rather than a second (or a minute, or an hour) earlier when the first
>> i
On Sun, 18 Aug 2013 22:36:01 +0530, Ganesh Pal wrote:
> Please find the comments >>> inline
Please don't do that!
"Arrows" > are used for quoting in emails. If you prefix your *new*
comments using >>> it looks like they were quoted *three messages back*.
You should be able to configure your em
Op 17-08-13 17:01, Steven D'Aprano schreef:
>
> And here you re-import the name "y" from struct_global. That rebinds the
> current module's "y" with whatever value struct_global.y has *now*,
> rather than a second (or a minute, or an hour) earlier when the first
> import took place. Obviously a
On Sun, 18 Aug 2013 18:15:10 +0100, Joshua Landau wrote:
> On 17 August 2013 17:17, Steven D'Aprano
> wrote:
>> On Sat, 17 Aug 2013 05:26:32 -0700, fsaldan1 wrote:
>>> how do I
>>> deal with the fact that other programmers can easily alter the values
>>> of members of my classes?
>> ...
>> If the
46 matches
Mail list logo