Opened 4 years ago

Last modified 2 years ago

#19580 needs_work enhancement

use locals() in growth group factory

Reported by: dkrenn Owned by:
Priority: major Milestone: sage-6.10
Component: asymptotic expansions Keywords:
Cc: behackl, cheuberg Merged in:
Authors: Daniel Krenn Reviewers:
Report Upstream: N/A Work issues:
Branch: u/dkrenn/asy/locals (Commits) Commit: fc7434aafcddbf0361d60801a106348e88101f72
Dependencies: #19528 Stopgaps:

Description

Make

sage: Z = ZZ
sage: GrowthGroup('n^Z')

working.

Change History (10)

comment:1 Changed 4 years ago by dkrenn

  • Branch set to u/dkrenn/asy/locals

comment:2 Changed 4 years ago by dkrenn

  • Authors set to Daniel Krenn
  • Cc behackl cheuberg added
  • Commit set to 81e5453fb9d2e7fd1af5380ac7a7bf15742554a6
  • Status changed from new to needs_review

New commits:

8989602function locals_of_caller
2a57f15use locals in repr_short_to_parent
39af603allow locals in GrowthGroupFactory
d4bbc88locals during construction of an asymptotic ring
81e5453locals in change_parameter

comment:3 Changed 4 years ago by git

  • Commit changed from 81e5453fb9d2e7fd1af5380ac7a7bf15742554a6 to c2645790fe0560a484e9838dd260ed8ea937c0ec

Branch pushed to git repo; I updated commit sha1. New commits:

421e377mutable poset map: remove elements ``None``
1d28240term monoid: write change_parameter
2c37889correct a bug in change_parameter
bdcb72bwrite map_coefficients
c264579Merge branch 'asy/map_coefficients' into asy/locals

comment:4 Changed 4 years ago by dkrenn

  • Dependencies set to #19528

Merged in #19528 due to a merge conflict.

comment:5 Changed 4 years ago by git

  • Commit changed from c2645790fe0560a484e9838dd260ed8ea937c0ec to 5f884c55e8c1e599f2d4fbc36112372903579511

Branch pushed to git repo; I updated commit sha1. New commits:

5f884c5complete merge

comment:6 Changed 4 years ago by nbruin

Would it be possible to just not do this? It's a strong indication of bad design if you end up parsing strings wrt. locals/globals dictionaries. Variable names do not belong in strings.

You'll probably get scoping/shadowing in the different dictionaries wrong. E.g. what about

[GrowthGroup("n^Z") for Z in [1..10]]

and, subtly different,

list(GrowthGroup("n^Z") for Z in [1..10])

And what would

[GrowthGroup("n^Z") for n in [1..10] for Z in [1..10]]

do? I know: it probably gives errors because it's not passing the right values here, but what is different about n wrt. Z that one name needs to be looked up in a scope and the other doesn't?

If you need a construction like this, then something along the lines

PreGrowthGroup("n")^Z

is probably much safer.

You might want to check on sage-devel what the opinions of other developers are about letting local/global variable names sneak into strings.

comment:7 Changed 3 years ago by cheuberg

  • Status changed from needs_review to needs_work

does not merge (cf. patchbot)

comment:8 Changed 3 years ago by git

  • Commit changed from 5f884c55e8c1e599f2d4fbc36112372903579511 to fc7434aafcddbf0361d60801a106348e88101f72

Branch pushed to git repo; I updated commit sha1. New commits:

f396470Trac #19850: use absolute imports
fc7434aMerge tag '7.5.rc1' into t/19580/asy/locals

comment:9 Changed 3 years ago by dkrenn

  • Status changed from needs_work to needs_review

comment:10 Changed 2 years ago by chapoton

  • Status changed from needs_review to needs_work

branch does no longer apply

Note: See TracTickets for help on using tickets.