Questions tagged [import]
The import tag has no usage guidance.
35
questions
0
votes
1
answer
91
views
Is it bad practice to export all the names from one module both as named exports and as a default export?
I like to export the names in my modules both as individual named exports and grouped together in a default export. Like this:
// mod.js
export function f() {}
export const x = true
export default {f,...
0
votes
1
answer
375
views
What's the best way to import a python module in a python module without cluttering the modules namepace? [closed]
Let's say I am writing a python module module.py. Which provides functionalities for other parts of my code. Of course, the module has to import other modules. A simple example:
import abc as _abc
...
0
votes
5
answers
563
views
Why don't languages auto import everything?
Why is there a such thing as import in programming languages? If a package does not exist, then trying to import it would cause an error anyway. So why don't languages just auto import ALL available ...
0
votes
1
answer
723
views
How to use lazy import to speed up a list of known types in python? [closed]
I have an application in which the user can describe an analysis job via a yaml like
analysis:
learner:
name: LinearRegression
args:
solver: liblinear
and then it is parsed to ...
0
votes
1
answer
83
views
Better design for a REST import into web store
I have an import that needs to grab data from a REST service and import into an web store. It's basically an ETL type of service, but because the REST service can be slow and I don't want to call it ...
0
votes
2
answers
99
views
Transferring data from 1 web app into another offline
I have a web app that will be used locally on 2 different site. The program is a Vue web app made with node.js and express, using MySQL database. Due to limitation (no internet in site 1), there is no ...
1
vote
1
answer
358
views
Python Unit Tests Mocking Imports - Removing Dependencies for CI/CD
I have a project written in python that I would like to create unit tests on.
This project has a dependency on a database project which is a sort of abstraction layer to data connections.
The issue ...
-1
votes
1
answer
2k
views
Python dynamically import modules
I am trying to find the best practice for importing modules dynamically. I have multiple files in a specific folder called providers which contain a class Updater and all of them have the same objects....
3
votes
1
answer
1k
views
Strictly only importing modules in subdirectories: is this a good rule?
I'm making my 1st official project. It's written in Python, is open-sources, and I'd like people to be able to freely and easily fork and modify the code. The project name is "shelf" and the ...
1
vote
1
answer
220
views
Component based architectures in JS / PHP: what indicators suggest that a UI element ought to be written as an importable component?
N.B. Several months after initially asking this question (and not coming up with any satisfactory answers) I am now learning to use HTML Custom Elements / WebComponents. It seems the same question ...
5
votes
1
answer
605
views
Are legacy C# DataTable/SqlDataAdapters exponentially faster than SqlConnection/SqlCommand and/or LINQ to SQL DataContext.ExecuteCommand calls? [closed]
I can't believe DataTable/SqlDataAdapter massively beat out System.Data.Linq.DataContext.ExecuteCommand and ExecuteNonQuery (tried with both Stored Procedures and command text) and just straight ...
1
vote
0
answers
47
views
How to develop an Import/Export Functionality for my node application
I have a configuration application in Nodejs. It has a Component with name and uuid. A Component can have many Schemas. A Schema has a uuid, name, componentId, json. A Schema can have many ...
-2
votes
1
answer
281
views
Store line numbers of CSV in the database
In our environment, we often have to import CSV files into a database, where each line represents a record. Though there is no actual business use case for storing the original line numbers inside the ...
7
votes
2
answers
2k
views
Why is it necessary to "import" a library first before usage?
My question regards the use of import statements.
In most programming languages I've come across (e.g. Python, Scala, Go), it is necessary to first import a library before you can use its functions.
...
7
votes
2
answers
3k
views
Why should imports be made at the beginning
Why is it considered good style to do all imports in a python application at the beginning, even if what is imported is used only once?
I have been programming only shorter pieces of software for a ...