On 01/09/2010 14:25, Lie Ryan wrote:
On 09/01/10 17:06, Stefan Behnel wrote:
MRAB, 31.08.2010 23:53:
On 31/08/2010 21:18, Terry Reedy wrote:
On 8/31/2010 12:33 PM, Aleksey wrote:
On Aug 30, 10:38 pm, Tobias Weber wrote:
Hi,
whenever I type an "object literal" I'm unsure what optimisation
wil
On 09/01/10 17:06, Stefan Behnel wrote:
> MRAB, 31.08.2010 23:53:
>> On 31/08/2010 21:18, Terry Reedy wrote:
>>> On 8/31/2010 12:33 PM, Aleksey wrote:
On Aug 30, 10:38 pm, Tobias Weber wrote:
> Hi,
> whenever I type an "object literal" I'm unsure what optimisation
> will do
> t
MRAB, 31.08.2010 23:53:
On 31/08/2010 21:18, Terry Reedy wrote:
On 8/31/2010 12:33 PM, Aleksey wrote:
On Aug 30, 10:38 pm, Tobias Weber wrote:
Hi,
whenever I type an "object literal" I'm unsure what optimisation
will do
to it.
Optimizations are generally implentation dependent. CPython curre
On 31Aug2010 23:38, MRAB wrote:
| On 31/08/2010 23:11, Cameron Simpson wrote:
| >On 31Aug2010 22:53, MRAB wrote:
| >| There's still the possibility of some optimisation. If the resulting
| >| set is never stored anywhere (bound to a name, for example) then it
| >| could be created once. When the
On 31/08/2010 23:11, Cameron Simpson wrote:
On 31Aug2010 22:53, MRAB wrote:
[...]
|>>>def m(arg):
|>>>if arg& set([1,2,3]):
|>
|>set() is a function call, not a literal. When m is called, who knows
|>what 'set' will be bound to? In Py3, at least, you could write {1,2,3},
|>which is much faster
On 31Aug2010 22:53, MRAB wrote:
[...]
| >>>def m(arg):
| >>>if arg& set([1,2,3]):
| >
| >set() is a function call, not a literal. When m is called, who knows
| >what 'set' will be bound to? In Py3, at least, you could write {1,2,3},
| >which is much faster as it avoids creating and deleting a list
On 31/08/2010 21:18, Terry Reedy wrote:
On 8/31/2010 12:33 PM, Aleksey wrote:
On Aug 30, 10:38 pm, Tobias Weber wrote:
Hi,
whenever I type an "object literal" I'm unsure what optimisation will do
to it.
Optimizations are generally implentation dependent. CPython currently
creates numbers, str
On 8/31/2010 12:33 PM, Aleksey wrote:
On Aug 30, 10:38 pm, Tobias Weber wrote:
Hi,
whenever I type an "object literal" I'm unsure what optimisation will do
to it.
Optimizations are generally implentation dependent. CPython currently
creates numbers, strings, and tuple literals just once. Mut
John Nagle, 31.08.2010 21:03:
On 8/30/2010 8:38 AM, Tobias Weber wrote:
whenever I type an "object literal" I'm unsure what optimisation will do
to it.
CPython is a "naive interpreter". It has almost no optimization.
It doesn't even really comprehend "constants".
This is an implementation prob
On 8/30/2010 8:38 AM, Tobias Weber wrote:
Hi,
whenever I type an "object literal" I'm unsure what optimisation will do
to it.
CPython is a "naive interpreter". It has almost no optimization.
It doesn't even really comprehend "constants".
This is an implementation problem, not a language pro
On Aug 30, 10:38 pm, Tobias Weber wrote:
> Hi,
> whenever I type an "object literal" I'm unsure what optimisation will do
> to it.
>
> def m(arg):
> if arg & set([1,2,3]):
> return 4
>
> Is the set created every time the method is called? What about a
> frozenset? Or tuple vs list? After how
Tobias Weber writes:
> Hi,
> whenever I type an "object literal" I'm unsure what optimisation will do
> to it.
>
> def m(arg):
> if arg & set([1,2,3]):
> return 4
>
> Is the set created every time the method is called? What about a
> frozenset? Or tuple vs list? After how many calls per s
Tobias Weber gmx.net> writes:
>
> Hi,
> whenever I type an "object literal" I'm unsure what optimisation will do
> to it.
>
> def m(arg):
> if arg & set([1,2,3]):
> return 4
>
> Is the set created every time the method is called?
Yes, and the list.
> What about a
> frozenset?
Yep.
On Monday 30 August 2010, it occurred to Tobias Weber to exclaim:
> Hi,
> whenever I type an "object literal" I'm unsure what optimisation will do
> to it.
>
> def m(arg):
> if arg & set([1,2,3]):
> return 4
>
> Is the set created every time the method is called? What about a
> frozenset? O
14 matches
Mail list logo